Skip prek cache re-upload on cache hit and drop skill-eval envs from CI cache - #73527
Conversation
Andrushika
left a comment
There was a problem hiding this comment.
Left two comments, thanks!
This overlaps with #73182, which skips the same re-upload on a cache hit. It might be worth a look so the two do not resolve the hit rule differently.
|
Thanks for the pointer to #73182. This PR is the narrow subset of that change (skip the save on a hit, faster compression, no double compression, plus dropping the skill-eval environments and bumping the key so the slim cache actually lands). The hit rule here is deliberately simple: save on a miss or on non-PR runs, so the main stash keeps refreshing. #73182's marker-based detection and the narrower |
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker b65c145 v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
The
Static checksjob spends about five minutes of every pull request run re-compressing and re-uploading a prek cache it has just downloaded. This PR removes that work on cache hits and shrinks the cache itself, for roughly a 6 to 7 minute saving on a job that currently takes 25 to 40 minutes.Timings from a typical run (job 106662807685, 25.3 min total):
prek install-hooks(cache hit)Save only when there is something new to save. The stash restore looks for the PR branch first and then falls back to the base branch, so a PR on a cache hit is holding the
mainstash and would upload a byte-identical copy under its own branch name. Theinstall-prekaction now skips the tar and upload steps when the tarball was restored and the event is apull_request. Cache misses still save, and non-PR runs (the canary and scheduled runs onmain) still save on every run so the base-branch stash stays inside its two-day retention window.save-cache: trueis only set by the two static-check jobs, and both are reached only fromci-amd.ymlandci-arm.yml, sopull_requestis the only PR-shaped event that reaches this condition.Drop the skill-eval environments from the cache.
prek install-hooksbuilds environments for every configured hook, including manual-stage ones that CI never runs. The threeskill-evalhooks pull promptfoo plus the Anthropic and OpenAI agent SDKs into two node environments, which are about 3.5 GB (measured on a local prek cache; the CI log has no per-environment breakdown, only the 7.2 GB total). Skipping them in the CI install roughly halves what every job downloads and extracts. Because--skiponly avoids building environments and does not remove restored ones, the cache key moves fromcache-prek-v9tocache-prek-v10, so the first run after merge builds the cache from scratch without them instead of re-saving the restored oversized one.The miss path also compresses with
pigzwhen it is on the runner (it ships in theubuntu-22.04image) and falls back togzipotherwise. The output is plain gzip, so the restore side is unchanged and the cache key does not need a bump.{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.