Prepare a cluster for the adapter¶
Work through this list on a cluster before the first slurm.New, or when preflight refuses one.
Each item says what preflight reports if it is missing. Some gaps fail slurm.New; others only
lower a capability, which you read as described in
Read a preflight result.
On the login node¶
The login node is the host the transport runs scripts on: the machine itself for local, the
ssh.host for ssh.
- Run Slurm 25.11 or 26.05. Any patch level. Anything else fails with
ErrUnsupported:Slurm <version>; supported are 25.11, 26.05. - Put the commands on the
PATHthat/bin/shsees, without a login profile doing it interactively:sbatch,squeue,scontrol,scancel,sacct,timeout,dateandbase64. A missing one fails withErrUnsupported:missing on the Slurm host: <commands>. The scripts also usemkdir,printf,catandwc, which preflight assumes. - Use GNU coreutils for
timeout,dateandbase64. The scripts runtimeout -s KILL,date +%s, and over sshdate +%s.%Nandbase64 -d. Preflight checks only that the commands exist; adatethat cannot print nanoseconds fails step 6 with an error naming its output. - Give the user an absolute
$HOME. OtherwiseErrUnsupported:the cluster home "<value>" is not an absolute path.
Authentication¶
- Use
AuthType=auth/mungeorauth/slurm. Under any other type there is no known landing bound:Holdisnowith the reasonAuthType "<type>" has no known landing bound, requeue is refused withErrUnsupported, andCallBoundis0s.slurm.Newstill succeeds, and the backenddispatch.Openreturns implements neitherHoldernorRequeuer. - Under
auth/munge, putmungeandunmungeon the login node'sPATH, unlessAuthInfosetsttl=. Without them, preflight fails withErrUnsupported, naming them. - If you set
AuthInfo=ttl=, use a positive whole number of seconds. Anything else fails preflight. The TTL is most of the call bound; see Choose deadlines, TTL and skew.
Accounting¶
- Keep job accounting the user can read, so
sacctcan describe a job after it leavessqueue. Without itAccountingHistoryisno, and such a job isdispatch.ErrNotFound. - Add
job_commenttoAccountingStoreFlags. Without itAccountingHistoryis stillyes, with the reasoncomments are not kept: AccountingStoreFlags lacks job_comment, and a finished job read fromsaccthas no submission or attempt number.
What the user may do to their own jobs¶
- Let a user submit held jobs to a partition they can use. The probe is one real one-node
submission with
--hold, using the configureddefaults. Ifsbatchrefuses it, preflight fails withErrRejectedandsbatch's message. - Let the owner set
StartTimeon, and release, their own pending jobs. That is how a hold is placed and the gate opened. If the probe cannot,Holdisno, and the reason names the step:placing hold 1 on the probe: ...oropening the held probe: .... - Let the owner requeue their own jobs (
scontrol update JobId=<id> Requeue=1, thenscontrol requeue <id>), if you want requeue. Preflight does not try a requeue, so a cluster that forbids it is found by the firstRequeuecall. That call fails withErrRejectedonly for a message on the adapter's list, and otherwise withErrOutcomeUnknown; see Exit codes of the deadline wrapper.
job_submit plugins¶
-
Leave the adapter's submission as it asked for a job named
dj-<ULID>. Ajob_submitplugin may change partition, account and resources, but not:- the job's name or comment;
- the requeue flag, which must stay off;
- the owner's hold: pending, reason
JobHeldUser, priority 0; - the dependency, which must be empty, or
singletonwithsingleton: true.
A plugin that changes one of these fails preflight with
ErrRejected:the cluster changes a submission: <difference>. Without preflight, everyStartwould be stopped and refused the same way. How a job becomes an sbatch submission has the options the adapter sends.
Output and working directories¶
- Make
output.dirthe same path on the login node and on every compute node.Startcreates the job's output directory on the login node, the batch script on the first allocated node appends each execution's output there, andOutputreads it back on the login node. A path that only exists on one side fails each job, not preflight. The default,$HOME/.local/state/dispatch-slurm, assumes a shared home. - Do the same for any
WorkDira job names, and for the cluster home, which is the working directory when a job names none. - Keep the commands a job runs at the same paths on the compute nodes. The batch environment
starts empty (
--export=NIL);PATHis copied from the login node's environment byenvironment.pass.
Timings¶
- Set
MinJobAgeat least as long as your supervisor's poll interval. It is how long a finished job stays insqueue, and the adapter declares it as thePolledLosswindow for state, cause and exit code. It also bounds how long the probe waits forsacct. - Know your
SlurmdTimeoutandMessageTimeout. The node-loss window is2 × SlurmdTimeout + 60s, andMessageTimeoutenters the call bound twice. See Capabilities and declarations. - Run NTP or chrony on the login node and the controller, and on the machine the adapter runs on if it uses ssh. The probe measures the skew once and adds it to the call bound; a drifting clock makes a cached skew wrong.
On the machine that runs the adapter¶
- Make
preflight.cacheDir, if you set one, a directory of mode 0700 owned by the user, or leave it to be created. A writableslurm.Newrefuses a directory anyone else could reach, with an unsafe-directory error. - If you want
Ceased, provide a cessation command on the login node and name it incessation.command. Without one,CeasedreturnsErrUnsupported. See Configuration.
Related¶
- Read a preflight result
- Configure the transports, for the ssh side
- Tested Slurm versions