Public: anyone can read this; the crew can change it.
Checks and crew runs as cluster Jobs on any node: the lane moves to the vxrail (80 cores) instead of one pod's 5 GiB #1429
I've added checks as cluster Jobs, the first part of #1423. Setting checks.placement to job sends the next check to a batch/v1 Job on the nodes the operator picks. Placement defaults to process, which is unchanged.
stopped closed without shipping deploy b4e50c9
2 earlier comments
Checks can now run as Jobs on the cluster (#1423). When checks.placement is job, a check runs as a Kubernetes Job instead of as a child process of the forge. A forge that can't place Jobs records why and runs the check locally, as before. Each run records where it ran in run.placement and on which node in run.node. The chart has an opt-in lane for this: a Role, RoleBinding and NetworkPolicy, the FORGE_JOB_* env, and pull secrets for the Job's image.
This push brings the branch up to date with main, which no longer merged cleanly:
src/checks/service.ts:mainadded the fast check's merge into the base. That part merged on its own. The conflict was the child environment, which this branch moved out of thetryso the Job and local paths share one. That shared environment now hasmain'sFORGE_COMMIT: x.commitOid, so it names the pull's head and not the merge commit.src/core/schema.ts: both branches added a migration 74.mainkeeps 74 (the look'sattached_by/note), and this branch'srun.placement/run.nodebecomes migration 75.scripts/gate.ts: the gate's list check failed onmaintoo after the merge.test/plan-route.test.tswas listed twice in EXCLUDED, and I kept the #1468 entry.test/review-from-check.test.tswas listed twice in GATE, and I kept one.test/attach-look.test.tswas in neither list; it passes (5 tests, 1.7 s), so it is now in GATE.
The type check passes, and these tests pass after the merge: check-list, checks, checks-job, review-from-check, attach-look and the two schema-migration suites. I didn't run the full check here; the forge runs it on this push.
🤖 Generated with Claude Code
Lets a check run as a Kubernetes Job in the cluster instead of as a child process of the forge, when checks.placement is job (#1423). Process placement is still the default, so nothing changes unless that setting is turned on.
- Running checks as Jobs:
src/cluster/jobs.tscreates the Job, watches it until it finishes and reads its log;src/cluster/lane.tsholds the settings the Job runs under;src/cluster/tree.tscovers the files the Job is given.src/checks/service.tspicks process or Job per run. - Recording placement: migration 75 in
src/core/schema.tsadds a column saying where each run ran (processorjob);src/core/runs.tsfills it in. - Chart: the Helm chart gets an opt-in Role, RoleBinding and NetworkPolicy, plus the
FORGE_JOB_*environment and image pull secrets the Job needs.docs/CLUSTER.mdexplains how to switch it on. - Tests:
test/checks-job.test.tsis new and joins the gate.review-from-checkis also added to the gate; it was in neither list, which turned the gate's own list check red.
Fix for the failed check: current main moved test/attach-look.test.ts to a different place in GATE. Merging main kept both copies, so test-shards stopped with "a file is named twice". Main is merged in again and the second copy removed. An earlier merge had also dropped main's exclusion of test/plan-route.test.ts, leaving it in neither list; it is restored. scripts/gate.ts now differs from main only by adding checks-job.
Checked here: the type check passes, and the check-list, check-tiers, checks-job, hollow, checks and crew-loop tests pass. The Job path is tested here against stand-ins (test/checks-job.test.ts), not against a real cluster.
To try it: set checks.placement to job on a deployment whose chart has the lane switched on (see docs/CLUSTER.md), push to a pull, and the run's placement should read job.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
I've added checks as cluster Jobs, the first part of #1423. Setting
checks.placementtojobsends the next check to abatch/v1Job on the nodes the operator picks. Placement defaults toprocess, which is unchanged. Everything is tested through a stand-in Job client; nothing has run against a real cluster yet.How a placed check runs
data/checks/<run>as before.local-path, which only one node can mount, so a Job on the vxrail can't reach it. Instead the Job runsbun /app/src/cluster/lane.tsfrom the forge's own image and fetches the checkout as a tar from the newGET /-/lane/:id/tree. That route only answers a token signed with the forge's key for that one checkout; the token expires at the Job's deadline. The route returns 404 once the check ends.runStepa process uses. The pod log streams into the run's log, and a failure gets the same summary words.emptyDirsize. The pod runs as uid 1000 with no service account token. Node selector, tolerations, pull secrets and image come fromFORGE_JOB_*(jobSettings); bad values are refused before anything reaches the cluster.FORGE_JOB_IMAGE) runs the check as a process and says why in the log.What else changed
placementandnodecolumns (migration 74). For a process run,nodeisNODE_NAME(now passed in by the chart fromspec.nodeName), else the hostname.interrupted: its Job vanished; queued again. The check is queued once more and fails if it vanishes a second time, so it never hangs. How a Job ended is decided by a pure function,judgeinsrc/cluster/jobs.ts.src/cluster/jobs.tstalks to the API directly over the service account, with no dependency. It needs to create, get, list, watch and delete Jobs, get and list pods, and read pod logs, all in its own namespace.docs/CLUSTER.mdhas that Role.charts/app/templates/lane.yamladds the ServiceAccount, Role, RoleBinding and the lane's NetworkPolicy behindlane.enabled: false.test/review-from-check.test.tswas in neither gate list, sotest/check-list.test.tswas failing on main. I added it toGATE; it passes.Not done:
Look closely at:
runInJobinsrc/checks/service.ts.judgeinsrc/cluster/jobs.ts.src/cluster/tree.ts.To try it, run
FORGE_TEST_SOCKET=port bun test test/checks-job.test.ts. That runs a check to a verdict through the stand-in cluster, which runs the real lane over HTTP, plus the process placement and a vanished Job.test/checks.test.ts,test/capacity.test.ts, the five cross files andtscpass. On the cluster, setlane.enabled: truein the chart and switch "Where checks run" tojobon Settings → Capacity.🤖 Generated with Claude Code
Closes #1423