Skip to content

Move frequent e2e builds' sccache from S3 back to the GitHub Actions cache #19355

Description

@kevinushey

Summary

E2E builds on GitHub-hosted runners read their sccache objects from the rstudio-sccache S3 bucket (us-east-1, set up in #18337). GitHub-hosted runners run outside AWS, so every cache hit is billed as S3 internet egress. A warm build downloads ~850 objects (~0.85 GB), roughly $0.08 per build. Moving the bucket to another region wouldn't help, since internet egress is priced the same from us-east-1 and us-east-2.

GitHub now sells Actions cache storage above the free 10 GB ($0.07/GiB/month), and we can raise this repo's limit to 20 GB. Cache downloads aren't billed. The goal is to move the daily platforms' sccache back to the Actions cache, after cleaning up what already fills it.

Why we left the Actions cache

From #18337: sccache's GHA backend stores each object as its own cache entry in the PR's merge-ref scope. 6,150 of the repo's 6,174 entries were sccache objects, the repo sat at the 10 GB quota, the entries the main-branch seeds maintained were LRU-evicted, and PR builds hit the cache ~0% of the time.

Current state (measured 2026-10-29)

  • The cache is at 10.0 / 10 GiB (1,387 entries). Its least recently used entry was last read about a day earlier, so it is evicting constantly.
  • The rotation engines flush it every Sunday. Scheduled rotation runs test the daily build, so they never compile or use sccache. They do save their test-dependency caches on main (Playwright browsers, pak downloads, R library: ~0.55 GB per engine), and the Sunday runs cover ~22 engines (~12 GB). For the last seven Sundays (Sep 13 to Oct 25), the cache-seed sentinel has re-dispatched the macOS 26, Ubuntu 24, and Windows seeds every Sunday afternoon.
  • Superseded GWT builds. GWT output is keyed on a hash of the GWT sources and is only reused on an exact key match. Every merge that touches src/gwt saves a new 30-80 MB entry per platform key, and the old one is never read again. The Windows key had 7 versions on main.
  • Duplicates. The Ubuntu 24 desktop and server workflows saved byte-identical test-dependency caches under two scopes (~0.5 GB).
  • The Windows tools cache is 2.1 GB, mostly unneeded. About 970 MB is download archives that rstudio-tools.cmd's :install keeps after extracting. Another ~340 MB is the extracted copilot language server, which install-dependencies.cmd deletes and re-extracts on every run. About 0.5 GB is unused variants: Boost and OpenSSL debug/x86 builds, other platforms' copilot SDK binaries, and a standalone pandoc. Trimming the archives, the copilot directory, and OpenSSL brings it to ~1.05 GB; Boost (~140 MB) stays because SOCI rebuilds need every variant.

Sizing

Keeping everything we save today, plus the daily platforms' sccache:

GB
Daily platforms' caches (tools, Playwright, R, GWT, node) for Windows x64, macOS arm64, macOS x86_64, Ubuntu 24 ~6.7
Old GWT builds kept for 7 days ~5
Rotation engines' test dependencies (~20 distinct engines) ~10-12
sccache for the 4 daily platforms, plus a week of changes ~5-6
Margin (fork PRs, stray PR entries) ~2
Total ~30

With the cleanups below, the load is ~14 GB, which fits a 20 GB limit with ~6 GB of headroom (more once the Windows tools cache is trimmed).

Plan

  1. pass the sccache role to the windows seed #19356: the Windows seed passes AWS_SCCACHE_ROLE_ARN. It had been falling back to the GHA backend and writing ~0.8 GB of sccache objects into main's scope.
  2. reduce what e2e workflows store in the actions cache #19357: the rotation and certification workflows stop saving test-dependency caches, the sentinel prunes GWT builds to the two newest per key, and Ubuntu 24 server and desktop share keys.
  3. reduce what e2e workflows store in the actions cache #19357 also trims the Windows tools cache before saving (~1 GB): it drops kept archives (all but the copilot zip), the extracted copilot directory, and unused OpenSSL variants. Boost stays, since a SOCI rebuild needs every variant.
  4. Raise the repo's Actions cache limit to 20 GB.
  5. move every e2e engine's sccache from s3 to the actions cache #19387: move the daily platforms' sccache to the Actions cache. Main-branch seeds write; PR builds set SCCACHE_GHA_RW_MODE=READ_ONLY, which the pinned sccache v0.16.0 supports. The weekly rotation engines don't compile, so nothing else needs sccache.
  6. Re-measure cache usage a week after each step.

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. kevinushey commented on Nov 4, 2026

    @kevinushey
    CollaboratorAuthor

    Post-merge validation of #19387 (merged 2026-11-02 17:49 UTC), measured 2026-11-04.

    Mode. Every "Configure sccache" step on main logged READ_WRITE; every PR build logged READ_ONLY. sccache --show-stats reports Cache location: ghac everywhere; no engine references S3 any more.

    Seeds (main, READ_WRITE). The first seeds after the merge ran cold, as expected (0-58% hits, the Windows seed re-using the stale entries from the #19239 test). By the nightly seeds of 2026-11-03 and 2026-11-04 they hit almost everything:

    Engine Run (2026-11-04) Hits
    macOS 26 arm64 41789889410 807/817 (98.8%)
    Windows Server 2025 41790220989 639/648 (98.6%)
    Ubuntu 24 server 41789799219 906/918 (98.7%)
    Ubuntu 24 desktop 41792987243 804/814 (98.8%)
    macOS 15 x86_64 41789437451 791/817 (96.8%)

    PR builds (READ_ONLY). Runs 41582492097 (2026-11-03) and 41845930050 (2026-11-04) hit 98.3-98.8% on all four build engines, at 0.07-0.20 s per read -- the same rate S3 gave. Their "Cache write errors" equal their misses: that is sccache counting the saves it refused in READ_ONLY mode, so nothing lands in PR merge-ref scopes.

    Cache budget. 22.1 GB / 6,043 entries against the 40 GB limit. sccache entries on refs/heads/main: 3,742 (3.2 GB), i.e. ~0.8 GB per engine as sized above. 2,279 entries (1.69 GB) are still parked under refs/pull/19239/merge from the READ_WRITE test on that fork PR; they have not been read since 2026-10-30 and will age out under the 7-day rule.

    Rotation engines. The scheduled rotation run (41798231284) skipped every build job (it tests the dailies), so those engines have no entries on main yet; they warm the first time a source build is dispatched from main.

    Not related to the switch. Two seeds failed on 2026-11-04 15:59 UTC: the Windows seed on a transient hashFiles error (the next push seed passed) and the macOS 15 seed on getaddrinfo ENOTFOUND github.com during electron-forge packaging (#19420, opened by the sentinel; closes itself on the next green seed).

    Step 5 is done. Step 6 (re-measure) is due around 2026-11-09.

  3. added theissue type on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions