Repository navigation
reduce what e2e workflows store in the actions cache - #19357
Conversation
- The rotation and certification workflows no longer save os-e2e-deps caches. Their engines run once or twice a week, so the entries were evicted before they were read again, and the Sunday runs (~12 GB) flushed main's build caches every week. - The cache-seed sentinel prunes superseded GWT output caches on main, keeping the two newest per key. - The Ubuntu 24 Server workflow shares the Linux Desktop engine's noble-amd64 os-e2e-deps keys instead of saving a duplicate unscoped set. Addresses #19355.
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
Drop the archives rstudio-tools.cmd keeps after extracting (all but copilot's, which is re-extracted every run), the extracted copilot directory, and the OpenSSL variants a RelWithDebInfo x64 build never links: ~1 GB of the ~2.1 GB entry. Boost variants stay, since a SOCI rebuild needs all four. The key moves to v3 so the trimmed entry replaces the current one, with v2 as a fallback restore key to avoid a cold install. Addresses #19355.
actions/cache passes zstd no level, so it uses the default of 3. ZSTD_CLEVEL=9 on each save step makes entries ~13% smaller (measured on a tools tree: 299 MB -> 261 MB) at about the same save time; decompression speed is unaffected. Addresses #19355.
gtritchie
left a comment
There was a problem hiding this comment.
Two issues with the Windows tools cache change, plus three smaller ones inline.
- The trim keeps every copilot zip version, so the entry grows back by ~353 MB per copilot bump.
- The Windows 11 arm64 workflow shared this
rstudio-tools-win64-v2-key and is left behind on it, so its main dispatches go cold.
|
|
||
| $remove = @( | ||
| Get-ChildItem -LiteralPath "$deps\common", "$deps\windows" -File | | ||
| Where-Object { $_.Name -match '\.(zip|7z|tar\.gz)$' -and $_.Name -notlike 'copilot-language-server-js-*' } |
There was a problem hiding this comment.
-notlike 'copilot-language-server-js-*' exempts every copilot zip, not just the current version's. COPILOT_VERSION lives in install-dependencies.cmd, which is in the key's hashFiles, so a bump misses the key and restores the previous v3 entry through the rstudio-tools-win64-v3- restore key. install-dependencies.cmd removes the extracted copilot-language-server-js directory but never the old zip, so the trim keeps both and the new entry carries the dead one.
The 1.555.7 zip is 353,354,496 bytes, and install-dependencies.cmd has had 8 copilot bumps since May, so about three bumps undo the ~1 GB this step saves. Exempting only copilot-language-server-js-<COPILOT_VERSION>.zip (reading the version from install-dependencies.cmd) would keep the entry trimmed.
There was a problem hiding this comment.
Fixed in e2610fe. The trim now reads COPILOT_VERSION from install-dependencies.cmd and keeps only copilot-language-server-js-<version>.zip. If it can't find the pin, the step fails before deleting anything (continue-on-error, so the entry is just untrimmed). Against a mock tree with both the 1.551.2 and 1.555.7 zips, it removed 1.551.2 and kept 1.555.7.
| with: | ||
| path: ${{ env.RSTUDIO_TOOLS_ROOT }} | ||
| key: rstudio-tools-win64-v2-${{ hashFiles('dependencies/common/install-*', 'dependencies/common/rig.cmake', 'dependencies/windows/install-*.cmd', 'dependencies/windows/install-soci/**', 'dependencies/windows/tools.R', 'dependencies/tools/rstudio-tools.cmd') }} | ||
| key: rstudio-tools-win64-v3-${{ hashFiles('dependencies/common/install-*', 'dependencies/common/rig.cmake', 'dependencies/windows/install-*.cmd', 'dependencies/windows/install-soci/**', 'dependencies/windows/tools.R', 'dependencies/tools/rstudio-tools.cmd') }} |
There was a problem hiding this comment.
os-test-e2e-rstudio-desktop-os-windows-11-arm64.yml:260 uses the same rstudio-tools-win64-v2- key with the same hashFiles, runs its build job on windows-2025, and has the same RSTUDIO_TOOLS_ROOT, so today it restores this workflow's entry. After this change nothing refreshes v2, and GitHub removes it 7 days after its last access.
That workflow is dispatched on main about monthly (2026-08-31, 09-10, 10-09). Each dispatch would then miss both its key and its restore key, install every dependency cold, and save a new untrimmed ~2.1 GB v2 entry. Moving it to v3 with the same trim step, or at least adding a rstudio-tools-win64-v3- restore key, keeps it warm.
There was a problem hiding this comment.
Fixed in e2610fe. The arm64 workflow moves to v3 with the same v3/v2 restore keys, and both workflows now run the trim from .github/actions/os-trim-windows-tools, so whichever one saves the shared key saves the same tree.
One correction: the three main dispatches (08-31, 09-10, 10-09) all tested the daily installer with build skipped, so they never touched this cache. The exposure is a build-from-source dispatch (the input's default), which would have gone cold once v2 aged out and, on main, saved a fresh untrimmed v2 entry.
| # Same scope as the Linux Desktop workflow's Ubuntu 24 engine | ||
| # (.github/e2e-linux/ubuntu-24-x86_64.json): same runner image, R | ||
| # version, and package set, so the two share one set of caches. | ||
| cache-scope: noble-amd64 |
There was a problem hiding this comment.
This copies e2e_deps_cache_scope from .github/e2e-linux/ubuntu-24-x86_64.json. .github/e2e-linux/README.md documents which ubuntu-24-x86_64 keys are shared with Linux Server (lines 34-36, 144-147, 197) but not that this scope now is. Someone changing the Desktop scope would have no pointer here, and the two would silently stop sharing. A README note next to the existing tools/rlibs sharing notes would cover it.
There was a problem hiding this comment.
Added in 3c1b2bc, next to the tools/rlibs sharing note and in the config-keys table row for e2e_deps_cache_scope.
| # ZSTD_CLEVEL; level 9 makes entries ~13% smaller than the default | ||
| # level 3 at about the same save time, and restores are unaffected. | ||
| env: | ||
| ZSTD_CLEVEL: 9 |
There was a problem hiding this comment.
ZSTD_CLEVEL: 9 is set on 27 separate save steps, with this comment in 9 files. A single job- or workflow-level env: per engine would cover every save, including the composite action's steps, which inherit job env. Decompression ignores the level, so restores are unaffected, and a save step added later can't miss it. The action can keep its per-step env for callers outside the engines (the deps seed and the autocomplete workflow).
There was a problem hiding this comment.
Done in ef2bda5: one workflow-level env: per engine workflow. The action keeps its per-step env for the deps seed and the autocomplete workflow. Nothing else in those jobs runs the zstd CLI (CPack/rpmbuild link libzstd, which doesn't read ZSTD_CLEVEL). The only side effect is that setup-node's npm cache saves also compress at level 9 now, which is negligible at 27-48 MB.
| if: ${{ !cancelled() }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} |
There was a problem hiding this comment.
GH_REPO isn't used in this step: the only gh calls are gh api with an explicit repos/$GITHUB_REPOSITORY/... path. It looks copied from the check step above, which needs it for gh workflow run and gh issue.
A workflow-level env covers every save step in every job, including os-e2e-deps' composite steps, so a save added later can't miss it. The action keeps its per-step env for callers outside the engines (the deps seed and the autocomplete workflow). setup-node's npm cache saves now also compress at level 9. Addresses #19355.
The Windows 11 arm64 workflow's build job saves the same rstudio-tools-win64 key as Windows Server 2025's, so it moves to v3 too (with the v2 fallback) and both run the trim from one composite action. Left on v2, its build-from-source dispatches would go cold once v2 aged out, and a main dispatch would save a fresh untrimmed v2 entry. The trim now keeps only the copilot archive pinned in install-dependencies.cmd rather than every copilot zip. A copilot bump restores the previous entry through the restore key, and the superseded ~350 MB archive would otherwise carry into every later entry. Addresses #19355.
The repo's Actions cache sits at its 10 GB quota and evicts constantly. On 2026-10-29 its least recently used entry had last been read about a day earlier. Three things written to it are never, or almost never, read back.
Changes
The rotation and certification workflows no longer save the
os-e2e-depscaches (R library, pak downloads, Playwright browsers), through a newsave-cacheaction input. The engine workflows expose it as theworkflow_callinputskip_e2e_deps_cache_save, defaulting to false. Rotation engines run once or twice a week, so their entries (~0.55 GB per engine) were evicted before anything read them. The Sunday runs write roughly 12 GB, which flushes main's build caches. For the last seven Sundays the sentinel has re-dispatched the macOS 26, Ubuntu 24, and Windows seeds every Sunday afternoon. The four daily platforms stay warm fromos-cache-seed-e2e-deps.ymland their nightly scheduled runs, which are unchanged.The cache-seed sentinel prunes superseded GWT output on main, keeping the two newest entries per key. GWT output is keyed on a hash of the GWT sources and is only reused on an exact key match, since a
restore-keysmatch recompiles from scratch. Older entries are dead weight: the Windows key alone had 7 versions on main. A dry run against the live cache keeps 2 of each of the 5 keys and would delete 9 entries.The Ubuntu 24 Server workflow now uses the Linux Desktop engine's
noble-amd64os-e2e-depsscope. Both run onubuntu-24.04with the same R version and package set, and they were saving byte-identical keys apart from the prefix (~0.5 GB duplicated). The deps seed and the sentinel drop the old unscopedLinux-entries.The Windows builds trim their tools cache before saving it, cutting ~1 GB of the 2.1 GB entry. The Windows Server 2025 and Windows 11 arm64 workflows save the same key from identical build jobs, so both run the trim from one composite action,
os-trim-windows-tools:rstudio-tools.cmd's:installkeeps every archive after extracting it, but skips any dependency whose folder exists, so those archives are never read again (~630 MB). The exception is copilot:install-dependencies.cmddeletes and re-extracts it on every run, so the zip for the version it pins stays and the extracted copy goes instead (~340 MB). Superseded copilot zips go too, so a copilot bump doesn't carry the old ~350 MB zip into every later entry.MULTIARCHlinks only the release x64 OpenSSL, so the debug and 32-bit variants are dropped (~75 MB).install-soci.Rbuilds SOCI against every one of them whenever SOCI is rebuilt, and the Boost marker folder would suppress a reinstall.v3in both workflows so the trimmed entry replaces the current one.v2stays as a fallback restore key, so the first save starts from the existing entry rather than a cold install.continue-on-error, so a failed trim only means a larger entry.Cache saves compress with
ZSTD_CLEVEL: 9, set once in a workflow-levelenv:in each of the 8 engine workflows, which covers every save in every job, composite steps included. Theos-e2e-depsaction also sets it per step for its callers outside the engines (the deps seed and the autocomplete workflow).actions/cachecompresses with zstd but passes no level, so zstd uses its default of 3 and honorsZSTD_CLEVEL(checked inactions/toolkit'star.ts). On a 1.6 GB tools tree (Boost plus Quarto), level 9 gave 261 MB against 299 MB at level 3, with save time nearly unchanged (36 s vs 33 s, mostly tar I/O). Level 15 saved only another 3% and took 42 minutes. Decompression speed doesn't depend on the level, so restores are unaffected. In the engine workflows,setup-node's npm cache saves (27-48 MB each) also pick up level 9. Nothing else in those jobs runs the zstd CLI: CPack and rpmbuild link libzstd, which doesn't readZSTD_CLEVEL.Engine workflows dispatched directly still save:
!inputs.skip_e2e_deps_cache_saveis true when the input is absent.Verification
os-test-e2e-rstudio-*andos-cache-seed-*workflow reports the same 21 findings asorigin/main, with none introduced.ZSTD_CLEVEL=9 zstd -T0produces byte-identical output tozstd -T0 -9(Homebrew zstd).install-dependencies.cmd. With the pin removed, it failed before deleting anything.After merge, check that:
Linux-<distro>-{r,pak,pw}-entries.rstudio-tools-win64-v3-entry of under ~1 GB appears.Cache Sizeline in the save step's log shows the size.Addresses #19355.