-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize caching installed packages in CI build #37315
Optimize caching installed packages in CI build #37315
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.
Found the reason why some CI image builds are taking 10 minutes instead of expected 2-3 minutes. |
Once we get that in, and cache is refreshed, the builds with changed dependencies should takes 5 minutes instead of > 20 minutes BTW. |
It timeouts after 70 minutes in #37151, is it related? |
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 |
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)
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)
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.rst
or{issue_number}.significant.rst
, in newsfragments.