Repository navigation
feat(launch): --bootstrap-egress proxy on foreground parameter sweeps (#1515 PR A) - #1531
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
Live test at
|
| # | Check | Result |
|---|---|---|
| 7 | Refusals | ✅ Each of these was refused before any AWS call, with the message naming #1515 and --no-detach: --bootstrap-egress proxy with --detach, the same with the default (detached), and SPAWN_BOOTSTRAP_EGRESS=proxy with --detach. 0 instances in the VPC. |
| 2 | Ubuntu 24.04 foreground sweep, 2 × t4g.small, --bootstrap-egress proxy --egress-proxy-idle 30m --no-detach |
✅ One find-or-create for the VPC: launched egress proxy i-0f76eef6…, ready in 234 s. Both members launched after it, each with default,spawn-egress-clients-<vpc>. A member ran aws --version, printed aws-cli/2.39.3 (installed by the bootstrap), and SPAWN_COMPLETE = completed/command/0. The proxy log shows one CONNECT awscli.amazonaws.com from each member IP plus the readiness probe. |
| 3 | Rerun the same sweep | ✅ reusing i-0f76eef6…, and both members launched. |
| 4 | AL2023 foreground sweep with the opt-in | ✅ No proxy step, no new proxy, and both members launched. This confirms the subnet check now runs after AMI detection. |
| 5 | AL2023 foreground sweep without the opt-in | ✅ Accepted and launched; no proxy. |
| 9 | Teardown | ✅ egress-proxy delete --vpc terminated the proxy and deleted both groups. The VPC is deleted. Leak diff against a pre-run baseline: no new instances, SGs, Spot requests, EIPs or test VPCs. status --all-regions: none in 18 regions. |
Not run live:
- Multi-VPC grouping (two VPCs). Rows can't set a subnet, so it would need a cross-region no-NAT setup. It's unit-tested.
- One-VPC failure teardown (test: cover pkg/dns (→39.5%) and pkg/provider (→24.0%) #6). Unit-tested.
- Resume (docs: add status badges + Codecov upload #8). Unit-tested.
Found along the way (pre-existing, not this PR): a --param-file sweep without a CLI --instance-type takes the wizard path and refuses --no-public-ip, and the examples omit the required spore name. Filed as #1532.
This was referenced Nov 5, 2026
Merged
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.
Refs #1515
PR A of sweep support for
--bootstrap-egress proxy(owner plan, 2026-11-05): foreground parameter sweeps. Detached sweeps and the orchestrator are PR B.Design
ensureSweepEgressProxiesreruns each member's--no-public-ipcheck from the client's cache, in the member's own region and subnet. It groups the members whose check hasViaEgressProxyby (region, VPC), then callsdeploy.FindOrCreateonce per VPC, one VPC at a time, in first-appearance order. Each such member then gets its VPC'sEgressProxyAddrandMemberGroups, and must passCheckMemberEgress. A member with no proxy need (NAT route, AL image, not opted in) gets nothing. A sweep with no such member makes no proxy.renderForegroundSweepUserData, which bakes the address into the bootstrap. So the proxy is ready before any member launches.--egress-proxy-idle, with the same default and cap (validated invalidateBootstrapEgressFlags).spawn resume/spawn sweep resumeof a foreground sweep runs the same step before relaunching, with the idle period recorded in the checkpoint (SweepMemberRecord.EgressProxyIdle).SPAWN_BOOTSTRAP_EGRESSand the config default. It applies to every sweep without--no-detach, since a sweep is detached by default. The message names Managed egress proxy for --no-public-ip bootstraps (no NAT gateway, no mirrors) #1515 and--no-detach. All of it is one function,refuseDetachedSweepEgressProxy, with three call sites for PR B to delete:runLaunch, the dispatch backstop inlaunchParameterSweep, anddetachedSettingsGuard.spawn schedule createtakes neither--no-public-ipnor the opt-in.Refactor of the single path
ensureEgressProxyis split intoegressProxyNeed(the cached preflight),findOrCreateEgressProxy(region, network, idle), andegressProxyFor.attachand.report. The single, job-array and MPI paths call them in the same order with the same messages, and the existing tests pass unchanged. A new seam,egressProxyTerminate, wrapsdeploy.Terminate.Fix found on the way
The foreground sweep's
--no-public-ipcheck ran before AMI and OS detection. Every member without anami:therefore counted as "image not named yet, may have no aws CLI", and Windows members were checked as Linux. It now runs after them, as on a single launch. The existing order gate still holds: afterresolveSweepEFA, before EFA subnets and the SSH key.IAM
spawn resumeandspawn sweep resumegainec2:CreateSecurityGroup,DescribeSecurityGroups,Authorize/RevokeSecurityGroupIngress/Egress.spawn launchalready calls all of them, so no CLI user needs a new action.docs/reference/cli-iam-actions.mdis regenerated. The cross-account role is untouched (that's PR B).Tests (hermetic)
In
cmd/launch_sweep_egress_proxy_test.go:runLaunch --param-file --no-detach: one FindOrCreate with--egress-proxy-idle, zero RunInstances on failure (withLogDir);--detachand with the default, and with zero AWS calls;The disposition and coverage tables are updated: foreground
BootstrapEgressis now direct,EgressProxyAddris user data.Revert gates: each of the following was reverted and made its test(s) fail. Removing the ensure call, grouping regardless of VPC, removing the teardown, tearing down reused proxies, removing the runLaunch refusal, treating every opted-in member as needing a proxy, removing the detached guard.
Checks:
make check, hermeticgo test ./...,go test -tags e2e_tier0 ./test/e2e/,semgrep scan --config=auto --error .,make gen-docs,make api-snapshot(no change),make cli-iam-actions.