A GPU-aware CLI for Slurm clusters (Slinky, Soperator, or bare metal). It talks to
slurmrestd and answers the question researchers actually ask: "where can my
N-GPU job run right now, and is that capacity actually healthy?"
$ gpuq --fake nodes
NODE STATE PARTITION GPU FREE/TOTAL HEALTH REASON
gpu-01 ALLOCATED gpu h100 0/8 ok -
gpu-02 MIXED gpu h100 5/8 xid:63 -
gpu-03 IDLE gpu h100 8/8 ok -
gpu-04 IDLE+DRAIN gpu h100 8/8 ok xid 79 (GPU fell off the bus)
$ gpuq --fake fit --gpus 4 # skips gpu-02 even though Slurm says it has room
fits now:
gpu-03 4 GPUs
$ gpuq --fake fit --gpus 16; echo $?
does not fit now: only 8 GPUs are free on usable nodes, need 16
3
| Command | What it does |
|---|---|
nodes |
Node state, free/total GPUs, DCGM-derived health (-o json, --available) |
jobs |
List jobs (--user, --state) |
fit |
Can --gpus N [--nodes M] start now? Best-fit placement, fragmentation-aware. Exit 3 if not |
submit -f job.yaml |
Submit from a YAML spec; --dry-run shows placement. Pre-flight check is advisory |
watch <id> |
Follow a job; prints pending reasons; exit 4 if it does not complete |
cancel, drain, resume |
Job and node operations. drain refuses if jobs are running unless --force |
| Env var | Meaning |
|---|---|
GPUQ_SERVER |
slurmrestd URL (default http://localhost:6820) |
GPUQ_USER |
Slurm user the JWT belongs to (default $USER) |
GPUQ_TOKEN / GPUQ_TOKEN_FILE |
JWT, or a file containing one (re-read each request, so rotation works) |
GPUQ_API_VERSION |
slurmrestd data plugin version (default v0.0.44) |
GPUQ_PROMETHEUS_URL |
Enables the health column / health-aware placement via DCGM Xid metrics |
GPUQ_PROM_NODE_LABEL |
Metric label holding the Slurm node name (default Hostname) |
GPUQ_FAKE=1 |
Built-in demo cluster, no Slurm needed |
Mint a token with scontrol token. Against a cluster running in Kubernetes,
kubectl port-forward svc/<slurmrestd-service> 6820:6820 and point GPUQ_SERVER at localhost.
cmd/gpuq entrypoint
internal/cli commands, output formatting, exit codes
internal/slurm domain types, Client interface, GRES/TRES/hostlist parsing
internal/slurm/restd slurmrestd HTTP client (v0.0.44)
internal/slurm/fake in-memory demo cluster
internal/planner best-fit placement + "why not" explanations
internal/health Prometheus/DCGM health source
internal/spec YAML job spec parsing/validation
- Unit tests pass (
make test), including a CLI suite against the fake cluster. - The slurmrestd client has never talked to a real slurmrestd. Its JSON shapes follow
the v0.0.44 OpenAPI as I understand it and are exercised only against hand-written
fixtures. First task: capture real responses into
internal/slurm/restd/testdata/and fix whatever differs (field names,{set,number}wrappers, node state strings). - The health source assumes dcgm-exporter's
DCGM_FI_DEV_XID_ERRORSmetric and a label that matches Slurm node names. - Run
go mod tidyonce after renaming the module:grep -rl Rajrahane . | xargs sed -i 's#github.com/Rajrahane/gpuq#github.com/<you>/gpuq#g'.
See docs/ROADMAP.md for where this goes next.