Job commands¶
These are dunscaith's own commands. The commands go-tool-base supplies (config, doctor, init,
update, version and others) are listed in dunscaith --help.
A job argument is a job ID, a ULID, as printed by submit and list. Run dunscaith <command>
--help for the flags of the build you have.
Global flags¶
Every command accepts:
| Flag | Meaning |
|---|---|
--ci |
The tool is running unattended: no prompts. Also set by CI=true or the ci configuration key. Turns off the interactive SSH fallback. |
--config <file> |
Configuration files to use. Repeatable. |
--debug |
Force debug log output. |
--output <text\|json> |
Output format. Default text. Only version, doctor, doctor report, config list and config path write json. Every other job and framework command refuses any value but text, so a script asking for JSON gets an error rather than text. The exceptions print text whatever --output says: help, completion and --help. mcp tools has an --output of its own, the file it writes. |
--accessible |
Run wizards as line prompts. |
The --root flag¶
Every command that takes a job, and submit, reconcile and prune, accepts --root <path>, the
record root. It overrides DUNSCAITH_ROOT and record.root. A command that takes a job uses the
root its pointer names unless --root is given; a forwarded one always uses the pointer's root. list, validate, s3 login and s3 secret
do not have it. stop accepts it but does not use it, because the emergency stop never reads
records.
Where a command runs¶
| Runs | Commands |
|---|---|
| Always here | submit, validate, supervise, list, reconcile, prune, stop --emergency, s3 login, s3 secret |
| On the job's owning host, forwarded over SSH when that is not here | status, watch, hold, release, requeue, resubmit, supersede, abandon, give-up, cancel |
supervise run off the owning host refuses and names the host. See
Reach a job from another login node.
Commands that take a job, submit and reconcile first print a line for every one of your jobs
that is Unattended, naming dunscaith supervise to reattach. For a job this host owns whose
recovery policy names cause kinds this build does not know, the line instead says
needs a dunscaith that knows <kinds>. On the owning host, commands that take a job, submit and prune also print a
line for every job whose pointer says it reached its outcome while its record is not settled, which
is what a settlement lost to a power cut leaves behind. See
Settle what a reboot left behind.
Every command that opens the cluster then prints, to stderr, a line cluster adapter: <warning> for
each thing the adapter reported it could not do, such as a piece of evidence the cluster credential
has no right to read. list, prune, validate, submit --dry-run, status --spec, the s3
commands and stop --emergency print none. A warning never fails a command or changes its exit code.
submit and supervise as supervision starts, status, reconcile, and hold, release,
requeue, resubmit, give-up, cancel and abandon after they act, also sweep the residual
list for late objects (see Residual sweeps).
submit¶
dunscaith submit <jobfile> [--detach] [--dry-run] [--idempotency-key <key>]
[--accept-unenforced N,...] [--accept-unverified N:enforcer,...] [--root <path>]
dunscaith submit - --format yaml|json [flags as above]
Reads the job file, submits it, writes the pointer, and supervises the job in the
foreground until its outcome. The exit code is in Exit codes. With - it reads
the job from standard input, and --format is required, since there is no extension to choose the
format by.
For an s3:// checkpoint it first adds DUNSCAITH_S3_CREDS to the job's environment, the
credential references rendered from checkpoint.s3.credentials, and refuses before any record is
created if a source cannot be rendered (see
Values dunscaith adds).
Before it creates the record, submit checks that the name the pointer records, hosting.host
or else this host's hostname, is a plain host name that resolves to this host alone. If the name
holds a character a host name does not, does not resolve, resolves to an address this host does not
have (as a round-robin login alias does), or is the hostname and resolves only to loopback, it
refuses, naming the host and the ways out. See
Reach a job from another login node.
If the pointer cannot be written, submit stops before anything touches the scheduler and its
error names the job, its root and this host, with the supervise --root and cancel --root
commands that reach it from here.
| Flag | Meaning |
|---|---|
--detach |
Submit without supervising. Rules only the supervisor could enforce become unenforced, so the submit fails unless you accept them with --accept-unenforced. |
--dry-run |
Print the plan the submit would record, from the adapter's cached declarations, and submit nothing. Opens no record root and writes no pointer. |
--format <yaml\|json> |
The job's format when it is read from standard input (-). Refused with a file name, whose extension decides. |
--idempotency-key <key> |
A repeated submit with the same key returns the first job, and leaves its pointer as it is. |
--accept-unenforced N |
Accept that recovery rule N has no enforcer. Repeatable or comma-separated. Rules count from 0. |
--accept-unverified N:enforcer |
Accept rule N's enforcer as unverified. The enforcer is backend, supervisor or nobody. Repeatable or comma-separated. |
It prints a receipt:
submitted 01J9ZQ6E0KXV8M2T4N7P3R5A1B
spec digest 3f1c9a0e5b7d2c4a8e6f1b3d5c7a9e0f2b4d6c8a0e2f4b6d8c0a2e4f6b8d0c2a
rule 0: supervisor
uncovered: out-of-memory, time-limit, non-zero-exit, launch-failed, no-capacity, requeued, unknown; each ends the job Failed with an escalation
added DUNSCAITH_S3_CREDS=file:/home/ada/.config/dunscaith/s3/default, from checkpoint.s3.credentials
procsPerNode: the backend's default
supervising 01J9ZQ6E0KXV8M2T4N7P3R5A1B in the foreground; it ends with this terminal unless run under tmux, screen or nohup
The spec digest is the one the record holds, and identifies what ran. uncovered lists the causes
no recovery rule covers, and unverified on this cluster any capability the plan could not verify.
Then come the values dunscaith added and those the backend will default: time limit: the cluster's
default, workDir: the backend's default and procsPerNode: the backend's default when the file
leaves them out.
submit --dry-run prints dry run: nothing submitted; the plan from cluster <name>'s cached
declarations: and the same rule, uncovered and default lines. It plans from cached declarations
only and never runs a preflight probe job: with nothing cached it refuses and says how a cache is
warmed. dunscaith cannot yet open an adapter from its cache alone, so for now it always refuses.
With --detach the last line is detached: `dunscaith supervise <job>` attaches a supervisor.
While supervising it prints each state change as <time> <job>: <from> -> <to> (<cause>), then a
closing job <id>: <state> (<cause>). Under a record.ephemeral root the receipt adds that the
records do not survive a pod restart.
validate¶
dunscaith validate <jobfile> [--print | --upgrade] [--accept-unenforced N,...] [--accept-unverified N:enforcer,...]
dunscaith validate - --format yaml|json [flags as above]
Reads and checks a job file, and exits 0 if it is valid and 1 if not, printing
every refusal it finds, each with its JSON Pointer and line. It opens no record root and touches no
scheduler. When it passes it prints <jobfile> is a valid job file (version 1).
With a cluster configured, it also plans the job against the adapter's cached declarations, as
submit would with a supervisor, and reports what the adapter refuses, such as an extension it does
not take or a capability it does not have: cluster <name> would refuse the job: .... It opens
nothing writable and runs no preflight probe job. With nothing cached it says
not checked against cluster <name> and why, and judges the file alone. The accept flags are
submit's, for a plan that needs them.
| Flag | Meaning |
|---|---|
--print |
Print the job as submit would record it, as a normalised version 1 file that reads back to the same job and digest, with what dunscaith adds shown as a comment. |
--upgrade |
Print the file rewritten at the current version. Asks no cluster. |
--format <yaml\|json> |
The job's format when it is read from standard input (-). |
supervise¶
Reattaches a foreground supervisor to an existing job. It takes the job's lock, reconciles with the
scheduler, and supervises to the outcome. Runs only on the owning host. Exits as submit does, and
with 6 when this build does not supervise the job because a newer
dunscaith recorded cause kinds it does not know.
Before it starts, it warns once if the record is older than the site's clean-up age (see
the clean-up age warning).
list¶
Prints every job of yours from its pointer, without reading any record, so it works when the owning
host is down. One line per job: ID, owning host, last state, cause, and Unattended when it is. A
cause kind only a newer dunscaith knows is shown as unknown kind <name>. For a job this host owns
whose recovery policy names such kinds, the mark reads Unattended: needs a dunscaith that knows
<kinds>. To tell, list reads that job's record on this host; off the owning host it reads only
the pointer, which cannot say, so the mark there is plain Unattended. It then reports any
residual-list entry that has expired.
status¶
With --spec it prints only the recorded spec, as a normalised version 1
job file under a comment naming the job and its spec digest, and
reads nothing else. DUNSCAITH_S3_CREDS, which the file may not set, is shown as a comment.
Prints the job's ID, state and cause, clean-up state, any hold as
hold [OVERDUE: ]<kind> hold placed by <actor kind> <actor> at <since>, until <until>[, because "<reason>"],
each recovery rule with its
enforcer as rule [<kinds>] <action> [budget <n>] [for <duration>]: <enforcer>,
unsupervisable <kinds>: ... when the job has no outcome and its recovery policy names cause kinds
this build does not know (it then does not supervise the job; see Exit 6),
identity weakened: <reason> when the plan records that this job's executions may not
each carry a distinct identity (for example a Kubeflow site's allowRankRestart), each submission (canonical object, executions, whether abandoned), a line
undelivered escalation <id>: <detail> for each escalation not yet delivered (or
undelivered escalations unknown: <error> where the record cannot be read), and the supervision
line:
supervision Unattended: ... reattachessupervision Unattended: needs a dunscaith that knows <kinds>, for a job this build does not supervise because its recovery policy names those kindssupervision supervised; last loop <time>supervision supervised, but the loop is unhealthy: last completed <time>supervision supervised; loop health unknownsupervision finishing: the job has ended, and its supervisor has not yet exited, while a supervisor waits for settlement and drains after the outcome, and through its post-outcome wait while it delivers what the record still holds undeliveredsupervision none: the job has ended, so nothing supervises itsupervision none: the job has ended and no supervisor holds it, though one that has just let go may still be delivering the escalations above until its post-outcome wait ends, where escalations are still undelivered: a supervisor lets go of the job as it settles, a moment before it takes the job back for that wait. It is shown untilsupervise.waithas passed since the outcomesupervision none: the job has ended and no supervisor holds it, and the escalations above are still undelivered; on the owning host, `dunscaith reconcile --root <root>` makes another attempt, once that time has passed.<root>is the job's own record root, which need not be the configured onereconcileuses without the flag, single-quoted where a shell would read anything into it. A supervisor can still be delivering then: one attached after the outcome, or one whose last attempt is still runningsupervision none: the job has ended and no supervisor holds it; whether its escalations were delivered is unknown, where the record's escalations cannot be readsupervision unknown: <error>, where who holds the job cannot be read
Loop health is shown only for a job that has not ended.
While a supervisor holds the job, it is followed by a line supervisor's cluster adapter: <warning>
for each warning that supervisor's own open reported, and a line naming dunscaith supervise <job>
as the way to restart it once the cause is fixed. A running supervisor keeps the evidence it started
with, so these can differ from the cluster adapter: lines status prints for its own open. See
Restart supervision after granting a right.
It ends with records do not survive a pod restart (record.ephemeral) under an ephemeral root, and
then sweeps for late objects of settled jobs. If the record is older than the site's clean-up age,
it warns once for the job (see
the clean-up age warning).
If the record is gone, status says the job was pruned and removes its pointer, or says the record
is missing, shows the pointer's last state and keeps the pointer.
Causes and rules are shown by the names the record holds, so a kind a newer dunscaith recorded,
such as gpu-fault, appears by its name. --spec prints it the same way, but this build's
validate and submit refuse that file, because a job file may name only the kinds this build
knows.
watch¶
Streams the job's state transitions, one line each with its cause by name, until its outcome, then
exits 0. Needs the record: if it is gone, watch says so (pruned or missing, as status does) and
exits 1 rather than waiting. Any other failed read is reported and retried on the next poll.
watch opens the cluster read-only: it submits nothing, not even the Slurm adapter's preflight
probe, so it runs for a user who may read the cluster but not submit to it. status stays
writable, because it stops late objects of jobs that have ended.
hold¶
Places a backend hold. --until is an RFC 3339 time or a duration from now such as 6h. Both
--until and --reason are required. What the scheduler does with it is the adapter's business.
release¶
Releases a backend hold. Refused on a recovery hold; use resubmit, give-up or cancel for that.
requeue¶
Commits a requeue intent, which the supervisor then carries out. A later cancel revokes it. Fails
as unsupported where the adapter cannot requeue. --reason is required.
resubmit¶
Leaves a recovery hold with a new submission of the same job.
supersede¶
dunscaith supersede <job> [--reason <reason>] [--accept-unenforced N,...]
[--accept-unverified N:enforcer,...] [--root <path>]
Runs a Failed job again as a new job that supersedes it. It prints the new plan and the new job's
ID and writes its pointer. It does not supervise it: run dunscaith supervise <new job>. Like
submit, it first refuses a host whose recorded name does not resolve to this host alone. It
refuses a job whose recovery policy names cause kinds this build does not know, naming them, and
creates nothing; supersede it from a dunscaith that knows them.
abandon¶
dunscaith abandon <job> <N>[/<attempt>] [--reason <reason>] [--root <path>]
dunscaith abandon <job> --foreign <ref> [--reason <reason>] [--root <path>]
Once an escalation has said so, ends submission N's unmatched attempts, or the one attempt you name,
or disposes of a foreign object found under the job's name. Name either <N>[/<attempt>] or
--foreign, not both. N and the attempt count from 1.
Each abandoned attempt joins the residual list by its number (for <N> alone, the attempts the
record shows it closed), so a sweep never stops the submission's canonical object. abandon warns
that a late object of one may still appear. --foreign takes the object's ID.
give-up¶
Leaves a recovery hold as Failed, with an escalation.
cancel¶
Commits the cancel, then stops everything found by name. It reports the two separately:
or clean-up outstanding: N object(s) still stopping, with a line for each node that was down or
not responding, whose processes may live. A job that had already ended says so and reports that the
cancel changed nothing. It fails if the store is unavailable.
stop¶
Stops every object of the job by name without recording a cancel. --emergency is required: without
it, use cancel. It goes to the scheduler directly, never over SSH and never through the record, so
it works with the owning host down and the store unavailable. Recovery may still occur, and the
output says so.
stop uses the cluster in your configuration. When the job has a pointer naming another cluster,
by cluster.name or by adapter, it refuses and names both, because the pointer does not carry the
adapter's settings and a stop by name on the wrong scheduler would find nothing and still report
success. Run it again with the configuration of the cluster the job was submitted to.
reconcile¶
Visits every record on this host that has not settled, including finished ones with work left,
and settles what it can. It copies the residuals of every record settled in the last 30 days to the
residual list, so a record it settled is swept for like one a supervisor settled; an entry already
on the list keeps the time it was added. It makes one delivery attempt for every escalation a
settled record, however old, still holds undelivered, unless another process holds the record's
lock. That is a supervisor in its post-outcome wait, or another reconcile, and it delivers them
itself, so a person is not paged twice. When the lock cannot be taken for any other reason,
reconcile warns job <id>: lock not taken, delivering without it: ... and delivers anyway,
because a person paged twice is better than one never paged.
It warns once for each record, settled or not, that is older than the site's clean-up age (see
the clean-up age warning).
It then sweeps for late objects and prints reconciled <root>. It acts on the current host's root
only.
A job this build does not supervise, because a newer dunscaith recorded cause kinds it does not
know, is skipped without taking its lock. reconcile prints a warning for it,
job <id> is not supervised here: ..., and still exits 0. Any other failure beside such warnings
fails the command, printed below them (see Exit codes).
A record dunscaith cannot decode is such a failure: reconcile finishes every other record, then
fails naming it once. So is a settled record it cannot read again once it holds the lock, since it
delivers nothing for that record and a later reconcile tries again.
prune¶
Tombstones settled records older than 30 days from settlement. For each, it first adds the job's
names to the residual list, then tombstones the record, then removes the pointer, and prints
pruned <job>. It never runs on its own.
A record dunscaith cannot decode, such as one a newer build wrote, is left alone. prune still
prunes the rest, then fails naming each such record: record <key> cannot be decoded: ...; it was
not pruned.
s3 login¶
Writes the file credential source and probes the store with it. --store defaults to
checkpoint.s3.root, and one of them is required. --profile defaults to default.
Without --from-env it needs a terminal. See
Set up S3 checkpoint credentials.
s3 secret¶
Creates or updates the Kubernetes Secret behind a secret source, with your own kubectl, and
prints the volume and mount your pods need, then the checkpoint.s3.credentials entry that reads
the mounted Secret, as YAML. --soperator adds a warning that the Secret is
readable by every job on shared workers.
Hidden entry point¶
Forwarding re-runs dunscaith on the owning host as dunscaith --x-forwarded=<token>. The flag is
hidden from help, is for dunscaith's own use, and its format is not a stable interface.