Skip to content

Commit

Permalink
Production images on CI are now built from packages (apache#12685)
Browse files Browse the repository at this point in the history
So far, the production images of Airflow were using sources
when they were built on CI. This PR changes that, to build
airflow + providers packages first and install them
rather than use sources as installation mechanism.

Part of apache#12261
  • Loading branch information
potiuk authored Dec 6, 2020
1 parent c045ff3 commit ed1825c
Show file tree
Hide file tree
Showing 48 changed files with 862 additions and 381 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
!.github
!empty

# This folder is for you if you want to add any files to the docker context when you build your own
# This folder is for you if you want to add any packages to the docker context when you build your own
# docker image. most of other files and any new folder you add will be excluded by default
# if you need other types of files - please add the extensions here.
!docker-context-files

# Avoid triggering context change on README change (new companies using Airflow)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-images-workflow-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ on: # yamllint disable-line rule:truthy
types: ['requested']
env:
MOUNT_LOCAL_SOURCES: "false"
MOUNT_FILES: "true"
FORCE_ANSWER_TO_QUESTIONS: "yes"
FORCE_PULL_IMAGES: "true"
CHECK_IMAGE_FOR_REBUILD: "true"
Expand Down Expand Up @@ -319,7 +318,7 @@ jobs:
- name: "Setup python"
uses: actions/setup-python@v2
with:
python-version: ${{ needs.build-info.outputs.defaultPythonVersion }}
python-version: ${{ matrix.python-version }}
if: steps.defaults.outputs.proceed == 'true'
- name: >
Override "scripts/ci" with the "${{ needs.cancel-workflow-runs.outputs.targetBranch }}" branch
Expand All @@ -336,7 +335,8 @@ jobs:
if: steps.defaults.outputs.proceed == 'true'
- name: "Build CI images ${{ matrix.python-version }}:${{ github.event.workflow_run.id }}"
run: ./scripts/ci/images/ci_prepare_ci_image_on_ci.sh
if: matrix.image-type == 'CI' && steps.defaults.outputs.proceed == 'true'
# locally built CI image is needed to prepare packages for PROD image build
if: steps.defaults.outputs.proceed == 'true'
- name: "Push CI images ${{ matrix.python-version }}:${{ github.event.workflow_run.id }}"
run: ./scripts/ci/images/ci_push_ci_images.sh
if: matrix.image-type == 'CI' && steps.defaults.outputs.proceed == 'true'
Expand Down
32 changes: 22 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ on: # yamllint disable-line rule:truthy
env:

MOUNT_LOCAL_SOURCES: "false"
MOUNT_FILES: "true"
FORCE_ANSWER_TO_QUESTIONS: "yes"
FORCE_PULL_IMAGES: "true"
CHECK_IMAGE_FOR_REBUILD: "true"
Expand Down Expand Up @@ -385,10 +384,16 @@ jobs:
run: ./scripts/ci/provider_packages/ci_prepare_provider_readmes.sh
- name: "Prepare provider packages"
run: ./scripts/ci/provider_packages/ci_prepare_provider_packages.sh
- name: "Install and test provider packages via .whl files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh whl
- name: "Install and test provider packages via .tar.gz files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh tar.gz
env:
PACKAGE_FORMAT: "both"
- name: "Install and test provider packages via wheel files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh
env:
PACKAGE_FORMAT: "wheel"
- name: "Install and test provider packages via sdist files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh
env:
PACKAGE_FORMAT: "sdist"
- name: "Upload provider package artifacts"
uses: actions/upload-artifact@v2
if: always()
Expand All @@ -414,6 +419,7 @@ jobs:
PYTHON_MAJOR_MINOR_VERSION: ${{needs.build-info.outputs.defaultPythonVersion}}
VERSION_SUFFIX_FOR_PYPI: "a2"
VERSION_SUFFIX_FOR_SVN: "a2"
PACKAGE_FORMAT: "both"
if: needs.build-info.outputs.image-build == 'true'
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
Expand All @@ -430,12 +436,18 @@ jobs:
run: ./scripts/ci/provider_packages/ci_prepare_provider_readmes.sh
- name: "Prepare provider packages"
run: ./scripts/ci/provider_packages/ci_prepare_provider_packages.sh
- name: "Prepare airflow packages so that they can be installed"
env:
PACKAGE_FORMAT: "both"
- name: "Prepare airflow package so that it can be installed"
run: ./scripts/ci/build_airflow/ci_build_airflow_package.sh
- name: "Install and test provider packages via .whl files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh whl
- name: "Install and test provider packages via .tar.gz files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh tar.gz
- name: "Install and test provider packages via wheel files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh
env:
PACKAGE_FORMAT: "wheel"
- name: "Install and test provider packages via sdist files"
run: ./scripts/ci/provider_packages/ci_install_and_test_provider_packages.sh
env:
PACKAGE_FORMAT: "sdist"
- name: "Upload provider package artifacts"
uses: actions/upload-artifact@v2
if: always()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scheduled_quarantined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ on: # yamllint disable-line rule:truthy

env:
MOUNT_LOCAL_SOURCES: "false"
MOUNT_FILES: "true"
FORCE_ANSWER_TO_QUESTIONS: "yes"
FORCE_PULL_IMAGES: "true"
CHECK_IMAGE_FOR_REBUILD: "true"
Expand Down
Loading

0 comments on commit ed1825c

Please sign in to comment.