Run the acceptance suite¶
The acceptance suite runs the dunscaith binary against a real Slurm cluster and judges it by
what it prints. The cluster is three containers, a controller and two workers, made by
sind. Every merge request runs it on Slurm 26.05.4, and some
also on 25.11.8 (see What a merge request runs). These are the
releases the Slurm adapter is tested on.
GOBIN=$PWD/bin CGO_ENABLED=0 go install gitlab.com/phpboyscout/go/launch/cmd/launch@v0.2.0
DUNSCAITH_SIND=25.11.8 DUNSCAITH_LAUNCH_BIN=$PWD/bin/launch go test -count=1 -timeout 40m -v ./test/acceptance
Without DUNSCAITH_SIND every test skips, so go test ./... never needs a cluster. A run takes
about five minutes once the node image is built.
What it proves¶
| Test | What happens | What dunscaith must print |
|---|---|---|
TestAJobRunsOnEveryNodeToSuccess |
a two-node job runs to its end | succeeded from the supervising submit, from status and from list |
TestCommandsAfterTheFirstSubmitNoProbeJob |
status twice and list, after a job has run |
nothing is judged by what is printed: Slurm's next job ID must not move, so no probe job was submitted |
TestAPreemptedJobIsResubmittedUnderTheSameIdentity |
a job in a higher-priority partition preempts it mid-run | pending -> recovering, then succeeded; status lists a second submission of the same job |
TestAnOverdueHoldIsReportedAndStaysHeld |
hold --until 10s, and nobody releases it |
an ESCALATION ... the hold is past its deadline; the job stays held with the nodes free, until release |
TestALostNodeIsCalledNodeLost |
a worker is killed mid-run | failed (node-lost), not a plain failure |
TestATorchrunJobRunsAcrossNodes |
torchrun starts one rank on each node, and they all-reduce over gloo |
succeeded; each rank's output says it found the other |
TestStatusShowsLaunchsCauseDocument |
go/launch's launch train runs on both nodes, and its training command fails with exit 3 |
failed (non-zero-exit); status gives a detail line opening with the class and summary from the cause document launch wrote |
Most of the jobs are shell loops started on both nodes with srun, because those tests are about
submission, supervision and recovery. The torchrun job proves that a PyTorch distributed job
starts and finds its peers under dunscaith. No GPU is involved: PyTorch's CPU build runs it.
The launch job runs a stand-in for torchrun, first on its PATH, so it needs no PyTorch.
What it needs¶
- Docker Engine 28 or newer, and permission to use it.
sind, at the versionSIND_VERSIONpins in.gitlab-ci.yml:go install github.com/GSI-HPC/sind/cmd/sind@<SIND_VERSION>.- A static linux build of go/launch's
launch, at the releaseLAUNCH_VERSIONpins in.gitlab-ci.yml, named byDUNSCAITH_LAUNCH_BIN. Without it the launch test fails. - About 3 GB of memory, and room for the node image, which is 2.6 GB.
The node image is ghcr.io/gsi-hpc/sind-node with PyTorch's CPU build added, from
test/acceptance/node/Dockerfile. PyTorch and everything it installs are pinned exactly in
test/acceptance/node/requirements.txt. The suite builds it as dunscaith-sind-node:<release> before
it starts the cluster. The first build downloads about 1.3 GB; after that docker's cache serves
it.
In the pipeline the image is sind-node:<release>-<hash> in this project's container registry.
test/acceptance/node/image.sh makes the hash from the base image's digest and every file in that
directory, so a new base image under the same release, or any change to the Dockerfile or the
pins, names an image that is not built yet. Only the default branch builds one and pushes it; each
push checks whether its images exist and builds only a missing one. A merge request pulls the image,
2.6 GB per release, or builds its own if the image isn't there yet, and never pushes it.
Renovate proposes patch releases of each Slurm release, new sind and go/launch versions, and new
torch and setuptools releases. The other packages torch installs are regenerated with it, by the recipe at the top of
requirements.txt, since Renovate cannot know which versions torch accepts. Moving to a new Slurm
release line is a change made by hand. The one input
not pinned is the python3-pip that dnf installs, which only installs the pinned packages.
| Variable | Meaning |
|---|---|
DUNSCAITH_SIND |
The Slurm release to run, the tag of the sind-node image. Unset, every test skips. |
DUNSCAITH_SIND_IMAGE |
A node image already built from test/acceptance/node/Dockerfile for that release. Unset, the suite builds one. |
DUNSCAITH_SIND_BIN |
The sind binary. Unset, sind on PATH. |
DUNSCAITH_BIN |
A linux dunscaith to put on the cluster. Unset, the suite builds one from the tree. |
DUNSCAITH_LAUNCH_BIN |
A linux launch to put on the cluster. Unset, the launch test fails. |
DUNSCAITH_SIND_KEEP |
Set to anything to leave the cluster running afterwards. |
What a merge request runs¶
Each run takes about 6 minutes of a privileged runner, so the pipeline is deliberate about how many it starts:
acceptanceruns on Slurm 26.05.4 in every merge request.acceptance-older-slurmruns on 25.11.8 only when a merge request changesgo.modorgo.sum, anything underinternal/adapters/ortest/acceptance/, or.gitlab-ci.yml. Those carry the Slurm adapter, its wiring and the suite. dunscaith's own code reads Slurm only through the adapter, so a change elsewhere behaves the same on both releases.
Look at a failure¶
A failing test prints what the supervising submit printed and the cluster's queue. To look
further, keep the cluster:
DUNSCAITH_SIND=25.11.8 DUNSCAITH_SIND_KEEP=1 go test -count=1 -v -run TestAPreempted ./test/acceptance
docker exec -it -u trainer -e USER=trainer -e HOME=/home/trainer sind-dun25118-controller bash
/data/bin/dunscaith --config /data/jobs/config.yaml list
Each job's file, and what its submit printed, are in /data/jobs. Its output is in /data/out.
Remove the cluster with sind delete cluster dun25118.
What the suite configures that your site may not¶
The suite's configuration works around two things about a cluster in containers:
record.rootis under/dev/shmwithrecord.ephemeral: true, because a container's own filesystem is one the record store refuses. See Choose a record backing.- The adapter's
output.diris on the shared/data, because sind's nodes do not share a home directory, and the adapter reads a job's output directory from the login node.
It also sets supervise.poll: 5s, to keep the run short.
Run it on Kubeflow¶
A second suite, test/acceptance/kubeflow, runs dunscaith from the host against a kind cluster
carrying Kubeflow Trainer v2.3.0, JobSet and Kueue. It is go/dispatch-kubeflow's own test cluster,
brought up by that module's scripts at the version dunscaith's go.mod pins, so it is the cluster
that version's kind tests passed on. Every merge request runs it.
Without DUNSCAITH_KIND=1 every test skips. A run takes about six minutes on a workstation, most
of it bringing the cluster up; the three tests run side by side in about one.
| Test | What happens | What dunscaith must print |
|---|---|---|
TestAJobSucceeds |
a two-node job runs to its end | succeeded from the supervising submit, from status and from list |
TestAJobThatExitsNonZeroFails |
a two-node job exits 3 | failed (non-zero-exit) |
TestACancelBesideTheSupervisorEndsCancelled |
a second process cancels a running job whose pods ignore TERM | cancelled from the supervising submit, and no escalation in status |
Each test runs in a namespace of its own, with its own configuration and record root.
One run at a time holds the cluster: a second run started beside it stops at once with
another local run holds dunkind, and runs no script. The lock is a file in $TMPDIR that the
operating system releases when the run ends, however it ends. Interrupted while it brings the
cluster up, a run takes down a cluster it started and says so; interrupted again, it stops and
leaves the cluster running.
What it needs¶
- Docker Engine 28 or newer,
kind0.33.0 andkubectl, onPATHor named below. - Go, for go/dispatch-kubeflow's scripts to build the images they load into the cluster.
- About 8 GB of memory: the scripts cap each of the three kind nodes at 2.5 GB.
| Variable | Meaning |
|---|---|
DUNSCAITH_KIND |
1 runs the suite. Unset, every test skips. |
DUNSCAITH_KIND_BIN |
The kind binary. Unset, kind on PATH. |
DUNSCAITH_KIND_SCRIPTS |
A directory holding go/dispatch-kubeflow's up.sh and down.sh. Unset, they are read from the pinned module. |
DUNSCAITH_BIN |
The dunscaith to run. Unset, the suite builds one from the tree. |
DUNSCAITH_KIND_KEEP |
Set to anything to leave the cluster running afterwards, even after a bring-up that failed part way. Unset, a cluster the run started is taken down whatever the result; one that was there before it is left. |
PREBUILT |
A directory holding dispatch-admission and publish already built, for a host with no Go, as the pipeline's is. |
Look at a failure¶
A failing test prints what the supervising submit printed and the namespace's TrainJobs, JobSets
and pods. With DUNSCAITH_KIND_KEEP=1 the cluster, dunkind, stays up:
kind get kubeconfig --name dunkind > /tmp/dunkind.kubeconfig
kubectl --kubeconfig /tmp/dunkind.kubeconfig get trainjobs,pods -A
Remove it with kind delete cluster --name dunkind.
What each merge request costs¶
Both suites run on every merge request, on the privileged runner: Slurm on the newest release, and Kubeflow. Slurm also runs on the older release when the change touches what it could affect. The Kubeflow job spends most of its time bringing its cluster up, and only one runs at a time. It fails if any of its tests skips, so a dropped variable cannot pass it with nothing run.
That is about six minutes and 8 GB of memory per merge request for Kubeflow, beside the Slurm jobs.
It is accepted as the price of the only check that runs dunscaith on Kubeflow end to end. Its own
resource group lets it run beside a Slurm job. The pipeline pulls the busybox image up.sh needs
through the group's dependency proxy, out of Docker Hub's anonymous rate limit, and falls back to
Docker Hub if the proxy fails. kind's node image is still pulled from Docker Hub, so a rate limit
there can still fail the job.