From 477a9ff6781b4a78c1100f7e2ce435995ffb06ea Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 26 Oct 2026 22:43:39 -0400 Subject: [PATCH] ci: Restore the eBPF package cache across runner images 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. --- .github/actions/install-ebpf-deps/action.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/install-ebpf-deps/action.yaml b/.github/actions/install-ebpf-deps/action.yaml index 6ecc3f87d..0667f99ce 100644 --- a/.github/actions/install-ebpf-deps/action.yaml +++ b/.github/actions/install-ebpf-deps/action.yaml @@ -14,6 +14,12 @@ runs: # The cache key names the runner image, which fixes the package versions # apt resolves. ImageOS and ImageVersion are the runner's environment, # not the env context, so a step reads them. + # + # GitHub serves several image versions at once, so a job often lands on + # one with no cache of its own. restore-keys then hands it the newest + # cache from any image, and apt downloads only the packages whose + # versions differ, instead of all of clang and llvm from a mirror that + # can trickle slowly enough to outlast the job's timeout. - name: Name the runner image id: image shell: bash @@ -25,6 +31,8 @@ runs: with: path: ~/.cache/ebpf-deps-apt key: ebpf-deps-apt-${{ runner.os }}-${{ runner.arch }}-${{ steps.image.outputs.name }}-${{ hashFiles('.github/actions/install-ebpf-deps/action.yaml') }} + restore-keys: | + ebpf-deps-apt-${{ runner.os }}-${{ runner.arch }}- # Pinned to an explicit versioned package (clang-18/llvm-18) rather than # the unversioned clang/llvm meta-packages, matching ci.yaml's