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
Closed 49d 22h ago
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.
-
Reviews
No review yet.
-
Checks
stopped closed without shipping deploy b4e50c9
-
History
- The gate names attach-look once and keeps plan-route excluded b4e50c9
- Merge remote-tracking branch 'origin/main' into mason/1423-checks-and-crew-runs-as-cluster-jobs-on fa9164a
- Release 0.7.81: `/migrate?from=<host>/<owner>/<name>&crew=<agent>` opens Migrate with that repository and agent chosen, matched on the origin's full host (#1491) 12972e9
- `/migrate?from=<host>/<owner>/<name>&crew=<agent>` opens Migrate with that repository and agent chosen, matched on the origin's full host (#1491) 8537496
- Release 0.7.80: Clear what is on you in one move: close, decline, mute or decide many at once, undoable (#1320);Zero trust: sentinel flags an unauthenticated internal call (#1400);Migrate: /migrate?from=<host>/<owner>/<name>&crew=<agent> prefills the form, matched on the origin's full host (#1472) d0bd257
- Merge pull request #1491 from scout/1472-migrate-from-host-owner-name-crew-agent fb0a5ef
- Clear what is on you in one move: close, decline, mute or decide many at once, undoable (#1320) dc8e9fe
- Zero trust: sentinel flags an unauthenticated internal call (#1400) 08f58fd
- Release 0.7.79: Merge pull request #1400 from scout/1397-zero-trust-sentinel-flags-an-unauthenti 688dbcf
- Merge pull request #1400 from scout/1397-zero-trust-sentinel-flags-an-unauthentic 2aa720f
- Migrate: /migrate?from=<host>/<owner>/<name>&crew=<agent> prefills the form, matched on the origin's full host (#1472) 8bd4dfb
- Release 0.7.78: the gate list is whole — plan-route excluded once (the crew's entry), attach-look in the gate (green three times) ed53d9c
- releases: 0.7.77 carries migrations 73 and 74 (the attached look) 01d6b36
- Release 0.7.77: builders run tsc and the socket tests in their sandbox (#1369 for #1319); a pull can carry a look a person asked for (#1375) cc7f099
- Merge main: run placement is migration 75 after the look's 74; the gate lists attach-look once and plan-route once 864e04b
- Merge pull request #1369 from mason/1319-builders-can-run-tsc-and-the-socket-test 37f854b
- Merge pull request #1375 from scout/1066-a-pull-can-carry-a-look-a-person-attache 9a5254d
- Release 0.7.76: the image build runs on the droplet runner only 8e2125c
- Release 0.7.75: main green — test/plan-route.test.ts is excluded with its reason until it passes (#1468) 5b33981
- Release 0.7.74: test/plan-route.test.ts joins the gate — the trunk's gate was red on the list check and every pull's merge check inherited it 933b54a
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
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