Skip to content

Runner jobs: creation, accounting class, selections, recipe, dispatch, view (DM-06) - #2152

Merged
neuromechanist merged 11 commits into
feature/portable-compute-epicfrom
feature/pc-dm06-runner-jobs
Nov 14, 2026
Merged

neuromechanist merged 11 commits into
feature/portable-compute-epicfrom
feature/pc-dm06-runner-jobs

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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 runner creates a created job with executor = '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 (bids or zarr) and executors; nemar-floor and nemar-ica are bids, ["tapis"]; new nemar-floor-zarr 1.0.0 (zarr, ["runner"], sizing label shared, 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 (default tapis); a recipe dispatched to an executor it does not list, and a runner run over --eligible, are invalid_body naming executor; a live runner run needs computeRunnersEnabled (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_SQL and HOLD_INSERT_SQL are untouched (a test pins their hashes).
Statements changed by one predicate: accounting = 'su' on PIPELINE_LIVE_JOBS_SQL, PIPELINE_JOBS_TODAY_SQL, the live leg of TENANT_COUNTS_SQL, CANDIDATE_ROWS_SQL; executor = 'tapis' on CREATED_ROWS_SQL, CANCEL_ROWS_SQL, CLAIM_SUBMIT_SQL, UNCOPIED_TERMINAL_SQL and its complements MARK_COPY_ABANDONED_SQL, COPY_ABANDONED_RECENT_SQL, COPY_ABANDONED_COUNT_SQL, CANCEL_PENDING_FAILED_SQL, and FOLLOW_ROWS_SQL.
Guards added beyond the listed statements, so no Tapis path reaches a runner row: advanceComputeJob and driveCancel skip a non-Tapis row, submitComputeJob refuses it bad_state, and the admin advance route refuses it invalid_body naming executor. A cancel on a runner job records the intent and leaves the row (the runner's heartbeat carries it back).
View: jobView and its schema add executor, 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 typecheck and bun run lint pass; bunx biome check on 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 whole backend/test/compute-*.test.ts set 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 test because 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 is zarr_status = 'ready' with zarr_store_count > 0 (zarr_copy_not_ready, 409), in resolveRun, so the dry run says the same; tests for an older version, pending, failed, never converted, zero stores and a null count. The too_many_files bound 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_SQL and accessReport select 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_written with records_written: false (and the CLI prints the same word), not waiting_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 requires records_written_at and 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) rewrites JOB_INSERT_SQL, so the three constant pins will be re-baselined there.
CANCEL_ROWS_SQL, COPY_ABANDONED_RECENT_SQL and the release statement are in the predicate list, with a behavior test for the abandoned-copy count.
computeReleaseStatements: NEVER_REACHED_TAPIS selects executor = '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 jobs shows 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, in CREATED_ROWS_SQL and CANCEL_PENDING_FAILED_SQL; keep the added columns in JOB_COLUMNS and ComputeJobRow; resolveRun here 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).

@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2152

Version: 0.10.34-PR2152.3515336
Commit: 3515336


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 1df5ae3 into feature/portable-compute-epic Nov 14, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/pc-dm06-runner-jobs branch November 14, 2026 00:13

This branch was previously deployed

1 inactive deployment
npm — 3515336c Deployed Nov 14, 2026 by neuromechanist via publish #4425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant