Skip to content

ci: check the plugin against a live Slurm cluster - #74

Merged
somethingwithproof merged 4 commits into
mainfrom
feat/m3-slurm-live
Nov 15, 2026
Merged

somethingwithproof merged 4 commits into
mainfrom
feat/m3-slurm-live

Conversation

@somethingwithproof

Copy link
Copy Markdown
Owner

Summary

Milestone 3, part 2 of 2: a live Slurm cluster in CI. It follows #72.

  • Parser check against a live cluster. A CI job starts a real Slurm cluster in Docker, from giovtorres/slurm-docker-cluster pinned to a commit, with MariaDB pinned by digest. The cluster has slurmdbd, slurmctld, slurmrestd and six CPU nodes.
    • The job creates node states (drain, DOWN+DRAIN, a maintenance reservation) and pending, held and array jobs.
    • It captures command and REST output, and asserts the plugin's parser results on it, for every data parser the release serves.
  • Plugin transports against the cluster. The plugin's own command and REST transports collect from the cluster. The command transport goes through docker exec into slurmctld, and REST uses a token file that only the runner user can read. The job asserts that each section completed and that the snapshot matches the parsed capture.
  • Same job counts on both transports. slurmrestd /jobs/ also returns completed, failed and cancelled jobs that are still in memory, while squeue --json returns only pending and running ones. The REST transport now filters to the same states, so both transports give identical counts. A test runs both fixture sets.
  • Release cadence.
    • Slurm 26.05.5, from the digest-pinned image, runs on every change.
    • The 25.11.8 source build, about 8 minutes, runs on pushes to main, weekly, and on request.
    • 25.05 stays on fixtures.
    • ci-ok needs the live job.
  • Real captures. Fixtures captured from 26.05.5 and 25.11.8 sit next to the synthetic ones. The docs record what the live cluster showed:
    • sinfo %T prints "drained" for DOWN+DRAIN, and %E reasons can contain |, so both come from JSON;
    • DYNAMIC_NORM appears on every node;
    • 25.11 sets maintenance flags on a node several minutes late, so the check accepts the active MAINT reservation as a substitute.

Testing

  • Container runs on Cacti 1.2.31 and 1.2.x: 355 unit tests passed with 1 skipped, 17 integration tests passed, and the template export matches.
  • Live cluster runs, locally:
    • 26.05.5: all 67 transport checks passed.
    • 25.11.8: rc 0; 139 assert, 144 check and 45 collect checks passed.
  • PHPStan, REUSE, actionlint and zizmor offline: clean.
  • This PR's CI is the first run of the live job on a GitHub runner, which is amd64; the local runs were on arm64.

Not done here

  • Mismatched client and daemon versions.
  • Scale. The test cluster is small, so it doesn't speak to cost at 10,000 jobs.

Closes #40.

slurmrestd's jobs endpoint also lists completed, failed, and cancelled
jobs that slurmctld still keeps, while squeue --json lists only
unfinished ones, so a REST cluster counted ended jobs under "other" that
a client command cluster did not. The parser now drops jobs whose base
state is a finished one (unless still completing), so both transports
count the same jobs.

Adds output recorded from a live six-node cluster (slurm-docker-cluster
3.0.2 with 26.05.5 and 25.11.8) for both transports at data parser
v0.0.43, and v0.0.45 on 26.05.5, with a unit test that checks the node
states (including down and drained together, and a reason with a pipe),
the maintenance reservation, task-weighted pending arrays, held jobs,
and that both transports give identical job counts. The captures hold
no token.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The slurm-live job starts slurm-docker-cluster (pinned by commit, MariaDB
by digest) with six nodes, creates allocated, mixed, drained, down, down
and drained, and maintenance nodes, a maintenance reservation, and
running, pending, held, and array jobs, captures the client commands and
slurmrestd paths the plugin reads for every data parser the release
serves, and checks the raw JSON and the plugin's parser on it. The
slurmrestd token goes from scontrol into a header file and is masked;
it never reaches a command line or the log.

26.05.5 uses the published image pinned by digest and runs on every
change. 25.11.8 has no published image and builds from source, which
takes about eight minutes, so it runs on pushes to main, on a weekly
schedule, and on request. 25.05 has no matching cluster configuration
and stays on synthetic fixtures. ci-ok now needs the job.

Release differences the checks allow for: 25.11.8 sets a node's
maintenance flags minutes after the reservation starts, so the check
waits with a bound and otherwise accepts the active MAINT reservation;
the pending reason of jobs not pinned to a down node depends on the
scheduler pass; and slurmrestd may serve fewer data parsers than the
client lists, in which case only the client output is checked.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The client output research gains the results of the live cluster runs:
sinfo's %T hides DOWN plus DRAIN, a pipe in a reason breaks delimited
output, pending arrays arrive as one record, slurmrestd lists finished
jobs, DYNAMIC_NORM on every dynamic node, the late maintenance flags on
25.11.8, and the data parsers each release serves. The plan's testing
section and the README describe the CI job and what it does not cover.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The slurm-live job checked what the parser makes of captured output, but
never ran the plugin's own transports against the cluster. A new step
builds a cluster record for each data parser the release serves, gets
the transport from Transports::for() as the reader does, and collects a
snapshot through SlurmBackend:

- the command transport runs squeue, scontrol, and sshare through a
  wrapper that runs them with docker exec in the slurmctld container,
  which has the cluster's slurm.conf and munge. prlimit is off there,
  since it would limit docker and not the client;
- the slurmrestd transport reads the loopback daemon with the token in a
  token file that only the runner user can read, for each data parser
  the daemon serves.

Each snapshot must complete every section and match the parse of the
output fetch.sh captured just before: the job counts, each node's state,
flags, reason, and partitions, and the partition and reservation names. Slurm 25.11 adds the
maintenance reservation's flags to a node a few seconds late, so the
snapshot may carry those flags, and only those, beyond the capture. The
reader's database write is not part of the job; the Cacti replays cover
it.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93d44489-c8ab-4c83-95dd-0e0e9a7c2a43
Commits

Reviewing files that changed from the base of the PR and between 1c10c4e and 0413c18.

Files selected for processing: 48

  • .github/workflows/plugin-ci-workflow.yml
  • README.md
  • docs/PLAN.md
  • docs/research/slurm-client-output.md
  • lib/JobState.php
  • lib/SlurmParser.php
  • tests/Support/LiveExpectations.php
  • tests/Unit/LiveFixturesTest.php
  • tests/fixtures/slurm/live/25.11/rest-v0.0.43-jobs.json
  • tests/fixtures/slurm/live/25.11/rest-v0.0.43-nodes.json
  • tests/fixtures/slurm/live/25.11/rest-v0.0.43-partitions.json
  • tests/fixtures/slurm/live/25.11/rest-v0.0.43-reservations.json
  • tests/fixtures/slurm/live/25.11/rest-v0.0.43-shares.json
  • tests/fixtures/slurm/live/25.11/scontrol-node.v0.0.43.json
  • tests/fixtures/slurm/live/25.11/scontrol-partition.v0.0.43.json
  • tests/fixtures/slurm/live/25.11/scontrol-reservation.v0.0.43.json
  • tests/fixtures/slurm/live/25.11/slurm-version.txt
  • tests/fixtures/slurm/live/25.11/squeue.v0.0.43.json
  • tests/fixtures/slurm/live/25.11/sshare.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.43-jobs.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.43-nodes.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.43-partitions.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.43-reservations.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.43-shares.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.45-jobs.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.45-nodes.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.45-partitions.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.45-reservations.json
  • tests/fixtures/slurm/live/26.05/rest-v0.0.45-shares.json
  • tests/fixtures/slurm/live/26.05/scontrol-node.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/scontrol-node.v0.0.45.json
  • tests/fixtures/slurm/live/26.05/scontrol-partition.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/scontrol-partition.v0.0.45.json
  • tests/fixtures/slurm/live/26.05/scontrol-reservation.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/scontrol-reservation.v0.0.45.json
  • tests/fixtures/slurm/live/26.05/slurm-version.txt
  • tests/fixtures/slurm/live/26.05/squeue.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/squeue.v0.0.45.json
  • tests/fixtures/slurm/live/26.05/sshare.v0.0.43.json
  • tests/fixtures/slurm/live/26.05/sshare.v0.0.45.json
  • tests/slurm-live/assert.sh
  • tests/slurm-live/bin/scontrol
  • tests/slurm-live/bin/squeue
  • tests/slurm-live/bin/sshare
  • tests/slurm-live/check.php
  • tests/slurm-live/collect.php
  • tests/slurm-live/fetch.sh
  • tests/slurm-live/states.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Nov 15, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@somethingwithproof
somethingwithproof merged commit 682a3d0 into main Nov 15, 2026
19 checks passed
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.

Test harness and CI matrix

1 participant