Skip to content

ci: Restore the eBPF package cache across runner images - #1131

Merged
privateip merged 1 commit into
mainfrom
ci/ebpf-cache-restore-keys
Oct 27, 2026
Merged

privateip merged 1 commit into
mainfrom
ci/ebpf-cache-restore-keys

Conversation

@privateip

Copy link
Copy Markdown
Contributor

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

  • A CI job on a runner image with no cache of its own restores an older image's cache and installs the toolchain without a full download

Related to #1126

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.
@privateip privateip self-assigned this Oct 27, 2026
@privateip
privateip marked this pull request as ready for review October 27, 2026 02:47
@privateip
privateip requested a review from a team as a code owner October 27, 2026 02:47
@polylane

polylane Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Note

This change is unlikely to harm production.

Documentation, test, or CI-only change; nothing that runs in production is affected.

View in Polylane Pause assessments

Polylane analysed 477a9ff for production impact. You can ask follow-ups by mentioning @polylane in a comment.

Did this help? React 👍 or 👎 so the next review is sharper.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .deb archives, 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.

@privateip
privateip merged commit 8a18918 into main Oct 27, 2026
22 checks passed
@privateip
privateip deleted the ci/ebpf-cache-restore-keys branch October 27, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants