Skip to content

ci: build with webpack in the nightlies and in the Build job (Turbopack OOMs the .113) - #16870

Merged
diegosouzapw merged 1 commit into
release/v3.8.52from
ci/webpack-for-ci-builds
Oct 16, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.52from
ci/webpack-for-ci-builds

Conversation

@diegosouzapw

@diegosouzapw diegosouzapw commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Every CI step that compiles the app now runs webpack (OMNIROUTE_USE_TURBOPACK: "0", the escape hatch documented in docs/reference/ENVIRONMENT.md): the four nightly build:cli steps (nightly-llm-security promptfoo-guard + garak, nightly-resilience k6-soak, nightly-schemathesis) and the ci.yml Build job, whose self-hosted branch used to opt into Turbopack. The hosted Build was already on webpack, so PR builds do not change.
  • New guard tests/unit/ci-build-bundler-webpack.test.ts; tests/unit/build/heavy-build-queue.test.ts now pins the new policy instead of the old "Turbopack on self-hosted" expression.

Why

A Turbopack production build of this tree needs more memory than the .113 can give it. Measured alone on the 32-vCPU / 47 GB box on 2026-10-16 (runner slot paused, systemd-run cgroup with a hard cap and swap off, per-process sampler):

Variant (same tree, release/v3.8.52 @ 0e7e9e1a) Result
16.3.5 Turbopack, cap 36 GB passes, 25 min, peak ~36 GB (compile 17.5 min)
16.3.6 Turbopack, cap 36 GB passes, 24.5 min, peak 33.5 GB
16.3.8 Turbopack, cap 36 GB passes, 25 min, peak 36 GB
16.3.8 Turbopack, pinned to 8 CPUs, cap 28 GB OOM after 13.5 min (28 GB is simply not enough)
16.4.2 Turbopack, cap 28 GB OOM after 10 min
16.4.2 + turbopackFileSystemCacheForBuild: false, cap 36 GB OOM after 8.8 min (next-build 25 GB + ~110 loader workers 13 GB)
16.4.2 + turbopackRustReactCompiler, cap 36 GB OOM after 8.5 min
16.4.2 pinned to 4 CPUs, cap 36 GB OOM after 12.7 min — the Rust next-build alone reaches 33 GB in the compile phase
16.3.8 webpack, cap 28 GB passes, 1h23 under load, peak 14.1 GB

The ~36 GB are the Rust compile (~21 GB) plus the 31 static-generation workers (17–21 GB). The .113 runs three omni-light runners next to the build slot, and their load went from 6–11 jobs/day (10-03 → 10-05) to 34–81/day from 10-06 on — which is exactly when every Build on omniroute-113-5 started dying (~200 red runs, each swap-thrashing the box for 17–90 min, guest OOM-killer at 16–41 GB) and when the backend-only nightlies (dashboard stubbed) stopped being green (10-13 onwards). So within 16.3.x the Next version is not the cause; 16.4.2 is a genuine regression on top of it (close to vercel/next.js#97802) and should not be picked up by the self-hosted build.

Alternatives considered: more RAM for the VM (the build needs ~36 GB for itself, so ≥64 GB to coexist with the other runners), or experimental.cpus to shrink the static-generation workers — both are follow-ups, not blockers; webpack (14 GB) is the fix that works on every runner today.

Follow-ups (not in this PR): a webpack cache step for the hosted Build (the old one was removed with the Turbopack switch); main still builds with Next 16.3.5 and is not touched.

Related Issues

Target Branch

  • Base is the active release/v3.8.x branch (the highest open release/v*), not main

Validation

  • Change type: build-deploy (CI workflows + workflow guard tests)
  • Focused tests: tests/unit/ci-build-bundler-webpack.test.ts (written first: 2 failures on the current workflows, then green), tests/unit/build/heavy-build-queue.test.ts, tests/unit/vps-build-runner-gate.test.ts, tests/unit/vps-runner-variable-scope.test.ts, tests/unit/check-workflows-provenance-runner.test.ts, tests/unit/quality-rail-gate-membership.test.ts — 24/24 pass
  • actionlint clean on the 4 touched workflows; prettier + eslint clean on the test files; pre-commit checks pass
  • The webpack build of this exact tree was run end to end on the .113 (artifact .build/next/standalone produced)

Tests Added Or Updated

  • Added tests/unit/ci-build-bundler-webpack.test.ts.
  • Updated tests/unit/build/heavy-build-queue.test.ts (policy change, see above).
  • No production code changed.

Reviewer Notes

  • Nightly build:cli runs are backend-only and will take longer on webpack than the Turbopack build took when it still fit; they were not finishing at all since 10-13.
  • USE_VPS_BUILD_RUNNER stays unset (Build on hosted). If the .113 slot is re-enabled, it now builds with webpack (14 GB) instead of dying.

…ck OOMs the .113)

