Skip to content

Commit edcfb40

Browse files
committed
Merge remote-tracking branch 'origin/staging' into staging-v11
2 parents ae753cb + 3e62546 commit edcfb40

22 files changed

Lines changed: 1934 additions & 321 deletions

File tree

.github/workflows/ci-cache-cleanup.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: CI Cache Cleanup
22

3-
# test-build.yml keys the Next.js build cache sticky disk per branch, so every PR
4-
# leaves a ~5 GB volume behind. Branches are short-lived; the disks aren't. Only
5-
# the pull_request disks are reclaimed — the push disks belong to main/staging/dev
6-
# and must stay warm.
3+
# DRAINING LEGACY DISKS ONLY. test-build.yml no longer mounts a Next.js build
4+
# cache — the Turbopack persistent cache measured 3.2x SLOWER than no cache, so it
5+
# is off. But every PR open while the per-branch key was live left a 5-12 GB volume
6+
# behind, and nothing else reclaims them. This keeps deleting them as those PRs
7+
# close.
8+
#
9+
# Delete this workflow once the backlog is drained (no PR predating the cache
10+
# removal is still open). It is a no-op for new PRs, which never create a disk.
711

812
on:
913
pull_request:
@@ -22,9 +26,12 @@ jobs:
2226
timeout-minutes: 5
2327

2428
steps:
25-
# Must stay byte-identical to the Mount Next.js build cache key in
26-
# test-build.yml, or this deletes nothing and the disks accumulate.
27-
# Non-blocking: PRs skipped by ci.yml's paths-ignore never made a disk.
29+
# A hard-coded legacy drain key. It no longer mirrors anything — the
30+
# Mount Next.js build cache step it used to match was removed with the
31+
# cache. Do not retarget or delete it while PRs from before that removal
32+
# are still open, or their 5-12 GB disks are never reclaimed.
33+
# Non-blocking: PRs skipped by ci.yml's paths-ignore never made a disk,
34+
# and neither does any PR opened after the removal.
2835
- name: Delete sticky disk
2936
uses: useblacksmith/stickydisk-delete@b41313d28b8647d72114c9ba3c96bb04061562b6 # v1
3037
continue-on-error: true

.github/workflows/test-build.yml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -263,24 +263,12 @@ jobs:
263263
key: ${{ github.repository }}-turbo-cache-build-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}
264264
path: ./.turbo
265265

266-
# Turbopack's persistent build cache (NEXT_TURBOPACK_BUILD_CACHE below)
267-
# writes ~5 GB into .next/cache — a sticky disk mounts it in ~1s where an
268-
# actions/cache round-trip would eat the warm-build win.
269-
#
270-
# Keyed per branch, not just per event. A sticky disk is one mutable volume
271-
# per key: mounting clones the last committed snapshot, job end commits back
272-
# last-write-wins. An event-only key had every open PR restoring a cache
273-
# built from a different branch — 14.0 min vs 9.3 min for the single-writer
274-
# push disk on the same commit. Branch scoping also keeps us off
275-
# cross-commit restore, which turbopackFileSystemCacheForBuild (beta) does
276-
# not document as supported (vercel/next.js#87283: stale HTML from a cache
277-
# built at another commit). ci-cache-cleanup.yml reclaims the disks.
278-
- name: Mount Next.js build cache
279-
uses: ./.github/actions/cache-mount
280-
with:
281-
provider: ${{ vars.CI_PROVIDER }}
282-
key: ${{ github.repository }}-nextjs-cache-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}-${{ github.head_ref || github.ref_name }}
283-
path: ./apps/sim/.next/cache
266+
# No `.next/cache` mount: the Turbopack persistent build cache is off. A
267+
# controlled A/B on one branch (PR #6078) with a byte-identical module graph
268+
# measured compile at 113s with the cache off, 162s cold with it on, and
269+
# 360s warm — the cache made the same build 3.2x slower, and it grew
270+
# 5.1 GB -> 12 GB across two runs of an unchanged tree, so a disk degrades
271+
# the more it is used. Mounting a disk nothing reads would only cost storage.
284272

285273
# Running out of RAM kills the whole VM and surfaces only as "the runner
286274
# has received a shutdown signal" — no mention of memory, ~12 min in. Warn
@@ -300,13 +288,6 @@ jobs:
300288
- name: Install dependencies
301289
run: bun install --frozen-lockfile --ignore-scripts
302290

303-
# The disk mounts successfully whether or not it carried anything and turbo
304-
# buffers the build log, so cache warmth is otherwise unobservable — #5859
305-
# shipped a cache that carried almost nothing and it took a PR to notice.
306-
# Reported, never gated.
307-
- name: Report Next.js cache size (pre-build)
308-
run: du -sh apps/sim/.next/cache 2>/dev/null || echo 'cold — no cache restored'
309-
310291
- name: Build application
311292
env:
312293
NODE_OPTIONS: '--no-warnings --max-old-space-size=8192'
@@ -318,13 +299,4 @@ jobs:
318299
AWS_REGION: 'us-west-2'
319300
ENCRYPTION_KEY: '7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
320301
TURBO_CACHE_DIR: .turbo
321-
# Opt into Turbopack's persistent build cache (beta) for this CI check
322-
# build only. #5869's 105s-cold/22s-warm was measured locally and has
323-
# never reproduced in CI (compile has ranged 3.5-17.8 min) — local
324-
# numbers, not a CI target.
325-
NEXT_TURBOPACK_BUILD_CACHE: '1'
326302
run: bunx turbo run build --filter=sim
327-
328-
- name: Report Next.js cache size (post-build)
329-
if: always()
330-
run: du -sh apps/sim/.next/cache 2>/dev/null || echo 'no cache written'

0 commit comments

Comments
 (0)