fix(ci): improve Docker image caching and native build skip optimization#92633
fix(ci): improve Docker image caching and native build skip optimization#92633
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Failing test suitesCommit: c22d352 | About building and testing Next.js
Expand output● instant-nav-panel › should show loading skeleton during SPA navigation after clicking Start |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
95aa7f1 to
94cdf02
Compare
| sh( | ||
| `zstd -d -c --long=27 --threads=0 ${zstFile} | docker import ${changeFlags} - ${IMAGE_NAME}` | ||
| ) |
There was a problem hiding this comment.
Does it make sense to retry the decompression and import? Is the idea that sometimes the download can be corrupted?
There was a problem hiding this comment.
We're using http:// here and the files are large enough that I managed to get at least one mangled download. 😢
There was a problem hiding this comment.
Our local build cache doesn't leave the intranet apparently so this is ok but we lose integrity checks.
94cdf02 to
f0e53bd
Compare
- turbo-cache.mjs: Add 16MB highWaterMark (was 16KB default) for stream
downloads/uploads. Add transfer stats tracking (totalBytes, speed,
maxStallMs) with 5s stall warning. Add formatStats() helper. Change
getToFile() to return { ok, stats } instead of boolean.
- docker-image-cache.js: Switch from docker save/load to export/import
(flat filesystem, no redundant base layers). Use zstd --long=27 for
better compression of large similar blocks. Add retries (3 attempts).
Add arch-aware cache key. Remove unused pipeToShell/spawn. Add
download stats logging.
- native-cache.js: Use new getToFile() return shape, log download stats.
- build_and_deploy.yml: Reorder steps to try native binary cache restore
BEFORE loading the Docker image. If the binary cache hits, skip the
expensive Docker image restore entirely.
f0e53bd to
c22d352
Compare
2ed35d2 to
c22d352
Compare

Summary
getToFile()now returns{ ok, stats }.docker save/loadtoexport/import(drops redundant base image layers). Usezstd --long=27for better compression. Add 3x retry logic. Add arch-aware cache key to prevent cross-arch cache poisoning. Add download stats logging.getToFile()return shape, log download stats.