Skip to content

Remove "eager upgrade" from PROD image completely#33784

Merged
potiuk merged 1 commit into
mainfrom
remove-eager-upgrade-from-dockerfile
Aug 26, 2023
Merged

Remove "eager upgrade" from PROD image completely#33784
potiuk merged 1 commit into
mainfrom
remove-eager-upgrade-from-dockerfile

Conversation

@potiuk

@potiuk potiuk commented Aug 26, 2023

Copy link
Copy Markdown
Member

There were still some left-overs of EAGER_UPGRADE in PROD image
building. Howwever "eager upgrade" only makes sense for CI images.
PROD images when being built should use eager upgrades as they
are produced in the CI image step.

This PR does the following:

  • removes eager upgrade parameters from PROD image
  • instead, prod image build has a new flag for installing
    the images: --use-constraints-for-context-packages which will
    automatically use constraints from "docker-context-files" if
    they are present there.
  • modifies the CI workflows to upload constraints as artifacts
    and download them for PROD image build when "eager upgrade"
    has been used and directs it to use "source" constraints
  • adds back support to "upgrade to newer dependencies" label
    that makes it easy to test "eager upgrade"
  • added --build-progress flag to easier debug long builds

As the result, when PROD image is build in CI:

  • when regular PR is run, it will use latest github "source" constraints
  • whwn "eager upgrade" PR is run, it will use the eager-upgrade
    constraints that were generated during CI build

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:dev-tools area:production-image Production image improvements and fixes labels Aug 26, 2023
@potiuk
potiuk force-pushed the remove-eager-upgrade-from-dockerfile branch from 7c382af to c2a54df Compare August 26, 2023 18:33
@potiuk potiuk added the upgrade to newer dependencies If set, upgrade to newer dependencies is forced label Aug 26, 2023
@potiuk
potiuk force-pushed the remove-eager-upgrade-from-dockerfile branch from c2a54df to ad38876 Compare August 26, 2023 19:43
There were still some left-overs of EAGER_UPGRADE in PROD image
building. Howwever "eager upgrade" only makes sense for CI images.
PROD images when being built should use eager upgrades as they
are produced in the CI image step.

This PR does the following:

* removes eager upgrade parameters from PROD image
* instead, prod image build has a new flag for installing
  the images: --use-constraints-for-context-packages which will
  automatically use constraints from "docker-context-files" if
  they are present there.
* modifies the CI workflows to upload constraints as artifacts
  and download them for PROD image build when "eager upgrade"
  has been used and directs it to use "source" constraints
* adds back support to "upgrade to newer dependencies" label
  that makes it easy to test "eager upgrade"

As the result, when PROD image is build in CI:

* when regular PR is run, it will use latest github "source" constraints
* whwn "eager upgrade" PR is run, it will use the eager-upgrade
  constraints that were generated during CI build
@potiuk
potiuk force-pushed the remove-eager-upgrade-from-dockerfile branch from ad38876 to a85cb5a Compare August 26, 2023 19:44
@potiuk
potiuk marked this pull request as ready for review August 26, 2023 19:45
@potiuk potiuk added this to the Airflow 2.7.1 milestone Aug 26, 2023
@potiuk

potiuk commented Aug 26, 2023

Copy link
Copy Markdown
Member Author

This one should help PROD image to not fail (currently observed in 2-7-test branch - pip could behave strangely on PROD image build when we build it from source providers - this change should make it to use "current build constraints" as source when "eager upgrade" is used.

@potiuk

potiuk commented Aug 26, 2023

Copy link
Copy Markdown
Member Author

I also added back support for "upgrade to newer dependencies" label that makes it easier to test this case.

@potiuk

potiuk commented Aug 26, 2023

Copy link
Copy Markdown
Member Author

All right. Seems it works. I tested it wiht both - regular case and "upgrade to newer dependencies" - we will need that one to cherry-pick it to 2-7 to make it green.

@potiuk
potiuk merged commit 2b1a194 into main Aug 26, 2023
potiuk added a commit that referenced this pull request Aug 26, 2023
There were still some left-overs of EAGER_UPGRADE in PROD image
building. Howwever "eager upgrade" only makes sense for CI images.
PROD images when being built should use eager upgrades as they
are produced in the CI image step.

This PR does the following:

* removes eager upgrade parameters from PROD image
* instead, prod image build has a new flag for installing
  the images: --use-constraints-for-context-packages which will
  automatically use constraints from "docker-context-files" if
  they are present there.
* modifies the CI workflows to upload constraints as artifacts
  and download them for PROD image build when "eager upgrade"
  has been used and directs it to use "source" constraints
* adds back support to "upgrade to newer dependencies" label
  that makes it easy to test "eager upgrade"

As the result, when PROD image is build in CI:

* when regular PR is run, it will use latest github "source" constraints
* whwn "eager upgrade" PR is run, it will use the eager-upgrade
  constraints that were generated during CI build

(cherry picked from commit 2b1a194)
@Taragolis
Taragolis deleted the remove-eager-upgrade-from-dockerfile branch September 26, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:production-image Production image improvements and fixes upgrade to newer dependencies If set, upgrade to newer dependencies is forced

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants