Repository navigation
ci: install the apt packages of the Linux test jobs from a cache - #346371
Merged
Ladislau Szomoru (lszomoru) merged 1 commit intoNov 5, 2026
Merged
Conversation
The Linux test jobs spent from 17 s to almost 2 minutes in "Setup system services": all of them download the same few MB of packages, and some get a mirror that sends them at about 30 kB/s. Like the WSL distribution of the Windows smoke tests, the daily and manual runs of pr-workspace-images.yml now cache what the jobs would download: the new linux-packages job downloads the .deb files of the packages that the runner lacks, checks that they install, and saves them under a key of the runner image (ImageOS and ImageVersion) and the package list. The new install-linux-packages action, which the Linux test jobs use, restores the newest entry of its key and installs the files with dpkg, without apt-get update. Without an entry for the image of the runner, for example during the rollout of a new runner image, or when dpkg fails, apt-get installs the packages as before and repairs what dpkg left. The package list moves to .github/actions/install-linux-packages/ packages.txt, which both jobs read, and which ripple counts as part of the definition of the test jobs. Co-authored-by: Alex Dima <alexdima@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
marked this pull request as ready for review
November 5, 2026 20:59
Ladislau Szomoru (lszomoru)
enabled auto-merge (squash)
November 5, 2026 20:59
Logan Ramos (lramos15)
approved these changes
Nov 5, 2026
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The new producer and cache-hit dpkg installation have only stubbed validation, so package completeness and cache save/restore interoperability need a real target-runner round trip before use across all Linux test jobs.
No open issues 🎉
What changed in this PR
This PR reduces Linux test setup time by caching system package downloads independently of workspace images, while retaining apt-get installation as a fallback.
Changes:
- Adds a composite action and shared package list to install cached
.debfiles keyed by runner image, architecture, and package list. - Adds a daily/manual cache producer that validates installation before saving packages.
- Integrates the action into Linux test jobs and Ripple’s test-job change detection.
| File | Description |
|---|---|
build/ripple/vscode.jsonc |
Includes the new action in test-job change detection. |
.github/workflows/pr-workspace-images.yml |
Adds the daily/manual Linux package cache producer. |
.github/workflows/pr-linux-test.yml |
Moves package installation into the new action, retaining service setup. |
.github/actions/install-linux-packages/packages.txt |
Centralizes the unchanged system package list. |
.github/actions/install-linux-packages/action.yml |
Implements cache restore, installation, fallback, validation, and saving. |
Review effort: Balanced
Ladislau Szomoru (lszomoru)
deleted the
lszomoru/agents/linux-apt-package-cache
branch
November 5, 2026 21:10
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.
The Linux test jobs spend from 17 s to almost 2 minutes in "Setup system services". All of them download the same 18 packages (about 2.4 MB:
libkrb5-devandlibxkbfile-devwith their-devdependencies,bubblewrapandsocat; the rest of the list is already on the runner), and some get an Ubuntu mirror that sends them at about 30 kB/s. In two jobs of #346362 and #346270 the download alone took 1 min 10 s and 1 min 26 s; in others it took 1 s.This caches the
.debfiles the same way as the WSL distribution of the Windows smoke tests. It is independent of #346362 (the workspace images) and works with or without an image.What changed
install-linux-packagesaction. The package list moves to itspackages.txt(unchanged). The action:ImageOS,ImageVersion), the runner arch and a hash of the list;.debfiles withdpkg -i, withoutapt-get update, and checks withdpkg --auditthat dpkg left nothing half-installed;apt-get updateandapt-get installwithout an entry for the runner image (for example while a new runner image rolls out), or when dpkg fails. The fallback adds--fix-brokento repair what dpkg left, and warns when the cached files didn't install.pr-workspace-images.yml: newlinux-packagesjob, which runs on the daily schedule and on manual runs only, likewsl-distro. It downloads the.debfiles the runner lacks (apt-get install --download-only), installs them with the same action, and checks that apt-get has nothing left to install. Only then does it save a new cache entry (key…-<run_id>-<run_attempt>). If the check fails, the job fails and saves nothing. The check matters becauseapt-retry.shnever returns apt-get's exit code, so a failed download would otherwise go unnoticed.pr-linux-test.yml: "Setup system services" keeps the sysctl and Xvfb setup. The packages come from a new "Install system packages" step before it.build/ripple/vscode.jsonc: the action is part of the "test job definition".The key holds the exact runner image, since the set of missing packages depends on it. The files are those apt itself chose for that image, so
dpkg -ineeds nothing else. Runner images change about weekly. Until the next daily run after an image update, jobs on the new image use apt-get as before; a manual run of the workflow fills the cache right away.What to look for
mainyet, so "Install system packages" prints "No cached packages for the image of the runner" and installs with apt-get as before. The jobs should pass as they do today.main: theLinux (apt packages)job lists the.debfiles, installs them and saves the cache. Linux test jobs on the same runner image then print "Installing N .deb files of apt-packages-v1-…", and the step takes a few seconds, with noapt-getlines.Validation:
cd build && node --test lib/test/detectMissingCaches.test.ts lib/test/detectChanges.test.ts lib/test/workspaceImage.test.ts lib/test/agentHostTestSelection.test.ts: 35 passedgo run github.com/rhysd/actionlint/cmd/actionlint@latest -shellcheck= .github/workflows/pr-linux-test.yml .github/workflows/pr-workspace-images.yml .github/workflows/pr.yml: only unknown custom runner labelsbash -non the action's scripts: passed. The install script was also run against stubbedsudo,dpkg,apt-getandapt-retry.sh, covering a cache hit (with and without files), dpkg failing,dpkg --auditreporting a problem, a missing or mismatched key, and the producer saving a complete set or refusing an incomplete one or one dpkg can't install: all behaved as intended.mainsave caches that pull requests can read. Its first daily or manual run onmainexercises it.