Skip to content

speed up e2e ci builds - #18337

Merged
kevinushey merged 5 commits into
mainfrom
developer/windows-e2e-ci-speedups
Jul 25, 2026
Merged

kevinushey merged 5 commits into
mainfrom
developer/windows-e2e-ci-speedups

Conversation

@kevinushey

@kevinushey kevinushey commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Windows e2e PR runs currently take ~100 minutes wall time (~56-63 min build + ~40 min tests, serial). Step-level timing of recent runs shows almost all of it is build-job overhead rather than the tests, with two structural problems and several fixed costs:

  • sccache hits ~0% on PR builds. The GHA cache backend writes per-object entries into each PR's merge-ref scope; 6,150 of the repo's 6,174 Actions cache entries were sccache objects, pinning the repo at the 10 GB quota and LRU-evicting the main-scoped copies the weekly seeds maintain. (The Windows seed run itself hits 98%.) This affects all ten e2e build platforms, not just Windows.
  • NSIS packaging spends ~11.5 min in solid-LZMA compression (CPack: Create package) on a throwaway 99.9.9 installer that is consumed exactly once by the e2e job in the same run.
  • ~200 objects are non-cacheable on every Windows run, the disk-space cleanup step blocks for ~4.3 min, and the test step runs ~35 min per shard at 2 shards.

Changes

  • S3 sccache backend on all ten e2e build workflows (AWS_SCCACHE_ROLE_ARN secret + AWS_SCCACHE_BUCKET repo variable, assumed via OIDC): no quota, no ref scoping, so PR and main runs share one cache. Per-platform key prefixes (win64, macos-arm64, ubuntu24-x86_64, ...); the two Ubuntu 24 builds share a prefix deliberately (same toolchain, overwhelmingly the same sources). Falls back to the GHA backend whenever the secret/variable are unset (fork PRs) or the credential exchange fails, preserving today's behavior. Backend selection must precede the sccache-action step, which only exports the Actions cache token when SCCACHE_GHA_ENABLED is already set.
  • CPACK_NSIS_COMPRESSOR=zlib for CI Windows builds, passed through a new RSTUDIO_CMAKE_EXTRA_ARGS env hook in make-package.bat (official builds are unaffected).
  • /Z7 instead of /Zi: tried and reverted -- the verification run showed the same 209 non-cacheable compiles with it applied, so /Zi was never the blocker (the seed's 98% hit rate already implied /Zi caches fine). The 209 non-cacheable compiles remain unexplained (deterministic across runs); worth a separate look but orthogonal to this PR.
  • Windows disk-space cleanup runs as a detached background process, overlapping the cache restores and dependency install; a marker-gated wait before the build step keeps it deterministic.
  • 4 Windows e2e shards instead of 2 (per-shard setup is only ~5 min, so this converts nearly 1:1 into wall-clock savings).
  • Cache-seed sentinel now opens an alert issue when a seed workflow's latest completed run did not succeed. startup_failure never runs any job that could report itself, and the Windows seed startup-failed silently on two consecutive weekends (July 6 and 13).

Infrastructure (provisioned)

Private bucket rstudio-sccache (us-east-1, 30-day expiry, public access blocked) and IAM role rstudio-sccache-github (GitHub OIDC, sub scoped to repo:rstudio/rstudio:*, 2 h max session) in the rstudio-ide account; AWS_SCCACHE_ROLE_ARN secret and AWS_SCCACHE_BUCKET variable are set on this repo.

Verification

All on branch dispatches of the Windows workflow:

  • Full build-from-source + 4-shard e2e (GHA fallback path, zlib packaging, background cleanup): run 29965892500 -- 478 passed / 0 failed / 84 skipped / 0 flaky; e2e wall time ~26 min (was ~40 at 2 shards); NSIS packaging 3m45s (was ~11.5 min).
  • S3 backend, cold (seeding): run 29969230675 -- OIDC role assumption succeeded, 551 objects written to rstudio-sccache/win64/; the free-space-gated cleanup wait passed with no stall.
  • S3 backend, warm: run 29973183206 -- 98.50% hit rate (593 hits, 0.14s avg read), compile phase ~13 min, build job 22 minutes total (PR builds were ~56-63 min).
  • The nine non-Windows migrations follow the identical, fallback-protected pattern; actionlint confirmed byte-identical finding sets against main (nothing introduced) across all touched files. The sentinel's seed-failure alerting is validated by lint/YAML only (exercising it requires a failing seed run).

- prefer an S3 sccache backend (OIDC role + bucket repo variable) over the
  GHA cache backend, whose per-PR-scoped objects flooded the 10 GB Actions
  cache quota and left PR builds compiling at ~0% hit rate; falls back to
  the GHA backend when the infra is unconfigured (e.g. fork PRs)
- compress the CI NSIS installer with zlib instead of solid LZMA (~11 min
  -> ~1-2 min for a throwaway artifact consumed once)
- compile with /Z7 (embedded debug info) instead of /Zi so sccache can
  cache the ~200 objects that previously always recompiled
- run the ~4 min disk-space cleanup as a background process, gated by a
  done-marker wait before the build step
- shard the Windows e2e tests 4 ways instead of 2
- teach the cache-seed sentinel to open an alert issue when a seed
  workflow's latest completed run failed (startup_failure is invisible to
  the seed workflow itself and went unnoticed for two weeks)
@kevinushey kevinushey added this to the 2026.08 (Yellow Yarrow) milestone Jul 22, 2026
@posit-snyk-bot

posit-snyk-bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Applies the Windows S3-sccache pattern (OIDC credentials + backend-select
step with GHA-cache fallback) to the other nine e2e build workflows, with
per-platform key prefixes (the two Ubuntu 24 builds share one deliberately),
and passes the AWS_SCCACHE_ROLE_ARN secret through every caller and seed.
ubuntu-26/fedora-43/fedora-44 gain the id-token permission the OIDC
exchange needs.
@kevinushey kevinushey changed the title speed up windows e2e ci runs speed up e2e ci builds Jul 22, 2026
Gate the pre-build wait on free space (>= 20 GB) rather than only the
cleanup done-marker: the detached cleanup competes with dependency installs
for I/O and blew through the old 15-minute wait despite having already
freed 13 GB. Also capture the detached process's output for diagnosis.

Drop the /Z7 debug-format override: the verification run showed the same
209 non-cacheable compiles with it applied, so /Zi was never the blocker
(the GHA seed's 98% hit rate already implied /Zi caches fine), and there
is no reason to diverge from official builds' debug-info format.
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
1890 0 357 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ desktop-linux 468 0 88 2
✅ desktop-macos 473 0 85 1
✅ desktop-windows 474 0 90 0
✅ server-linux 455 0 94 0
✅ setup 20 0 0 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit cef2218f7eda3e55f15191ffdf55907091325481 - Run #338

The macOS e2e build failed because make-package unconditionally
overrides SCCACHE_BUCKET to rstudio-build-cache whenever
AWS_ACCESS_KEY_ID is set. The new OIDC credentials step exports
AWS_ACCESS_KEY_ID, so the sccache server started inside make-package
pointed at a bucket the rstudio-sccache-github role cannot read and
failed startup, breaking every compile. Linux only survived because
its sccache server was already running with the workflow's bucket
before make-package ran.
@kevinushey
kevinushey requested a review from gtritchie July 23, 2026 20:07
…-ci-speedups

# Conflicts:
#	.github/workflows/os-test-e2e-rstudio-desktop-os-fedora-43-x86_64.yml
#	.github/workflows/os-test-e2e-rstudio-desktop-os-fedora-44-x86_64.yml
#	.github/workflows/os-test-e2e-rstudio-desktop-os-ubuntu-26-amd64.yml
#	.github/workflows/os-test-e2e-rstudio-scheduled.yml
@kevinushey
kevinushey merged commit 5f8c19c into main Jul 25, 2026
5 of 6 checks passed
@kevinushey
kevinushey deleted the developer/windows-e2e-ci-speedups branch July 25, 2026 01:26
kevinushey added a commit that referenced this pull request Nov 2, 2026
* move daily e2e sccache from s3 to the actions cache

The macOS 26, macOS 15, Windows Server 2025 and Ubuntu 24 engines now
keep their sccache objects in the Actions cache instead of the
rstudio-sccache S3 bucket, whose every hit was billed as egress. Runs on
main (the nightly seeds) write; every other ref reads main's entries
with SCCACHE_GHA_RW_MODE=READ_ONLY, so PR entries can't crowd main's
out of the repo's cache limit (#18337).

The Linux desktop engine picks its backend per config: gha for
ubuntu-24-x86_64, s3 for the rotation-only distros. The other
rotation-only engines stay on S3.

The Windows seed now runs nightly like the others, replacing the
weekly Windows seed workflow.

Addresses #19355

* move every e2e engine's sccache to the actions cache

The rotation-only engines (macOS 14, macOS 27, Windows 11 arm64, and the
Linux rotation distros) follow the daily engines off the rstudio-sccache
S3 bucket. Every engine now uses the same rule: main writes, every other
ref reads main's entries. The sccache_backend and sccache_key_prefix
engine-config keys, the S3 credential steps, and the AWS_SCCACHE_ROLE_ARN
secret plumbing go away, and make-package skips the AWS credential probe
when the Actions cache backend is already configured.

Addresses #19355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants