Skip to content

Commit

Permalink
Relax Permissions for Python3
Browse files Browse the repository at this point in the history
Run as root user due to changes in python logging
  • Loading branch information
hydrosquall committed Oct 16, 2018
1 parent db7eb39 commit 92aaa3a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: required
sudo: false

services:
- docker
Expand All @@ -16,14 +16,15 @@ before_install:
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- chmod +x tests/test_metrics_up.sh


script:
# Test Airflow 1.8 with Python 2
- cd tests/airflow1.8-py2 && docker-compose up -d
- ../${INTEGRATION_TEST_SCRIPT}
- ${TRAVIS_BUILD_DIR}/tests/${INTEGRATION_TEST_SCRIPT}
- docker-compose down

# Test Airflow 1.9 with Python 3
- cd ../../tests/airflow1.9-py3 && docker-compose up -d
- ../${INTEGRATION_TEST_SCRIPT}
- cd ${TRAVIS_BUILD_DIR}/tests/airflow1.9-py3 && docker-compose up -d
- ${TRAVIS_BUILD_DIR}/tests/${INTEGRATION_TEST_SCRIPT}
- docker-compose down
1 change: 0 additions & 1 deletion tests/airflow1.8-py2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: '2'


services:

exporter_postgresql:
Expand Down
5 changes: 4 additions & 1 deletion tests/airflow1.9-py3/airflow/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ USER root

RUN pip3 install prometheus_client

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

# USER airflow
5 changes: 4 additions & 1 deletion tests/test_metrics_up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
# 2. Ensures the Metrics endpoint returned a valid response
# Depends on Curl

AIRFLOW_SLEEP_DURATION=70 # Number of seconds to wait for airflow to start
AIRFLOW_SLEEP_DURATION=90 # Number of seconds to wait for airflow to start
ADMIN_ENDPOINT="http://localhost:8080/admin/"
METRICS_ENDPOINT="http://localhost:8080/admin/metrics/"

# Return nonzero status code if endpoint does not return 200
CURL_FLAGS="--show-error --fail"

echo "Waiting ${AIRFLOW_SLEEP_DURATION} seconds for Airflow to start before pinging"
sleep ${AIRFLOW_SLEEP_DURATION}
curl ${CURL_FLAGS} ${ADMIN_ENDPOINT}
curl ${CURL_FLAGS} ${METRICS_ENDPOINT}

# TODO: validate the contents of the CURLed data

0 comments on commit 92aaa3a

Please sign in to comment.