Skip to content

spawn slurm convert emits a 'script' param that spawn launch --params always rejects #1242

Closed

Description

@scttfrdmn

Found while adding the #689 shellcheck gate. Verified in code and by calling the real functions, not on AWS.

spawn slurm convert tells the user To launch: spawn launch --params <file> (cmd/slurm.go). pkg/slurm.ConvertToSpawn puts the converted job script under the parameter key script (pkg/slurm/convert.go:75/104/121). script is not a sweep key (cmd/sweep_keys.go), so it falls to the PARAM_* passthrough, which refuses it. Every generated script starts with #!/bin/bash\n, so it always contains a newline.

Probe: a minimal SlurmJob{JobName:"x", ScriptBody:"echo hi\n", CPUsPerTask:1, MemoryMB:1024} → ConvertToSpawn → buildLaunchConfigFromParams(..., params[0], ...) returns:

"script" contains a newline, which cannot survive as an EC2 tag value — remove it or replace it with a space/delimiter the workload can parse

So converted output can never launch, and no instance bills. Even if it got past that check, nothing on the instance runs a PARAM_SCRIPT. The converted script would need to travel as the command or as user data, e.g. user_data or an embedded command, the way #214/#246 moved --command off the 256-char tag.

The #689 PR also fixes the script text itself: --job-name and --chdir were unquoted, and a failed cd ran the body in the wrong directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions