Repository navigation
Add watcloud slurm run, with interactive and batch modes - #29
GavinDPinto wants to merge 5 commits into
Conversation
0b8e8e9 to
3c45ff9
Compare
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>
3c45ff9 to
789e0a8
Compare
… 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>
|
EDIT: This doc is not up to date, see latest comment on this PR for updated doc 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. |
|
Interactive mode is fine. Batch mode with a script file has four problems that block merge. The use-case doc doesn't hit them, because its script case only sets 1.
2. The checks ignore the script's directives.
3. Some mistakes fail only after the queue wait.
4. Without Minor
No CI runs the tests, so confirm |
Addresses review on #29. Batch scripts' #SBATCH lines are now read and merged with the flags instead of being clobbered or ignored: - A command-line --gres replaces the script's whole --gres, so --disk, --gpu-mem and --gpus now pass the script's other GRES items with their own: --disk keeps the script's GPU, --gpu-mem keeps its tmpdisk. - The checks use the script's --partition, --time, --mem, --cpus-per-task and --gres, so a script that sets its own partition and time needs no flags, and one that sets tmpdisk gets no 100 MiB note. - A missing script path (e.g. a typo) or a missing script after bash or python fails before submitting, not after the queue wait. - When sbatch won't read the script (`bash train.sh`, or a script inside the Docker wrapper), its #SBATCH lines are passed on the command line. - Jobs without --mem are told the default (DefMemPerCPU x CPUs); for GPU and Docker jobs it's a warning. README examples now pass --mem. Smaller fixes from the review: - Node sizes come from scontrol: CPUEfctv and RealMemory minus MemSpecLimit, i.e. what a job can get, and only nodes in the job's partition count. Login nodes are left out. - Array jobs print slurm-<id>_<index>.out; a script's --output is named. - Sizes print exactly (24564 MiB, not "24.0 GiB"). - The README and --help say sbatch runs a copy of the script from the spool directory. go test ./... passes on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@feinburger244 thanks, all four are fixed in 4ff1f72, plus the minor ones:
Minor: node sizes now come from scontrol (CPUEfctv, RealMemory − MemSpecLimit, partition membership), array output paths are right, sizes print exactly (24564 MiB), and the spool-copy behaviour is documented. Retested on the cluster, per
Updated use-case write-up, with a new "Batch scripts after the review" section: |
Closes #30. Closes #31. Part of #22.
watcloud slurm runbuilds the Slurm request from plain flags, prints it, and runs it.What it does
srun/sbatch:--cpus,--mem,--disk(tmpdisk),--gpu-mem(shard),--gpus/--gpu-type,--time,--partition.--dry-runprints the command instead.--dockerstarts dockerd in the job and setsDOCKER_HOST. It defaults--diskto 20 GiB instead of the silent 100 MiB.--batchsubmits withsbatch: a command through--wrap, or a script file. It allowscompute_dense, needs a time limit (from--timeor the script), and prints the job ID, output file and awatcloud subscriptionhint.#SBATCHlines still apply and count in the checks. Flags override them one at a time:--diskreplaces only the script's tmpdisk and keeps its GPU. When sbatch won't read the script (bash train.sh, or inside the Docker wrapper), its#SBATCHlines are passed on the command line.scontroland count only what a job can get.--memis told it gets 512 MiB per CPU; GPU and Docker jobs get a warning.job_submit.luaare applied up front: no interactive jobs oncompute_dense, a warning past 6 h.watcloud docker start -hnow points toslurm run --docker.Testing
internal/slurm: parsing,#SBATCHlines, thesrun/sbatchlines, node checks against the cluster's real node sizes, and the Slurm timeout.go test ./...passes on Linux.srun's 100 MiB default and works with--docker.sacct. For example,--disk 40Gon a script with a GPU share givesgres/shard=8192,gres/tmpdisk=40960.sbatch.🤖 Generated with Claude Code