Repository navigation
Runner jobs: creation, accounting class, selections, recipe, dispatch, view (DM-06) - #2152
Merged
neuromechanist merged 11 commits intoNov 14, 2026
Merged
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2152Version: 🤖 Updated on each push. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card DM-06 of the portable compute plan: runner jobs, the accounting class, the Tapis and money selections, the recipe entry, dispatch and the view.
nemar admin compute pipeline run nemar-floor-zarr --dataset <id>[@version] --executor runnercreates acreatedjob withexecutor = 'runner',accounting = 'none', records written, no hold, no ledger entry and no pool touched, and a resolved argument vector; no Tapis selection, tick, sweep or advance can touch it; every Tapis path is unchanged.Registry: each recipe gains
input(bidsorzarr) andexecutors;nemar-floorandnemar-icaarebids,["tapis"]; newnemar-floor-zarr1.0.0 (zarr,["runner"], sizing labelshared, 4 cores, 16384 MB, 120 minutes, not automatic).Policy: optional
runners { maxLiveJobs { cpu, gpu } }, an absent key reads 64 and 8 (runnersPolicyOf).Run request:
executor(defaulttapis); a recipe dispatched to an executor it does not list, and a runner run over--eligible, areinvalid_bodynamingexecutor; a live runner run needscomputeRunnersEnabled(runners_disabled, 503, added to the pipeline words with the runner protocol's status).Statements added:
RUNNER_LIVE_JOBS_SQL,RUNNER_LIVE_JOBS_GUARD_SQL(live runner jobs of the pool under the cap, inside the INSERT),RUNNER_JOB_INSERT_SQL(literals'runner','none', no hold link).JOB_INSERT_SQL,GATEWAY_USER_INSERT_SQLandHOLD_INSERT_SQLare untouched (a test pins their hashes).Statements changed by one predicate:
accounting = 'su'onPIPELINE_LIVE_JOBS_SQL,PIPELINE_JOBS_TODAY_SQL, the live leg ofTENANT_COUNTS_SQL,CANDIDATE_ROWS_SQL;executor = 'tapis'onCREATED_ROWS_SQL,CANCEL_ROWS_SQL,CLAIM_SUBMIT_SQL,UNCOPIED_TERMINAL_SQLand its complementsMARK_COPY_ABANDONED_SQL,COPY_ABANDONED_RECENT_SQL,COPY_ABANDONED_COUNT_SQL,CANCEL_PENDING_FAILED_SQL, andFOLLOW_ROWS_SQL.Guards added beyond the listed statements, so no Tapis path reaches a runner row:
advanceComputeJobanddriveCancelskip a non-Tapis row,submitComputeJobrefuses itbad_state, and the admin advance route refuses itinvalid_bodynamingexecutor. A cancel on a runner job records the intent and leaves the row (the runner's heartbeat carries it back).View:
jobViewand its schema addexecutor,accounting,runner_backend,runner_id,runner_claimed_at,runner_wall_seconds,runner_cpu_seconds,runner_max_rss_mb(optional in the schema).CLI:
--executor tapis|runner; the dry run prints the executor, no SU estimate, the runner room and the switch.Gates:
bun run typecheckandbun run lintpass;bunx biome checkon every touched file passes; the Acceptance files (compute-runner-jobs 55 tests, compute-tenant-ceiling, compute-pipeline-dispatch, the pipeline CLI test 43) pass; compute-ledger, compute-ledger-budget, compute-e2e, compute-sweep pass (141); the wholebackend/test/compute-*.test.tsset with the contract, recipe, runner-contract and ADR-index tests passes (1990 pass, 0 fail).Each new test was proven by mutating the line it guards (51 mutations in round 0, 18 more in round 1, each killed).
Not run, would check: the full
bun testbecause it is the epic gate.Deviations: see the card report (source commit placeholder, no
RUNNER_GATEWAY_USER_INSERT_SQL, the extra guards above, CLI tests in the existing CLI test file).Card: DM-06.
Review round 1 fixes (head 3515336):
Wording corrected: the commit a Zarr recipe is given is the dataset row's
zarr_source_commit, the commit the LATEST serving copy was built from. It is NOT a tag commit and nothing in this PR says the copy describes the tagged data; DM-06b replaces it with the verified source and tag commits.A Zarr recipe is now refused unless the resolved version is the newest (
zarr_version_not_newest, 422) and the copy iszarr_status = 'ready'withzarr_store_count > 0(zarr_copy_not_ready, 409), inresolveRun, so the dry run says the same; tests for an older version, pending, failed, never converted, zero stores and a null count. Thetoo_many_filesbound is a BIDS staging limit and no longer applies to a Zarr recipe (a BIDS run over the same manifest is still refused).ACCESS is keyed on
accounting = 'su':ACCESS_REPORT_PENDING_SQLandaccessReportselect it (a runner row with a Slurm id makes no report and is not counted); both are in the "money selects su" test.A runner dispatch whose records did not land (the store was down for both tries) is answered
submit: records_not_writtenwithrecords_written: false(and the CLI prints the same word), notwaiting_for_runner. Nothing in this PR repairs the records, because the tick no longer drives a runner row: hand-off to DM-07, whose claim requiresrecords_written_atand replays the write.An idempotency key is one executor's: a replay whose existing job has another executor is
idempotency_conflict, both ways round.Statement pins: for every Tapis statement this PR changes, a test removes the one added predicate and checks the hash of the BASE text (taken by importing bc0ba1c), and the composed pipeline hold (hold,
PIPELINE_LIVE_JOBS_GUARD_SQL,tenantGuard) is pinned the same way. Epic D (#2116) rewritesJOB_INSERT_SQL, so the three constant pins will be re-baselined there.CANCEL_ROWS_SQL,COPY_ABANDONED_RECENT_SQLand the release statement are in the predicate list, with a behavior test for the abandoned-copy count.computeReleaseStatements:NEVER_REACHED_TAPISselectsexecutor = 'tapis', so releasing the pipelines service account never ends an unclaimed runner row (its cancel intent is recorded and carried to the runner); a test releases the account over a runner row and a Tapis row.Also: the audit row records
executor;nemar admin compute jobsshows executor, accounting and runner-reported usage for a runner job (and lists it as "runner, no SU") instead of "held 0 SU, not settled".Where a merge with #2116 can silently drop a runner predicate: keep
AND executor = 'tapis'at the top level, outside any OR, inCREATED_ROWS_SQLandCANCEL_PENDING_FAILED_SQL; keep the added columns inJOB_COLUMNSandComputeJobRow;resolveRunhere is(db, id, wanted, recipe), merge it as(db, id, wanted, except, recipe); the statement-pin test will name any predicate that goes missing.Gates after round 1: typecheck and lint pass; the Acceptance files plus the jobs CLI and local-stack tests pass (270); the whole compute set with the contract tests passes (2122 pass, 0 fail); compute-runner-jobs alone 72 pass. The epic base (DM-08, f1f5b01) was merged in cleanly and the gates rerun. Not run, would check: the full
bun test(epic gate).