A Turbopack production build of this tree needs more memory than the
.113 can give it. Measured alone on the 32-vCPU / 47 GB box on
2026-10-16 (systemd-run cgroup cap, swap off, per-process sampler):

  16.3.5 Turbopack, cap 36 GB ......... passes in 25 min, peak ~36 GB
  16.3.6 Turbopack, cap 36 GB ......... passes in 24.5 min, peak 33.5 GB
  16.3.8 Turbopack, cap 36 GB ......... passes in 25 min, peak 36 GB
  16.4.2 Turbopack, cap 36 GB ......... OOM in the compile phase (next-build alone 33 GB),
                                        with or without the FS build cache, the Rust React
                                        Compiler, or a 4-CPU pin
  16.3.8 webpack, cap 28 GB ........... passes in 1h23 under load, peak 14 GB

The ~36 GB come from the Rust compile (~21 GB) plus 31 static-generation
workers (17-21 GB). Next to the three omni-light runners, which went from
6-11 jobs/day to 34-81/day on 10-06, the 47 GB VM cannot spare that: every
Build on omniroute-113-5 died since 10-06 (~200 red runs, each
swap-thrashing the box for 17-90 min, guest OOM-killer at 16-41 GB), and
the backend-only nightlies (garak, promptfoo, schemathesis, a11y) have not
been green since 10-13 for the same reason. The Next version is not the
cause within 16.3.x; 16.4.2 is a real regression on top of it.

Every CI step that compiles the app now sets OMNIROUTE_USE_TURBOPACK=0
(the documented webpack escape hatch): the four nightly build:cli steps
and the ci.yml Build job, whose self-hosted branch used to opt into
Turbopack. The hosted Build was already on webpack, so nothing changes
there. Guarded by tests/unit/ci-build-bundler-webpack.test.ts; the
heavy-build-queue test now pins the new policy.
@diegosouzapw
diegosouzapw force-pushed the ci/webpack-for-ci-builds branch from c78d064 to 2828ca0 Compare October 16, 2026 19:06
@diegosouzapw diegosouzapw changed the title ci: build with webpack in the nightlies and in the Build job (Turbopack OOMs) ci: build with webpack in the nightlies and in the Build job (Turbopack OOMs the .113) Oct 16, 2026
@diegosouzapw
diegosouzapw merged commit c6c618f into release/v3.8.52 Oct 16, 2026
13 of 14 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

diegosouzapw added a commit that referenced this pull request Oct 17, 2026
… finish (#16953)

ci(nightly-schemathesis): give the webpack backend-only build time to finish

The job's 30-minute cap predates the webpack switch (#16870). The run
dispatched on 2026-10-17 (38982564979) compiled with webpack for 25 min
on the busy .113 and was cancelled by the cap before the probes started,
so the nightly stayed red for a reason unrelated to the contract fuzz.
120 minutes covers the backend-only build under load plus the probes.
Guarded in tests/unit/ci-build-bundler-webpack.test.ts.
@diegosouzapw
diegosouzapw deleted the ci/webpack-for-ci-builds branch October 18, 2026 23:48
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.

1 participant