Skip to content

feat(sweep): carry --no-public-ip on a detached sweep (#1437) - #1467

Merged
scttfrdmn merged 4 commits into
mainfrom
feat/1437-detached-no-public-ip
Oct 31, 2026
Merged

scttfrdmn merged 4 commits into
mainfrom
feat/1437-detached-no-public-ip

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1437

A detached sweep can now use --no-public-ip. Before, it was refused there (#1433).

Design

  • The subnet check runs at --detach, in the CLI, with the caller's credentials. seedDetachedBootstrap calls detachedBootstrap.privateNetOf for every NoPublicIP member. In production that is aws.Client.PreflightNoPublicIP, through the same preflightNoPublicIPFor seam the foreground paths use, wired in launchSweepDetached only. It runs after the member's target OS is known and before its launch settings are rendered, so each member is checked in its own region/AZ (a row's az included). With only an AZ, the subnet that was checked is pinned in SubnetID. A failing subnet refuses the detach before anything is uploaded or created, unless --allow-missing-endpoints. Repeat checks are cached per (region, subnet).
  • detachedSettingsGuard no longer refuses --no-public-ip. It calls LaunchConfig.ValidateNoPublicIP(), so the foreground refusals apply here too: no subnet or AZ, a row's dns, a custom DNS target, and --allow-missing-endpoints without --no-public-ip. Multi-card --efa is still refused (single interface only).
  • aws.LaunchSettings.NoPublicIP (no_public_ip,omitempty). applyNoPublicIP moved into applyLaunchSettings, so Client.Launch and LaunchSettings.Apply (the orchestrator) build the no-public-IP interface with the same code. Apply refuses no_public_ip with no subnet_id (the CLI never writes that). The orchestrator makes no Elastic IP calls, and a gate now holds that.
  • The orchestrator needs no new IAM. It does not re-run the check.
  • Resume: a detached resume re-invokes the orchestrator on the uploaded params, which carry no_public_ip and the pinned subnet. The foreground resume record already round-trips NoPublicIP/AllowMissingEndpoints.

Stale-orchestrator safety

No schema bump. Every orchestrator since v0.147.0 (#1353) decodes settings with DisallowUnknownFields, so a v0.147.0 to v0.152.0 orchestrator refuses a --no-public-ip member ("a field this build cannot apply") instead of launching it with a public IP. That is a non-capacity error, so the member fails without being launched. Settings without the flag omit the field and still decode on older orchestrators. A schema bump would have broken every detached sweep in both directions of skew, including the params already in S3 for running sweeps and schedules, because the decoder requires an exact schema match. The LaunchSettingsSchema comment now states this policy. Pre-v0.147.0 orchestrators ignore spawn_launch_settings entirely. They were already unsupported for the same reason (#1353's CHANGELOG says to deploy the orchestrator first).

Gates (each watched failing against a compiling revert)

  • TestDetachedNoPublicIPChecksEveryMembersSubnet (cmd)
  • TestPrivateMemberLaunchesWithNoPublicIP, TestOrchestratorNeverManagesElasticIPs (lambda/sweep-orchestrator)
  • TestOlderOrchestratorRefusesSettingsItCannotApply (pkg/aws): decodes this build's settings through the real decoder into the v0.147.0 to v0.152.0 struct shape
  • TestDetachedMemberRunInstancesIsTheForegroundMembers now covers NoPublicIP
  • TestDetachedResumeRelaunchesFromParamsCarryingEveryFlag now runs --no-public-ip (it was skipped before)

IAM inventory

docs/reference/cli-iam-actions.md now lists ec2:DescribeRouteTables, ec2:DescribeVpcEndpoints, ec2:DescribeSubnets and ec2:DescribeVpcs under spawn schedule create. This is the documented over-approximation: the call graph resolves the bootstrap's func field across both callers. The schedule path never sets the check and never has NoPublicIP. spawn launch already listed all four.

Deploy

make deploy-checklist FROM=v0.152.0 TO=HEAD: sweep-orchestrator and pipeline-orchestrator are code-only. Deploy the sweep-orchestrator before users rely on the CLI side. Until then, --no-public-ip detached members are refused, never launched with a public IP.

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_sweep.go 0.00% 3 Missing ⚠️
pkg/aws/launch_settings.go 88.23% 2 Missing ⚠️
cmd/launch_sweep_detached_bootstrap.go 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the feat/1437-detached-no-public-ip branch from 5473129 to 91f3cfe Compare October 31, 2026 19:49
@scttfrdmn
scttfrdmn merged commit 0eee791 into main Oct 31, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the feat/1437-detached-no-public-ip branch October 31, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sweep: carry --no-public-ip on a detached sweep (subnet check at --detach, LaunchSettings field)

1 participant