Skip to content

Commit

Permalink
Run airflow using host user permissions instead of root
Browse files Browse the repository at this point in the history
WIP: disable python2 pipeline
  • Loading branch information
hydrosquall committed Oct 18, 2018
1 parent f6bdaa7 commit 8548a3d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tests/airflow1.9-py3/airflow/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ USER root

RUN pip3 install prometheus_client

# RUN mkdir -p /usr/local/airflow/logs && chown airflow -R /usr/local/airflow/logs
# # RUN chown -R airflow /usr/local/airflow

# USER airflow
# Needed to write to mounted directory with proper permissions
USER ${HOST_USER_ID}
1 change: 1 addition & 0 deletions tests/airflow1.9-py3/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflowpass
- POSTGRES_DB=airflow
- HOST_USER_ID=$UID # need to write to mounted files
volumes:
- ../dags:/usr/local/airflow/dags
- ../..:/usr/local/airflow/plugins/airflow-exporter-0.000
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metrics_up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CURL_FLAGS="--show-error --fail"

echo "Waiting ${AIRFLOW_SLEEP_DURATION} seconds for Airflow to start before pinging"
sleep ${AIRFLOW_SLEEP_DURATION}
curl ${CURL_FLAGS} --silent ${ADMIN_ENDPOINT} && echo 'Admin console is up'
curl ${CURL_FLAGS} --silent --output /dev/null ${ADMIN_ENDPOINT} && echo 'Admin console is up'
curl ${CURL_FLAGS} ${METRICS_ENDPOINT}

# TODO: validate the contents of the CURLed data

0 comments on commit 8548a3d

Please sign in to comment.