Repository navigation
ci(locallibrary): install apt packages from the Actions cache - #474
Merged
Merged
Conversation
apt-get install libasound2-dev valgrind took 12 of the budgets job's 15 minutes on a stalled mirror, and almost every Rust job runs apt-get. A new apt-packages action keeps the .deb files in the Actions cache per runner image and installs them with dpkg, so a cache hit doesn't touch the mirror.
Coverage Report for apps/localtoolbox
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Coverage Report for apps/web
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Rust coverageFrom run 429. Both are held to the thresholds in .cargo/config.toml.
|
bnb
approved these changes
Nov 6, 2026
bnb
approved these changes
Nov 6, 2026
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.
What and why
locallibrary / budgetson #468 spent 11 min 58 s fetching 23.6 MB from Ubuntu's Azure mirror at 32.9 kB/s, forlibasound2-devandvalgrind, in a 15-minute job. It's the same stall as LOC-231, and that job has run on every Rust pull request since #462. Almost every other Rust job runsapt-getfor ALSA too, so they're exposed the same way, with less to fetch.taiki-e/install-actionhas onlycargo-valgrind, a wrapper that still needs Valgrind, and these packages have to come from somewhere, so the fix is to fetch them once.Added
.github/actions/apt-packages. It restores~/apt-packagesfrom the Actions cache, keyed on$ImageVersionand the package list. On a miss it runsapt-get updateandapt-get install --download-onlyinto that folder and saves it. Then it installs withdpkg -i, with noapt-geton a hit.locallibraryfilter inci.yml, so a change to it runs the jobs that use it.Changed
apt-getsteps use the action:release-budgets, seven inlocallibrary-ci.yml, one inlocallibrary-bench.yml, four inlocallibrary-scheduled.ymland one inmix-report.yml.Removed
Nothing.
The key has the runner image in it because the image fixes what's already installed. That's what lets
dpkg -iskip resolving anything: the files in the folder are whatapt-getchose on that same image.Why not
awalsh128/cache-apt-pkgs-actionIt's the maintained action for this, and I read it at v1.6.3 (553a35bb8). A cache hit does skip the mirror, but two things rule it out:
curlofapt-fast'smasterbranch through bash, in a job that hassudo. A commit SHA in our workflow leaves that script free to change, and zizmor can't see it.tarover/, so a new image can get files built for an older one. Valgrind is where that bites:libc6-dbghas to match the image'slibc6, and its version isn't one we name. Theversioninput could carry the image, but that takes a step at every call site.Lesser points: it doesn't register what it restores with dpkg, and runs install scripts only on request, which its README says isn't guaranteed to work. It runs a prebuilt
apt_querybinary from its repository each time. Its last release was 2026-06-30, v1 is in maintenance mode and its README asks for co-maintainers. I didn't run it on Ubuntu 26.04, and found no issue about it there.If it drops the
curland adds the image to its key, it's worth swapping in: the call sites only passpackages.What still reaches the mirror
A new image misses the cache, so the first job per package list on each image still asks the mirror, and can still stall. Pull requests read
main's cache but write their own, so the jobs onmainare what fill it for everyone.How it was tested
On
ubuntu:26.04with Python and Perl added, as the runner has them: the download step fetchedlibasound2-dev valgrind(53 files, 37 MB), then a new container with--network noneinstalled them withdpkg -i. Valgrind 3.26.0 andalsa/asoundlib.hwere there anddpkg --auditwas clean. On the bare image, without Python,dpkg -ifailed onpython3-minimal's pre-dependency, so a package list that brings in Python on an image without it would fail here. The runner has it.tools/policy.shpasses 52 of 52, and actionlint and zizmor have no findings. This pull request's run exercises the miss path. Rerunning a job on it exercises the hit path.