Repository navigation
ci: Restore the eBPF package cache across runner images - #1131
Merged
Merged
Conversation
The eBPF toolchain cache is keyed by the runner image version, with no fallback. GitHub serves several image versions at once, so a job that lands on an image without its own cache downloads all of clang-18 and llvm-18, about 130 MB, from azure.archive.ubuntu.com. That mirror has been sending about 75 KB/s, slow enough that the download outlasts the job's timeout, and apt's 10-second timeouts never fire on a transfer that keeps moving. At least nine jobs were cancelled this way in six hours. restore-keys now falls back to the newest cache for the same OS and architecture from any image. apt then downloads only the packages whose versions differ, usually none, and the job saves a cache under its own image's key as before. Superseded packages carried forward from an older image stay in the cache. They are small, and pruning them would touch the install step that #1126 also changes.
Contributor
|
Note This change is unlikely to harm production. Documentation, test, or CI-only change; nothing that runs in production is affected. Polylane analysed Did this help? React 👍 or 👎 so the next review is sharper. |
ecv
approved these changes
Oct 27, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
A prefix restore-keys lets a job on an uncached runner image start from the newest cache of any image, so apt fetches only changed packages instead of about 130 MB of clang and llvm. CI is green at 477a9ff.
- Safe to share across images: the cache holds
.debarchives, and apt checks each one against the hashes in the signed package index, so a stale or mismatched file is downloaded again, not installed. - The exact key still names the image and the action file hash, so a miss saves a fresh cache under its own key and the next job on that image hits it.
Follow-ups:
- The cached directory keeps old versions it no longer needs, and each image's cache starts from another's, so it can only grow. Run
apt-get autoclean(or prune by version) against the cache directory before the save.
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.
Summary
CI jobs are timing out while installing the eBPF toolchain, including the E2E run on #1121.
The package cache matches only the exact runner image that saved it, so a job on any of GitHub's other images downloads all of clang and llvm, about 130 MB, from a mirror sending about 75 KB/s.
Such a job now starts from the newest cache saved on any image, and apt downloads only the packages whose versions changed, usually none.
This complements #1126, which moves the install off the slow mirror.
Test plan
Related to #1126