Repository navigation
feat(launch): --no-public-ip, private-only launches with a subnet endpoint pre-flight (#1433) - #1438
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes #1433
Adds
spawn launch --no-public-ip, opt-in and off by default. Without it nothing changes.What it does
AllocateAddressorAssociateAddress, and so no Elastic IP to release. No interface asks for a public IP: a single interface sendsAssociatePublicIpAddress=falseexplicitly, because a default subnet would otherwise assign one. A multi-card layout sends noAssociatePublicIpAddressat all, since EC2 accepts none with more than one interface.--subnet-id, or--az; with--azspawn picks a subnet and pins it. A job array or MPI cohort then launches every member in the subnet that was checked, with no AZ fallback into subnets nobody checked.DescribeSubnets,DescribeRouteTablesandDescribeVpcEndpoints, cached per subnet. It passes if the subnet's route table has a NAT gateway route. Otherwise it needs all of:ec2,ssm,ssmmessagesandec2messages.dynamodbfor aspawn burstmember,fsxwith--fsx-create. These need a NAT route: webhooks, Slack notifications, the Windows bootstrap's AWS CLI download, and the MPI bootstrap's EFA installer.available. One with no subnet in the instance's AZ counts, with a warning. A gateway endpoint on another route table does not count.--allow-missing-endpointslaunches anyway and still prints the list.Client.Launch's own check. That covers single launches, job arrays, MPI,spawn array retry(the persisted base config), foreground sweeps andspawn sweep resume(each member checked, and the sweep resume still drops every CLI flag other than IAM and lifetime (--pre-stop, --tag/--team, network, storage) #1400 member record carries the field), andlauncher.Provision, which refuses a launch with no subnet or AZ before any AWS call.Public IP: none (private only), with no Elastic IP line.spawn connectprints a note that it uses SSM Session Manager when the instance has no public IP, and that--sshneeds one.The endpoint list and how it is derived
aws.PrivateServices()(pkg/aws/private_network.go) is held to spored's code byTestPrivateServicesCoverEverySporedService(internal/iamcoverage). That test reuses the RTA/VTA call-graph inventory of every spored principal: the daemon plus pool-worker, pipeline-stage, provenance and run-queue. Every IAM service prefix reached must be served by an entry, and every entry's prefix must still be reached. Today the inventory reachesec2,s3,dynamodb(burst peer registry),fsx(async FSx),sqs(pool worker),xray(refused at launch, #1335) andlambda(InvokeFunctionUrlfor DNS, which no VPC endpoint serves).ssm,ssmmessagesandec2messagesare the SSM agent's services, not spored's. spored makes no STS call: the plan expected one, and the call graph has none.Refused combinations
--dns,--dns-domain,--dns-api-endpointand--dns-function-arn: spored registers the public IP, and there is none. The record--nameimplies is skipped with a notice instead.--wait-for-ssh.--allow-missing-endpointswithout--no-public-ip.--subnet-idnor--az.--no-detach. Follow-up: sweep: carry --no-public-ip on a detached sweep (subnet check at --detach, LaunchSettings field) #1437.--batch-queue/--queue-templateand the wizard: neither reads the launch flags, so the flag would have been dropped silently.spawn task runhas no field for it; a gate fails ifTaskSpecgains one.Deviation from the brief
An S3 interface endpoint does not satisfy
s3. The bootstrap fetches spored fromhttps://spawn-binaries-<region>.s3.amazonaws.com, a global-style name that S3 interface-endpoint private DNS does not serve, so counting it would pass a VPC where spored never installs. Follow-up #1436 switches the bootstrap to the regional name.IAM
ec2:DescribeRouteTablesandec2:DescribeVpcEndpoints(read-only). The regenerateddocs/reference/cli-iam-actions.mdlists them under every command that reachesClient.Launch. That over-approximates: only--no-public-iplaunches call them.Owner test recipe: c8gn.48xlarge, us-east-1 default VPC
To also see a refusal, run the same dry-run in us-west-2: the default VPC there has no endpoints, so expect the refusal listing s3, ec2, ssm, ssmmessages and ec2messages.
Checks
make check,make lint(0 issues),semgrep scan --config=auto --error(exit 0),make api-snapshot(additions only),make cli-iam-actions, andmake gen-docs+check-docs. Every new gate was watched failing against a revert that compiles (list in the agent report).