Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Nov 28, 2020

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 #12261


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@potiuk
Copy link
Member Author

potiuk commented Nov 28, 2020

This is the change we discussed some time ago and captured in #12261. The Production image during CI build is now built from wheels rather than directly from sources to reflect a "real" installation case.

This change modifies the "CI" production image build to first:

  1. Using 'pip download" + constraints file it downloads all .wheel packages that are needed to install airflow with the chosen "extras" for the production image

  2. Buillds all providers packages that are selected for the production

  3. Builds airflow .whl package

  4. Prepares the production image using those wheel files rather than PyPI.

This way this production image for development tests reflects the exact production "content" - all packages (including airflow) are installed, but at the same time we are using latest sources to build those packages, so the image can also be used in K8S tests because it is build from the current (PR) sources.

After preparing the image I am also checking if all the providers are installed as expected

Screenshot from 2020-11-28 12-24-37

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch from 6f840c7 to 397ff13 Compare November 28, 2020 11:27
@potiuk
Copy link
Member Author

potiuk commented Nov 28, 2020

@ashb -> Since you were asking for it. The follow -up to this one will be to build the "DockerHub" images, but that will be a separate PR.

Those will be built differently depending on the image:

  • The DockerHub "master" images will be built in the same way as this PR (whl packages 'pip downloaded' for external dependencies and .whl packages built from current master sources

  • The "official" (non-master) images wil be built from the released PyPI packages rather than wheels,

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch 2 times, most recently from 6b46d37 to 212be60 Compare November 29, 2020 08:59
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch 2 times, most recently from 53e44b0 to 3f87cbc Compare November 29, 2020 14:32
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch from 3f87cbc to 6f7055b Compare November 30, 2020 01:10
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch from 6f7055b to 5a9ac9d Compare November 30, 2020 01:51
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch 3 times, most recently from 59be36e to 46612e3 Compare November 30, 2020 16:33
@potiuk
Copy link
Member Author

potiuk commented Nov 30, 2020

Hey everyone - this looks like is going to be green now. It changes the production image to be build using packages rather than directly Airflow Sources.

This image is now built and verified in the CI and follow up change after this one is merged is to also build image from locally built packages in 2.0 for DockerHub builds. Those images are automatically verified (and #12718 add further checks including nicer way of pip check).

The checks include provider's discovery.

I also described how to use breeze to build and install provider packages very easily in development environment.
It takes three commands:

  • ./breeze prepare-provider-packages [PACKAGE ...]
  • ./breeze prepare-airflow-packages
  • ./breeze --install-airflow-version wheel --install-packages-from-dist --skip-mounting-local-sources

Looking forward to comments.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch 3 times, most recently from a16ac4a to 6f236f6 Compare December 1, 2020 17:54
@potiuk potiuk force-pushed the build-prod-image-from-wheels branch 4 times, most recently from 08ce937 to ccffebc Compare December 4, 2020 16:36
@potiuk
Copy link
Member Author

potiuk commented Dec 4, 2020

I hope this time no Exit 137 and it gets green

@potiuk
Copy link
Member Author

potiuk commented Dec 5, 2020

Same here @ashb - it would be great to get one before RC as this way we actually test "production-like" setup.

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments only -- nothing major

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Dec 6, 2020
@github-actions
Copy link

github-actions bot commented Dec 6, 2020

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk potiuk force-pushed the build-prod-image-from-wheels branch from 3a80180 to c47a56d Compare December 6, 2020 22:02
@github-actions
Copy link

github-actions bot commented Dec 6, 2020

The Workflow run is cancelling this PR. Building images for the PR has failed. Follow the the workflow link to check the reason.

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
@potiuk potiuk force-pushed the build-prod-image-from-wheels branch from c47a56d to 93288b0 Compare December 6, 2020 22:16
@github-actions
Copy link

github-actions bot commented Dec 6, 2020

The Workflow run is cancelling this PR. Building images for the PR has failed. Follow the the workflow link to check the reason.

@potiuk potiuk merged commit ed1825c into apache:master Dec 6, 2020
@potiuk potiuk deleted the build-prod-image-from-wheels branch December 6, 2020 22:36
potiuk added a commit that referenced this pull request Dec 16, 2020
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 #12261

(cherry picked from commit ed1825c)
kaxil pushed a commit that referenced this pull request Jan 21, 2021
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 #12261

(cherry picked from commit ed1825c)
kaxil pushed a commit that referenced this pull request Jan 22, 2021
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 #12261

(cherry picked from commit ed1825c)
kaxil pushed a commit that referenced this pull request Jan 22, 2021
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 #12261

(cherry picked from commit ed1825c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools full tests needed We need to run full set of tests for this PR to merge kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants