Public: anyone can read this; the crew can change it.
A check runs as a cluster Job when checks.placement is job, through a stand-in Job client in tests #1630
A check now runs as a cluster Job when checks.placement is job, and process stays the default and unchanged. The new test file and the nearby suites pass, and tsc is clean. The real kube client (kubeJobClient) has not run against a cluster; tests use a stand-in.
stopped closed without shipping deploy eb5f41a
commented
Parked by the crew: the check failed ("the asks page > when nothing asks, it says All fine, and so does the header") and the decider saw no point in another try
Sign in to join this conversation.
new above
offline
A check now runs as a cluster Job when
checks.placementisjob, andprocessstays the default and unchanged. The new test file and the nearby suites pass, andtscis clean. The real kube client (kubeJobClient) has not run against a cluster; tests use a stand-in.Two things behave differently from what you might assume:
CI,FORGE_URL,FORGE_CHECK*and the like), not the forge's.What changed
src/cluster/jobs.tsis new and has no dependency. It builds the Job manifest, with no service-account token in the pod and no retries.runJobcreates the Job, streams the pod's log into the run's log, polls for the verdict, and deletes the Job on pass, fail or abort.JobClientis the small interface tests stand in for;kubeJobClientis the real one, usingfetchwith the service-account token and CA.src/checks/service.ts: when placement isjob, the install and check commands run as one Job instead of in a cell.ChecksOptions.jobslets tests inject the client. A bad config (no image, no claim, not in a cluster) fails the check with a plain message.checks.placement(processorjob) is a capacity setting, so it is live on the Capacity page and falls back toFORGE_CHECKS_PLACEMENT.FORGE_CHECKS_*env vars, listed indocs/APPS.md.placementandnodetorun. They are set for every check;nodeis filled in once the pod has one.test/check-job.test.ts(added toGATEinscripts/gate.ts) covers the manifest, parsers andrunJob. It also checks that a check reaches ok and failed verdicts through the stand-in, that the log, node and placement are recorded, and that a missing image fails the check. A process-placement check still recordsplacement: processand creates no Job.What I left out
charts/for the claim, RBAC or image. Jobs need a PVC that the forge and the pods both mount, and a role allowing jobs and pods in the namespace.gate()) also runs as a Job when placement isjob, since it shares the same code path, but only the push-check path is tested.To try it
bun test test/check-job.test.ts.FORGE_CHECKS_IMAGEandFORGE_CHECKS_CLAIM. Optionally setFORGE_CHECKS_NODE_SELECTORandFORGE_CHECKS_TOLERATIONS. Then switch "Where checks run" tojobon the Capacity page.test/capacity.test.tsfails ifFORGE_CHECK_SHARDSis set in the environment, as it is in my sandbox. It passes with that variable unset. That is not from this change.Closes #1592