Skip to content

Add watcloud slurm run, with interactive and batch modes - #29

Open
GavinDPinto wants to merge 4 commits into
mainfrom
slurm-run-command
Open

GavinDPinto wants to merge 4 commits into
mainfrom
slurm-run-command

Conversation

@GavinDPinto

@GavinDPinto GavinDPinto commented Oct 6, 2026 •

Copy link
Copy Markdown

Closes #30. Closes #31. Part of #22.

watcloud slurm run builds the Slurm request from plain flags, prints it, and runs it.

watcloud slurm run --gpu-mem 8G --disk 40G --mem 16G --time 4h --docker
watcloud slurm run --batch --gpu-mem 8G --time 12h -- python train.py

What it does

  • Flags to srun/sbatch: --cpus, --mem, --disk (tmpdisk), --gpu-mem (shard), --gpus/--gpu-type, --time, --partition. --dry-run prints the command instead.
  • --docker starts dockerd in the job and sets DOCKER_HOST. It defaults --disk to 20 GiB instead of the silent 100 MiB.
  • --batch submits with sbatch: a command through --wrap, or a script file whose #SBATCH lines still apply. It allows compute_dense, requires --time, and prints the job ID, output file and a watcloud subscription hint.
  • Checks before submitting:
    • Sizes and times need a unit.
    • Requests no node could ever run are rejected, naming the limit hit (read from sinfo).
    • The rules in job_submit.lua are applied up front: no interactive jobs on compute_dense, a warning past 6 h.
    • If Slurm doesn't answer within 5 s, it warns that the checks were skipped.
  • watcloud docker start -h now points to slurm run --docker.

Testing

  • Unit tests in internal/slurm: parsing, the srun/sbatch lines, node checks against real sinfo output, and the sinfo timeout.
  • 35 use cases run on the cluster on 9 Nov are written up in this comment. Highlights:
    • A CUDA image pull fails with raw srun's 100 MiB default and works with --docker.
    • A 6.14 GB PyTorch image fits in the 20 GiB default.
    • 13 common mistakes are stopped before submitting.
    • Failed, timed-out and queued batch jobs are reported the same way as with plain sbatch.

🤖 Generated with Claude Code

@GavinDPinto GavinDPinto changed the title feat: add watcloud slurm run, which builds the job request feat: add watcloud slurm run, with interactive and batch modes Oct 11, 2026
GavinDPinto and others added 3 commits November 2, 2026 13:27
Users say what they need (--cpus, --mem, --disk, --gpu-mem/--gpus, --time)
and it composes and runs the srun line. --docker starts dockerd inside the
job before the shell or command runs.

Scratch disk can only be set at submission, and the 100 MiB default makes
image pulls fail, so --docker defaults it to 20 GiB and sizes require a unit.
Requests no node could ever run are rejected using sinfo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--batch submits the command or script after -- with sbatch instead of
running it with srun, reusing the same flags and cluster checks. It prints
the job ID, the output file, and how to get notified when the job ends.

A script file is passed to sbatch directly so its #SBATCH lines still
apply; a command goes through --wrap, as does a script with --docker.
Batch jobs may use compute_dense and skip the interactive 6-hour warning,
but need --time, since a job killed at the 30-minute default has nobody
watching it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@feinburger244 feinburger244 changed the title feat: add watcloud slurm run, with interactive and batch modes Add watcloud slurm run, with interactive and batch modes Nov 6, 2026
… silently

When the controller was down, sinfo retried for about 30 s, and slurm run
then skipped its node checks without saying so. sinfo now gets 5 s, and
when it fails, times out or lists no nodes, slurm run prints a warning
naming the reason before the srun or sbatch line.

Found by the use-case run during the 9 Nov outage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GavinDPinto

GavinDPinto commented Nov 9, 2026 •

Copy link
Copy Markdown
Author

slurm-run-use-case-testing.md

The above doc has some information on the common use-cases for the command as well as some incorrect usage and the associated error messages outputted.

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.

[#13.2] slurm run: --batch mode [#13.1] slurm run: interactive jobs

1 participant