ci: finish switch day on Forgejo: artifact actions, two sized runners, front tests within memory #574
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project!574
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/forgejo-runner-sizing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #573: merge it first, then rebase this onto
main.Summary
Two runners on the CI VPS (15 GiB, 4 CPUs), each taking one job at a time. ADR 0050 supersedes 0048.
memory.peak3.9 GiB with--maxWorkers=1), so GitLab's 3 GiB was below its working set. That fits run 3's symptoms: 2.999 of 3 GiB, the host swapping, 25 tests timing out and a dynamic import failing.--memory-swapnow equals--memory, so a job at its cap is OOM-killed at once instead of swapping until its tests time out./dev/shmgoes to 2 GiB; it is tmpfs charged to the same cap.--maxWorkers=1. I have no evidence that the MSW cause is not real. GitLab pipeline 315's symptoms (whole files failing, a setup file that would not load) match memory pressure as well as they match MSW. Once a few front-test runs pass at 6 GiB, trying--maxWorkers=2is the next step.TASK_CONCURRENCY=2. checks with a cold Turbo cache took 34 s at concurrency 4 and 36 s at 2, both peaking at 4.3 to 4.5 GiB. Vitest's workers dominate that peak, not Turbo's slots, so the higher setting bought nothing measurable.capacity: 1is the lock. Every job that reaches the production VPS runs ondeploy, so two deploys never overlap. Every browser job runs ondocker, so two browser jobs never share the CPUs. A deploy no longer waits behind a pull request's gate.runner-lanes.test.mjsenforces this: every job runs on a label a runner offers, deploys and browser jobs each stay on one capacity-1 runner, and the caps fit an 8 GiB budget with no swap.actions/cacheis gone from ci.yml and the store sits on theci-pnpm-storevolume at/pnpm-store. GitLab rejected this because pnpm copies across mounts. I measured again: copying costs about 2 s an install, against a restore and a gzip upload on every lockfile change. The numbers are under Evidence.reuse-imageacceptssuccessorskippedfrom them.corepack enableand the Playwright image pull, which is cached anyway. That is a few seconds, not worth an image to rebuild on every Node or Playwright bump. Left as a follow-up.Memory budget, with two jobs running:
After step 12, the 3 GiB GitLab frees stays as page cache and margin.
Evidence
Measured locally in
node:24.21.0-bookwormat--cpus=4, with this repo's lockfile (store 1.3 GB, 40 785 files):actions/cachewithout zstd, which the image lacks)apt install zstdin every jobPeak memory (
memory.peak), same container:--maxWorkers=1: 3.9 GiB, above the old 3 GiB cap.TASK_CONCURRENCY=4and 4.5 GiB at 2, with Vitest seeing the Mac VM's 15 CPUs. On the VPS it sees 4, so the real peak is lower.The local front-test run itself was not a clean signal: Chromium dropped its connection, and the Docker VM had only 7.75 GiB with other stacks using about 3.3 GiB.
Gate:
pnpm lint,typecheck,test(test:infra 59 pass),build,format:checkall green.Merge Danger
Door: two-way
Revert the commit, then rerun stages 3 and 4.
up.shwill then render the single runner again. The deploy runner stays registered in Forgejo until you delete it under Site administration → Actions → Runners.Blast Radius: CI
deployfind no runner and wait. Merging this without applying blocks every deploy, andplan, and so every run. Apply right after merging.reuse-imagewere skipped despite gate jobs that skipped, production would not deploy on a merge. Check the first push to main after this lands.docker buildin the daemon during front-test could slow it. Watch the first runs that overlap.Apply on the server (the owner)
main.up.shrestarts a runner whose config changed, which kills its job.infra/forgejo/vps/wizard.sh. Answer "Redo it?" with yes for stage 3 (copies the stack and the newrunner-deploy.yaml; the secret key and internal token are kept) and stage 4 (up.sh: registersforgejo-vps-deploy-runner, renders both configs, restartsrunner, startsrunner-deploy). Answer no for every other stage.sudo docker compose -f /opt/forgejo/compose.yaml pslistsrunnerandrunner-deployrunning. Check that Site administration → Actions → Runners lists both idle, with labelsdocker,ubuntu-latestanddeploy.sudo grep -E 'capacity|memory|volume' /opt/forgejo/runner/config.yaml /opt/forgejo/runner-deploy/config.yamlshows--memory=6g --memory-swap=6g,ci-pnpm-store, and--memory=2g --memory-swap=2g.These steps are also in
infra/forgejo/vps/README.md, "Apply a change to the runners". The first gate run fillsci-pnpm-store, which takes about 15 s more than a warm install.Order of apply: this pull request's own run needs the deploy runner, since plan now runs on the deploy label. The new runners also serve main's current workflows: the gate runner keeps the docker label and the actions cache. So apply the steps from this branch first (check out ci/forgejo-runner-sizing instead of main in step 1), let this run go green, then merge #573 and this one. Until then, this run waits for a runner.
Run at
e3a051dThe run
Failed tests
No test failed.
Engine coverage
Statements: 99.48%, shown and never enforced.
Screenshots
Before is production, after is this pull request's preview.
Desktop
Mobile
ci: run the gate and the deploys on two runners sized to the CI VPSto ci: finish switch day on Forgejo: artifact actions, two sized runners, front tests within memoryThis pull request now combines #573 and #575, which depend on each other: #573's Forgejo artifact actions, this one's two runners (ADR 0050), and #575's front test memory fix (the browser opens as many pages as --maxWorkers and collects each page's garbage). Four commits, gate green locally (front: 82/82 files, 1631/1631 tests). Its merge on main is switch-day step 11, the first production deploy from Forgejo.