Skip to content

The sweep path drops 83 of 127 launch flags by construction — parent of #525/#539/#549/#667/#673/#674/#675 #697

Closed

Description

@scttfrdmn

Parent issue for a class that has now been filed six times individually: #525 (spend controls), #539 (IAM, twice — once for the original flags and again for --s3-read/--s3-write), #549 (dns.enabled), #667 (fixed for single launches, still broken on sweeps), #673/#674/#675. Each was fixed as a one-off. The architecture guarantees there will be more.

The root cause is one deliberate line

cmd/launch_single.go, the sweep dispatch:

// Parameter sweep launch path - config will be built inside launchParameterSweep
// Create minimal config for sweep orchestration
config := &aws.LaunchConfig{
    Region:       region,
    InstanceType: instanceType, // May be empty, that's ok for sweeps
}
return launchParameterSweep(ctx, config, plat, auditLog)

The single-instance path calls buildLaunchConfig(), which reads every CLI flag global. The sweep path builds a config with two fields and never calls it. buildLaunchConfigFromParams then "start[s] with an empty config" and merges only the param file's recognised keys.

So on the sweep path every CLI flag is dropped by default, and a flag works only if someone hand-writes a shim for it. applyCLISpendControlsToSweep (#525) and applyCLIIAMToSweep (#539) are exactly those shims — two categories reclaimed by hand, after each was reported.

Measured

Counting variables bound to launchCmd flags against references anywhere in the sweep path (launch_sweep.go, sweep.go, sweep_keys.go):

count
launchCmd flags 127
honoured on the sweep path 44
dropped 83
dropped with no param-file key either 72

The param file recognises 27 keys, so for 11 of the dropped flags there is at least a documented workaround (on_complete:, key_name:, completion_file:, …). For the other 72 there is no way to express the setting on a sweep at all.

The ones that matter

Not all 72 are bugs — --batch-queue, --queue-template, --job-array-name, --mpi*, --min-viable, --interactive are genuinely not sweep concepts, and --dry-run is explicitly refused on this path. But these are:

Storage — a sweep cannot mount anything. --efs-id, --efs-mount-point, --efs-mount-options, --efs-profile, all eleven --fsx-*, and --attach-volume. For an HPC sweep that is a large functional hole: every row has to stage through S3 because shared storage is unreachable.

Networking — #667 is only half-fixed. --security-group-ids, --security-group, --subnet-id, --subnet, --vpc. #667 fixed these for single launches; on a sweep they are still silently dropped, so every row still lands in the VPC default security group. The --efs-id consequence #667 describes (mount target in another SG → 2049 blocked → hard NFS mount hangs) is unreachable here only because --efs-id is dropped too.

Lifecycle and data safety. --pre-stop / --pre-stop-timeout (the hook that syncs results before termination — losing it loses output), --on-idle, --active-ports, --active-processes (the inputs to idle detection), --completion-webhook-url, --spot-webhook-url.

Attribution and ops. --tag, --team, --plugin, --user-data-file, --no-dns, --notify-platform.

Suggested fix: invert the default

Rather than a seventh shim, pass the real config in and let param rows override it:

  1. In the sweep dispatch, call buildLaunchConfig() exactly as the single path does, and pass that as baseConfig.
  2. Have buildLaunchConfigFromParams merge each row onto a copy of baseConfig instead of onto an empty struct, preserving the sweep identity fields it sets today.

That changes the default from "drop every flag unless someone wrote a shim" to "honour every flag unless the row overrides it", which is what a caller expects and what the single-instance path already does. It also makes the existing applyCLI*ToSweep shims redundant, and a row's own key still wins — the precedence #539's fix already established.

Known risks, because this is not a drive-by. buildLaunchConfig performs validation (the FSx lifecycle contract, --capacity-block vs --spot exclusivity) that would begin applying to sweeps — correct, but a behaviour change. And the sweep code branches on fields being empty (firstConfig.IamInstanceProfile == "" decides whether to set up the shared spored role), so populating them changes those branches. This wants its own PR with a real test pass, and a hardware smoke, because the sweep path launches N instances at once.

Gate

Separately from the fix: a manifest classifying every launchCmd flag as honoured on sweeps, not applicable, or known gap (#issue), with a test that fails when a flag is added to launchCmd without a classification. That turns "silently dropped" into a decision someone has to make, which is the part that has failed six times. I'm adding that now, independent of the inversion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions