Run the conformance suite against sind¶
go test ./... uses recorded transcripts of Slurm's output and never touches a cluster. This page
is for the other test: running go/dispatch's conformance suite against a real slurmctld, using
sind to bring up a small Slurm cluster in docker. Run it before
you change how the adapter reads or writes Slurm, and when a new Slurm release needs checking.
What you need¶
- docker, able to run containers as you;
sshandssh-keygenon thePATH;- a
sindbinary, on thePATHor named byDISPATCH_SLURM_SIND_BIN; just, for the recipe below. Without it, run the command it wraps;- the module checked out, and Go at the version
go.modnames; - time and memory. One run takes about 35 minutes per Slurm version. The cluster is one
controller capped at 1 GiB and two workers capped at 512 MiB each, swap included, plus the two
helper containers sind shares (
sind-sshandsind-dns), each capped at 256 MiB if it has no memory limit yet, whoever started it. Leave about 3 GiB free.
Run it¶
The argument is a sind-node image tag, and the tags tested are those two. The recipe is:
CGO_ENABLED=0 matters: one part of the run copies the test binary onto the cluster's controller
and runs it there, and a binary linked against your host's C library may not start in the node
image.
The images are ghcr.io/gsi-hpc/sind-node:<tag>, so the host needs to be able to fetch them.
Environment variables¶
| Variable | Meaning |
|---|---|
DISPATCH_SLURM_SIND |
The sind-node image tag to run, such as 25.11.8 or 26.05.4. Unset, every test in the package skips and says so. |
DISPATCH_SLURM_SIND_BIN |
The sind binary. Unset, sind is looked up on the PATH. |
DISPATCH_SLURM_SIND_POWERSAVE |
Any non-empty value brings the cluster up with Slurm's power saving on, through stub programs, SuspendTime=7200 and ResumeTimeout=300, and runs TestAReplacementUnderPowerSaving. CI leaves it unset. |
DISPATCH_SLURM_SIND_KEEP |
Any non-empty value leaves the cluster running when the tests end, for you to look at. Delete it yourself with sind delete cluster dsl<version without dots>, for example dsl25118. |
DISPATCH_SLURM_SIND_ONHOST |
Set by the run itself, on the copy of the test binary it runs on the controller. Do not set it. |
What it runs¶
The cluster has one controller, two workers, partitions main and high (so a job in high
preempts one in main), TaskPlugin=task/cgroup, and an unprivileged user, trainer, who is
reachable over SSH. A small job_submit plugin is compiled in the controller and loaded but
passive until a test arms it.
TestConformance runs conformance.Backend over three ways of delivering the adapter's scripts:
| Subtest | Delivery | Faults injected |
|---|---|---|
docker-exec |
the local transport's scripts, carried into the controller by docker exec from outside |
all of them |
ssh |
the SSH transport, to the controller's sshd |
all of them |
local |
the test binary copied onto the controller and run there as trainer, so the real local transport runs |
all but the ones that need root or docker |
The faults are a higher-priority partition to preempt a job, cutting a node's power, the owner
setting Requeue=1 and requeueing, freezing slurmctld to delay a submit's reply, killing the
host shell after a requeue's first step, and making the host-side check read a clock past the
deadline.
Nine more tests cover what the shared suite cannot:
TestReadBackarms the plugin to rewrite the job's comment, setRequeue=1, or strip the hold, and checks thatStartstops the job and refuses it, and that preflight's probe refuses the cluster, naming the difference. It runs over thedocker-execdelivery only.TestLandingBoundfreezesslurmctldbetween a call's lookup and itsscontrol, and checks that a call older than the credential TTL changes nothing while a younger one lands before its deadline plusCallBound. It runs over thedocker-execandsshdeliveries.TestOrphansKeepTheCessationGateSIGKILLs a job's batchslurmstepd, lets the job end by Slurm's purge or by anscancel, and restartsslurmdon its node while the script's processes run on as orphans. It checks thatCeaseddoes not say ceased: under the defaultcessation.bootTimeit returnsErrUnsupportednamingcessation.bootTime, and a configuration that listsslurm-nodegets a warning naming it. It runs over thedocker-execdelivery only.TestASecondOpenSubmitsNoProbeopens a writable backend twice on one preflight cache, and checks by Slurm's job ids that the second open submitted no probe job. It runs over thedocker-execdelivery only.TestAReplacedPodUnderARunningJobpower-cycles the container of a running job's batch host, withslurmdunder-bas Soperator runs it, and a stand-in Kubernetes API that shows each node container as a pod created when the container last started. Slurm goes on reporting the jobRUNNING. The test checks that the adapter reports itrunningwith causenode-lost, naming the batch host, and thatStopthen ends it. It runs over thedocker-execdelivery only.TestASlurmdRestartUnderARunningJobIsNotLostrestartsslurmdon the batch host under a running job, with the same setup, and waits for the node'sBootTimeto move past the job's start. The container and the job's processes stay, so the test checks that the adapter reads the jobrunningwith no cause for the four minutes it watches.TestAReplacedNonBatchNodeIsLostpower-cycles the job's other node. The adapter reports the jobrunningwith causenode-lost, naming that node but not as the batch host, and the test checks that it keeps reportingnode-lostuntil the job ends or the four minutes run out. On Slurm 25.11.8 Slurm went on reading the jobRUNNINGfor all four.TestALateReplacementpower-cycles the batch host 60 s and 200 s into the job. On Slurm 25.11.8 Slurm ended the jobNODE_FAILwithin seconds. The test allows four minutes, and checks that the adapter reports the job ended with causenode-lost.TestAReplacementUnderPowerSavingruns only withDISPATCH_SLURM_SIND_POWERSAVEset, and first checks thatslurmctldreally runs with power saving on:ResumeTimeoutof 300 seconds and aSuspendTimeother thanNONE. It power-cycles the batch host 5 s, 60 s and 200 s into the job. With power saving on, Slurm goes on reading the jobRUNNINGfor minutes (on 25.11.8, up to six and a half). The test checks that the adapter reports the job lost within a minute of the replacement and from then until it ends, that it ends with causenode-lostwithinResumeTimeoutplus four minutes, and that the cause's detail names Slurm'sfailed_nodereason. It takes about twenty minutes.
The lost-node tests have run on a local sind cluster on Slurm 25.11.8 only: no pipeline has run a sind job with these checks yet.
The lost-node tests after TestAReplacedPodUnderARunningJob log each change in what the adapter
and Slurm read of the job, so a run is also a measurement. That first one logs the cause it
reports, and then the cause the job ends with after its stop.
To run one part, add -run to the command. For example, only the SSH delivery:
DISPATCH_SLURM_SIND=25.11.8 CGO_ENABLED=0 go test ./internal/sind/ -v -count=1 -run 'TestConformance/ssh'
The cluster still comes up first.
Read the skips¶
A skip is a check nobody made. Expect these, and treat others as new:
ReadBackandPreflightinsideconformance.Backendskip for every adapter, because the shared suite has no fault that rewrites a submission and the SPI has no preflight entry point.TestReadBackand the preflight run inslurm.Newcover them here.LoseNodeandDelaySubmitReplyare not injected on thelocaldelivery, which has neither root nor docker. The other two deliveries cover them.TestReadBack/adminholdalways skips. Nojob_submitplugin can turn the owner's hold into an admin hold, becauseslurmctldpicks the reason from the priority after the plugin has run. The refusal of an administrator's hold is covered by the recorded-transcript unit tests.NativePolicyCompilerandWatcherskip, because the adapter implements neither.
Clean up¶
On success or failure the run deletes its cluster, unless DISPATCH_SLURM_SIND_KEEP is set. If a
run is killed, look for leftovers with docker ps -a --filter name=sind-dsl.
Related¶
- Tested Slurm versions
- Write an adapter and pass the conformance suite, the counterpart in go/dispatch's documentation.