Repository navigation
Description
Verified against 072c4b0 (v0.101.0).
Summary
On the sweep path there is no way to set the root EBS volume size at all. The CLI flag is silently dropped, and the param-file key is rejected with a message pointing at a flag that does not exist. The result is that every sweep row gets 20 GiB, and a workload whose inputs do not fit cannot be run as a sweep by any means.
This is the fourth occurrence of the same root cause (see "Not a one-off" below), and it is the first one where no workaround exists.
The two halves
1. The CLI flag is never read on the sweep path.
launchVolumeSize is declared and registered on launchCmd — the same command that accepts --param-file:
cmd/launch_flags.go:172—launchVolumeSize int32cmd/launch_flags.go:194—launchCmd.Flags().Int32Var(&launchVolumeSize, "volume-size", 0, "Root EBS volume size in GiB (0 = use AMI default)")
Its only non-test read is the single-instance path:
cmd/launch_config.go:151-152—if launchVolumeSize > 0 { config.RootVolumeSizeGiB = launchVolumeSize }
cmd/launch_sweep.go never references it (grep -n -i 'volumesize\|RootVolume' cmd/launch_sweep.go → no matches).
2. The param-file key is rejected, naming a flag that does not exist.
cmd/sweep_keys.go:131-132:
"disk_size": "--disk-size is a command-line flag, not a param-file key",
"volume_size": "--disk-size is a command-line flag, not a param-file key",There is no --disk-size flag anywhere in the tree (grep -rn '"disk-size"' --include='*.go' . → no matches). Filed separately as the doc/message half, but noted here because it is what makes this undiagnosable: the user is told to use a flag that does not exist, and the flag that does exist is the one being silently dropped.
3. So the config keeps the built-in default.
buildLaunchConfigFromParams (cmd/sweep.go:121) starts from an empty aws.LaunchConfig and has cases for exactly these keys:
instance_type, region, az/availability_zone, ami, key_pair/key_name, spot,
spot_max_price, hibernate, ttl, idle_timeout, cost_limit, hibernate_on_idle,
session_timeout, on_complete, completion_file, completion_delay,
dns/dns_name, step, command/user_command, user_data
No volume_size. So config.RootVolumeSizeGiB stays 0, and pkg/aws/ebs.go:30 applies:
volumeSize := int32(20) // Default 20 GB
if config.RootVolumeSizeGiB > 0 {
volumeSize = config.RootVolumeSizeGiB
} else if config.Hibernate {
volumeSize = estimateVolumeSize(config.InstanceType)
}20 GiB unless Hibernate is set (a different feature with a different sizing rule) or the AMI snapshot minimum is larger. Note this is spawn's own number, not the AMI's — the AL2023 base AMI's own default root is 8 GiB.
Reproduction
Any sweep, no launch needed to see it:
# sweep.yaml
defaults:
region: us-west-2
volume_size: 60
params:
- instance_type: c8g.8xlargevolume_size: → rejected, told to use --disk-size.
Drop the key and pass --volume-size 60 on the command line → accepted, tab-completes, and silently ignored; the instance comes up with a 20 GiB root.
Measured on the paid runs behind this report: a c6g.8xlarge sweep row launched with spawn's 20 GiB root reported 17.67 GiB free (18095 MB) to the workload.
Why this one is worse than #525 and #539
Both previous instances of this bug class left a workaround:
- Sweep dispatch silently drops --cost-limit and --ttl, then logs "Using safeguards: ttl=..." #525 (
--cost-limit/--ttl): the row keysttl:/cost_limit:work. - --iam-role / --iam-policy / --iam-policy-file are silently ignored on the sweep path (0.100.4) #539 (
--iam-role/--iam-policy/--iam-policy-file): the row keyiam_role:works.
For volume size there is no route at all — the key is rejected and the flag is dropped. The control is simply absent from the sweep path.
The concrete consequence for us: a BWA-MEM2 GRCh38 row needs a 16.50 GiB index (.bwt.2bit.64 9.7 GiB + .0123 6.0 GiB + .pac 767 MiB) plus container, reads and output BAM. That does not fit in 17.67 GiB, and cannot be made to fit as a sweep. The row was cancelled at spec time rather than launched into a guaranteed out-of-disk failure — but only because we read the source. The failure mode for anyone who does not is: N instances launch, all N fill the disk partway through, all N burn their full runtime and fail, and nothing in the launch output ever mentioned disk.
Not a one-off — this is the fourth
| flag family | issue | status |
|---|---|---|
--estimate-only |
#524 | ignored on the foreground sweep path |
--cost-limit / --ttl / --idle-timeout |
#525 | fixed by applyCLISpendControlsToSweep (cmd/launch_sweep.go:771) |
--iam-role / --iam-policy / --iam-policy-file |
#539 | fixed by applyCLIIAMToSweep (cmd/launch_sweep.go:803, wired at :244) |
--volume-size |
this issue | no workaround exists |
v0.101.0 now carries two bespoke applyCLI*ToSweep adapters, one per flag family, each written after that family was found to be dropped. The pattern is structural: launchCmd accepts a flag set, the sweep path consumes a different and smaller one, and nothing checks that the two agree. Every future flag added to launchCmd is dropped on sweeps by default.
So the fix worth making is probably not a third adapter.
Suggested fixes, cheapest first
- Fail loudly (sufficient on its own, and the cheapest). Make a CLI flag that the sweep path cannot honour an error, not a silent default — the principle truffle#114 settled for prices: a control that cannot be applied should be an error. This alone would have turned our silent-20-GiB into a one-line message at launch.
- Wire this flag. Add a
volume_sizecase tobuildLaunchConfigFromParamsand fold--volume-sizeintoparamFormat.Defaultsthe way the two existing adapters do. Also dropvolume_size/disk_sizefrom the rejected-keys map once the key works. - Fix the class. Derive the sweep path's accepted set from
launchCmd's flag set (or assert equality in a test) so "flag exists onlaunchCmdbut is unread bylaunch_sweep.go" fails CI instead of shipping. A table test over the flag names would catch --estimate-only is ignored on the foreground sweep path — --no-detach launches every row instead of estimating #524, Sweep dispatch silently drops --cost-limit and --ttl, then logs "Using safeguards: ttl=..." #525, --iam-role / --iam-policy / --iam-policy-file are silently ignored on the sweep path (0.100.4) #539 and this one, and every future instance.
Happy to send a PR for (1) or (2) if the direction is agreed.
Activity
test: use ParseInt instead of Atoi+int32 cast to fix Semgrep signedne…
fix: root volume size unreachable on the sweep launch path (#544, #545)…