feat(ci): warm Next.js builds via Turbopack persistent cache on a sticky disk - #5869
Conversation
…cky disk - enable experimental.turbopackFileSystemCacheForBuild behind NEXT_TURBOPACK_BUILD_CACHE so only the CI check build opts in; production image builds stay on the default cold path until the feature stabilizes - mount ./apps/sim/.next/cache as a Blacksmith sticky disk (cache-mount) instead of actions/cache: the turbopack cache is ~5 GB, which a sticky disk mounts in ~1s while an actions/cache round-trip would eat the win - measured locally: 105s cold compile vs 22s warm (4.8x)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The Build App workflow now mounts Reviewed by Cursor Bugbot for commit 4790a49. Configure here. |
Greptile SummaryThis PR speeds up CI builds with Next.js Turbopack’s persistent filesystem cache. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "chore(ci): drop the superseded actions/c..." | Re-trigger Greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4790a49. Configure here.
…uilds) (#6080) * perf(ci): disable the Turbopack persistent build cache It is a net loss at this app's size. A controlled A/B on one branch (#6078), three runs with a byte-identical module graph so only cache state varied: cache OFF 113s compile, 2m53s job cache ON, cold 162s compile, 3m54s job cache ON, warm 360s compile, 8m18s job The cache made the same build 3.2x slower. It also grew 5.1 GB -> 12 GB across two runs of an unchanged tree, which explains the progressive degradation seen on longer-lived disks (up to 11.7 min): the more a disk is written, the more the next run must read and revalidate. Flag manipulation is visible in the logs — the cache-on runs print `✓ turbopackFileSystemCacheForBuild`, the cache-off run omits it — and every run used `turbo --force` so none is a replayed log. #5869 enabled this on locally-measured numbers (105s cold -> 22s warm) that never reproduced in CI and are inverted here. #6072 then branch-scoped the disk to stop PRs restoring each other's caches; that fixed a real problem, but with the cache off the disk is unnecessary, so the mount, the pre/post size reporting, and the env gate all go with it. Pins `turbopackFileSystemCacheForBuild: false` explicitly rather than relying on the Next default: upstream already flips that default to true in canary/preview builds (vercel/next.js#94616), so leaning on the default would let a version bump silently re-enable this. Keeps ci-cache-cleanup.yml, re-scoped to draining the 5-12 GB volumes that PRs opened while the per-branch key was live still hold — nothing else reclaims them. It is a no-op for new PRs and can be deleted once drained. Caveat: n=1 per cell. The 3.2x effect size and agreement with ~15 prior observations make it convincing, but this is three runs, not a distribution. * docs(ci): correct the cleanup key comment after the mount was removed Greptile P2: the delete step still claimed its key must stay byte-identical to the Mount Next.js build cache step in test-build.yml, but this PR removes that mount. It is now a hard-coded legacy drain key that mirrors nothing.
Summary
experimental.turbopackFileSystemCacheForBuild, beta) behind aNEXT_TURBOPACK_BUILD_CACHEenv gate — only the CI check build opts in; production image builds keep the default cold path until the feature stabilizes./apps/sim/.next/cacheas a Blacksmith sticky disk via the existingcache-mountaction (same event/fork namespacing as the other mounts) — the Turbopack cache is ~5 GB, which sticky disks mount in ~1s while anactions/cacheround-trip would eat the warm-build win; the GitHub-fallback path insidecache-mountstill worksBuild Appcheck is the merge gate (~3m40s, compile is ~80% of it), so this is direct merge-wait reduction; expect the effect from the second run onward as the disk warmsactions/cachekeying but revealed the cache carried almost nothing without the Turbopack flag)Type of Change
Testing
Local A/B: cold build 105s (cache written, 4.8 GB), immediate rebuild 22.1s, byte-identical route table. This PR's own
Build Apprun is cold (first sticky-disk fill); subsequent runs on the branch/staging show the warm number.Checklist