Skip to content

Commit 2d086d7

Browse files
authored
[AIRFLOW-4117] Travis CI uses multi-stage images to run tests (apache#4938)
1 parent 6d78d7f commit 2d086d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3296
-1026
lines changed

.dockerignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@
3030
!airflow
3131
!dags
3232
!dev
33-
#!/docs - we do not need docs in the Docker!
33+
!docs
3434
!licenses
3535
!scripts
3636
!tests
3737

3838
!.coveragerc
3939
!.rat-excludes
40+
!.flake8
41+
!pylintrc
4042
!LICENSE
4143
!MANIFEST.in
4244
!NOTICE
45+
!CHANGELOG.txt
46+
!.github
47+
!run-tests
4348

4449
# Avoid triggering context change on README change (new companies using Airflow)
4550
# So please do not uncomment this line ;)
@@ -98,3 +103,7 @@ airflow/www/static/docs
98103
# Exclude auto-generated Finder files on Mac OS
99104
**/.DS_Store
100105
**/Thumbs.db
106+
107+
# Exclude docs generated files
108+
docs/_build/
109+
docs/_api/

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
22
max-line-length = 110
33
ignore = E731,W504
4-
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg,*/_vendor/*,node_modules
4+
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.eggs,*.egg,*/_vendor/*,node_modules
55
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,7 @@ airflow-*.pid
158158
.mypy_cache/
159159
.dmypy.json
160160
dmypy.json
161+
162+
# Needed for CI Dockerfile build system
163+
.build
164+
/tmp

.travis.yml

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,61 @@
1818
#
1919
dist: xenial
2020
language: python
21-
python:
22-
- "3.6"
2321
env:
2422
global:
25-
- TRAVIS_CACHE=$HOME/.travis_cache/
26-
- CASS_DRIVER_BUILD_CONCURRENCY=8
27-
- CASS_DRIVER_NO_CYTHON=1
23+
- BUILD_ID=${TRAVIS_BUILD_ID}
24+
- AIRFLOW_CONTAINER_BRANCH_NAME=${TRAVIS_BRANCH}
2825
matrix:
29-
- TOX_ENV=py35-backend_mysql-env_docker PYTHON_VERSION=3
30-
- TOX_ENV=py35-backend_sqlite-env_docker PYTHON_VERSION=3
31-
- TOX_ENV=py35-backend_postgres-env_docker PYTHON_VERSION=3
32-
- TOX_ENV=py35-backend_postgres-env_kubernetes KUBERNETES_VERSION=v1.13.0 PYTHON_VERSION=3
33-
26+
- BACKEND=mysql ENV=docker
27+
- BACKEND=postgres ENV=docker
28+
- BACKEND=sqlite ENV=docker
29+
- BACKEND=postgres ENV=kubernetes KUBERNETES_VERSION=v1.13.0
30+
python:
31+
- "3.6"
32+
- "3.5"
33+
matrix:
34+
exclude:
35+
- env: BACKEND=postgres ENV=docker
36+
python: "3.5"
37+
- env: BACKEND=mysql ENV=docker
38+
python: "3.5"
39+
- env: BACKEND=postgres ENV=kubernetes KUBERNETES_VERSION=v1.13.0
40+
python: "3.5"
41+
- env: BACKEND=sqlite ENV=docker
42+
python: "3.6"
3443
stages:
3544
- pre-test
3645
- test
37-
3846
jobs:
3947
include:
4048
- name: Flake8
4149
stage: pre-test
42-
install: pip install flake8
43-
script: flake8
50+
script: ./scripts/ci/ci_flake8.sh
51+
install: skip
4452
- name: mypy
4553
stage: pre-test
46-
install: pip install mypy
47-
script: mypy airflow tests
54+
script: ./scripts/ci/ci_mypy.sh
55+
install: skip
4856
- name: Check license header
4957
stage: pre-test
58+
script: ./scripts/ci/ci_check_license.sh
5059
install: skip
51-
script: scripts/ci/6-check-license.sh
5260
- name: Lint Dockerfile
5361
stage: pre-test
62+
script: ./scripts/ci/ci_lint_dockerfile.sh
5463
install: skip
55-
script: scripts/ci/ci_lint_dockerfile.sh
5664
- name: Check docs
57-
stage: pre-test
58-
install: pip install -e .[doc]
59-
script: docs/build.sh
65+
stage: test
66+
script: ./scripts/ci/ci_docs.sh
67+
install: skip
6068
- name: Pylint
6169
stage: pre-test
62-
install: pip install pylint~=2.3.1 # Ensure the same version as in setup.py
63-
script: scripts/ci/ci_pylint.sh
64-
cache: false
65-
cache:
66-
directories:
67-
- $HOME/.wheelhouse/
68-
- $HOME/.cache/pip
69-
- $HOME/.travis_cache/
70+
script: ./scripts/ci/ci_pylint.sh
71+
install: skip
72+
services:
73+
- docker
7074
before_install:
71-
# Required for K8s v1.10.x. See
72-
# https://github.com/kubernetes/kubernetes/issues/61058#issuecomment-372764783
73-
- if [ ! -z "$KUBERNETES_VERSION" ]; then sudo mount --make-shared / && sudo service docker restart; fi
75+
- ./scripts/ci/ci_before_install.sh
7476
install:
75-
- pip install --upgrade pip
76-
- docker-compose -f scripts/ci/docker-compose.yml pull --quiet
77-
script:
78-
- if [ -z "$KUBERNETES_VERSION" ]; then
79-
docker-compose --log-level ERROR -f scripts/ci/docker-compose.yml run airflow-testing /app/scripts/ci/run-ci.sh;
80-
fi
81-
- if [ ! -z "$KUBERNETES_VERSION" ]; then
82-
./scripts/ci/kubernetes/minikube/stop_minikube.sh &&
83-
./scripts/ci/kubernetes/setup_kubernetes.sh &&
84-
./scripts/ci/kubernetes/kube/deploy.sh -d persistent_mode &&
85-
MINIKUBE_IP=$(minikube ip) docker-compose --log-level ERROR -f scripts/ci/docker-compose.yml -f scripts/ci/docker-compose-kubernetes.yml run airflow-testing /app/scripts/ci/run-ci.sh;
86-
fi
87-
- if [ ! -z "$KUBERNETES_VERSION" ]; then
88-
./scripts/ci/kubernetes/minikube/stop_minikube.sh &&
89-
./scripts/ci/kubernetes/setup_kubernetes.sh &&
90-
./scripts/ci/kubernetes/kube/deploy.sh -d git_mode &&
91-
MINIKUBE_IP=$(minikube ip) docker-compose --log-level ERROR -f scripts/ci/docker-compose.yml -f scripts/ci/docker-compose-kubernetes.yml run airflow-testing /app/scripts/ci/run-ci.sh;
92-
fi
93-
before_cache:
94-
- sudo chown -R travis:travis $HOME/.cache/pip $HOME/.wheelhouse/
77+
- ./hooks/build
78+
script: "./scripts/ci/ci_run_airflow_testing.sh"

0 commit comments

Comments
 (0)