Optimize caching installed packages in CI build#37315
Merged
potiuk merged 1 commit intoapache:mainfrom Feb 11, 2024
Merged
Conversation
Some of the recent changes in handling conflicting dependencies broke optimization of installing dependencies from branch tip. The optimisation worked in the way that it installed packages first from branch tip, to make them pre-installed (and cached in docker layer) so that final installatin step with pyproject.toml takes very little time, even if it is changed. The problem was that in case branch tip and constraints conflicted, the installation failed and effectively no packages were installed in the "branch tip" layer, effectively removing the cache. This change fixes it - when we install from branch tip now we are not using constraints, which means that they will never conflict, and this also means that cache will never be empty. It can contain other versions of some of the packages, but vast majority of the packages shoudo be the same as in constraints, so the following installation step should reuse vast majority of already installed packages.
Member
Author
|
Found the reason why some CI image builds are taking 10 minutes instead of expected 2-3 minutes. |
Member
Author
|
Once we get that in, and cache is refreshed, the builds with changed dependencies should takes 5 minutes instead of > 20 minutes BTW. |
hussein-awala
approved these changes
Feb 11, 2024
Member
|
It timeouts after 70 minutes in #37151, is it related? |
Member
Author
Likely not - probably there are some conflicting dependencies there (likely pytest>8 conflicts with something). I can check it in a moment. The way how to check it is to simply get your PR and run |
potiuk
added a commit
that referenced
this pull request
Feb 13, 2024
Some of the recent changes in handling conflicting dependencies broke optimization of installing dependencies from branch tip. The optimisation worked in the way that it installed packages first from branch tip, to make them pre-installed (and cached in docker layer) so that final installatin step with pyproject.toml takes very little time, even if it is changed. The problem was that in case branch tip and constraints conflicted, the installation failed and effectively no packages were installed in the "branch tip" layer, effectively removing the cache. This change fixes it - when we install from branch tip now we are not using constraints, which means that they will never conflict, and this also means that cache will never be empty. It can contain other versions of some of the packages, but vast majority of the packages shoudo be the same as in constraints, so the following installation step should reuse vast majority of already installed packages. (cherry picked from commit 90a650d)
ephraimbuddy
pushed a commit
that referenced
this pull request
Feb 22, 2024
Some of the recent changes in handling conflicting dependencies broke optimization of installing dependencies from branch tip. The optimisation worked in the way that it installed packages first from branch tip, to make them pre-installed (and cached in docker layer) so that final installatin step with pyproject.toml takes very little time, even if it is changed. The problem was that in case branch tip and constraints conflicted, the installation failed and effectively no packages were installed in the "branch tip" layer, effectively removing the cache. This change fixes it - when we install from branch tip now we are not using constraints, which means that they will never conflict, and this also means that cache will never be empty. It can contain other versions of some of the packages, but vast majority of the packages shoudo be the same as in constraints, so the following installation step should reuse vast majority of already installed packages. (cherry picked from commit 90a650d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of the recent changes in handling conflicting dependencies broke optimization of installing dependencies from branch tip.
The optimisation worked in the way that it installed packages first from branch tip, to make them pre-installed (and cached in docker layer) so that final installatin step with pyproject.toml takes very little time, even if it is changed.
The problem was that in case branch tip and constraints conflicted, the installation failed and effectively no packages were installed in the "branch tip" layer, effectively removing the cache.
This change fixes it - when we install from branch tip now we are not using constraints, which means that they will never conflict, and this also means that cache will never be empty. It can contain other versions of some of the packages, but vast majority of the packages shoudo be the same as in constraints, so the following installation step should reuse vast majority of already installed packages.
^ 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.rstor{issue_number}.significant.rst, in newsfragments.