Repository navigation
fix(slurm): make slurm submit and slurm convert output launchable - #1329
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
slurm submit handed off to `spawn launch --param-file` with no spore name, which launch refuses, so every submit failed after the cost was approved (#1217). It now passes a name derived from --job-name (else the script's file name) reduced to a valid DNS label, launches in the foreground (--no-detach: detached sweeps run no row commands, #1323), carries %N as --max-concurrent, and pins the file to the region the cost was quoted in. slurm convert put each job script under `script:`, which launch rejects (#1242). Scripts now go under `command:`; a sweep row's command that the 256-char spawn:command tag cannot carry is embedded in the row's user data instead. max_concurrent is no longer written as a param key, array members get distinct valid names, and multi-node MPI jobs (which a param file cannot express) are refused before the cost prompt. Gates run argv through launch's own Args validator and the converted file through launch's parser, key/duration validators, config builder and user-data builder. Fixes #1217 Fixes #1242
scttfrdmn
force-pushed
the
fix/1217-1242-slurm-bridge
branch
from
October 26, 2026 22:27
daf1cc8 to
bbf56fc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1217
Fixes #1242
What changed
#1217,
spawn slurm submitspawn launchnow includes a spore name:slurm.SporeNametakes--job-name, else the script's file name, elseslurm-job, and reduces it to a valid DNS label (lowercase[a-z0-9-], 63 chars max). Launch registers the name in DNS and uses it as the hostname, and a Slurm job name is free text.--no-detach. A detached sweep launches its rows with no user data, so the job script would never run (Detached sweep members launch with no UserData, so spored never runs on them (#725 follow-up; blocks #1313) #1323).--array=...%Nlimit becomes--max-concurrent N.max_concurrent:is a param-file key that launch rejects.est.Region), so the launch can't land in a region nobody priced.--spotpropagation is removed: slurm submit has no--spotflag, and spot comes from the script's#SPAWN --spot.#1242,
spawn slurm convertcommand:(wasscript:, which launch always rejected).max_concurrentis no longer written.spawn launch --params, which is not implemented.spawn launch --mpi --count N. The old output launched one instance withPARAM_mpi/PARAM_countand no MPI setup. Follow-up: slurm convert/submit: support multi-node MPI jobs (--nodes > 1) #1328.Launch side (outside the slurm area, kept minimal):
cmd/sweep.go,cmd/launch_config.gocommand:rode only thespawn:commandtag. EC2 caps tag values at 256 chars, so any real job script was refused at RunInstances. A row command the tag can't carry (over 256 chars, or multi-line) is now embedded in that row's user data, the same way a single launch's--commandis (nonSweepCommandwas renamedembeddedCommand). Short one-line commands keep the tag path unchanged.command:now beats a CLI--command, which matches the documented precedence (row > flag). Before, the CLI value got the tag first andappendTagUniquedropped the row's.Gates (each watched failing against a compiling revert)
TestSlurmSubmitArgvIsAcceptedByLaunchresolves the exact argv throughrootCmd.Find, then launch's own flag set, thenlaunchCmd.Args(the reallaunchNameArgs). It also checks the name withisValidDNSName, plus--no-detachand--max-concurrent.--no-detach. Fails.TestSlurmConvertOutputIsAcceptedByLaunchconverts real sbatch scripts (a single task, and an array with a step and a%Nlimit, whose body is longer than 256 chars). It writes the YAML and runs it throughparseParamFile,validateTopLevelParamKeys,validateSweepParamKeys,validateSweepDurationsandsweepRowsWithoutBound. For each row it then runsbuildLaunchConfigFromParamsandbuildUserData, and requires the script body and the rightSLURM_ARRAY_TASK_IDin the user data, the user data within EC2's size limit, no tag over 256 chars, and distinct valid names.scriptkey. Fails as unusable keys.max_concurrentrestored. Fails as an unusable key.TestSweepRowCommandTheTagCannotCarryIsEmbeddedcovers the tag-vs-embed split and the row-beats-CLI precedence.Checks
make lint: 0 issues in all 10 modules.make check: everything passes up tocheck-build-tags, which fails on the/private/tmppath issue that is present on unmodified main. It lists onlytest/e2efiles.make gen-docs+make check-docs: clean. Theslurm converthelp text changed.semgrep --config=auto --erroron the changed files: 0 findings.Not covered / known
--timehas no TTL, sosubmitis refused by--no-detach's bound check with launch's own message. That's fail-closed by design.--name's DNS name, so array members all register the same DNS label. This predates the PR and applies to any sweep launched with a name.user_data:is parsed and then discarded), slurm convert/submit: support multi-node MPI jobs (--nodes > 1) #1328 (MPI support).