Skip to content

fix(mpi,efa): mint the MPI cluster key per instance (#1338); --efa-group shared EFA security group (#1168) - #1345

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1338-1168-mpi-efa
Oct 27, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1338-1168-mpi-efa

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Two MPI/EFA launch-setup fixes.

Fixes #1338
Fixes #1168

#1338: a cohort launched from an image of rank 0 reused the parent's root SSH key

#1168: --efa-group NAME for EFA without --mpi

  • The flag. --efa-group NAME (requires --efa) creates or joins spawn-efa-NAME, using the same create-or-get and ensureMPIClusterRules path as the MPI group. The shared helper is createOrGetClusterGroup, which keeps the Nothing reaps managed MPI security groups or placement groups (19 + 9 orphans found); --mpi creates an SG before validating its own flags #685 bare-prefix guard. An existing group gets its rules backfilled.
  • How it joins the launch. It is merged into the launch's groups (an MPI group or --security-group-ids stay). It opens no SSH, so outside reachability is the same as a plain launch on the VPC default group.
  • Dry-run names it.
  • Who deletes it: the TTL reaper's managed-network sweep (lambda/ttl-reaper/netresources.go reapSecurityGroups). It selects on tag:spawn:managed=true and ages groups by spawn:created; the group gets both from LifecycleTags. No reaper code change was needed. A new test checks that the sweep's filter matches the group's tags, that it deletes the group once unused past the 7-day grace, and that it spares the group while it is in use or within the grace.
  • No new IAM: launch already creates security groups.
  • Not done: the optional part of the issue (have --efa-group choose a shared subnet/AZ). The help text tells users to launch in one AZ.

Gates, each watched failing against a revert that compiles (go vet clean)

Revert Failing test
regenerate only when id_rsa is missing (old behaviour) TestMPIClusterKeyIsMintedPerInstanceNotInheritedFromAnImage
no removal of tagged lines same
no removal of the legacy line same (legacy subtest)
ssh-config guard removed same (block count)
install pattern that never matches TestInstallPubKeyCommandReplacesTheClusterKey
reader without the owner check TestReadPubKeyCommandWaitsForThisInstancesKey
tag check disabled TestReadRankZeroPubKeyRefusesAnUntaggedKey
ensureEFAGroup call removed from ensureSecurityGroup TestEnsureSecurityGroupJoinsTheEFAGroupWithoutMPI
SG created without LifecycleTags TestEFAGroupCarriesWhatTheReaperSweepSelectsAndAges
EFA group created without self rules TestEFAGroupAdmitsAllTrafficFromItselfAndIsShared
reaper selects a different tag TestNetSweepReapsAnUnusedEFAGroup
--efa-group accepted without --efa TestValidateEFAGroup, TestBuildLaunchConfig_EFAGroupNeedsEFA

Not verified on AWS: no image of a rank-0 instance has been launched.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.76404% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_efa_group.go 80.76% 5 Missing ⚠️
pkg/aws/securitygroup.go 85.29% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

…ed EFA security group (#1338, #1168)

missing and every authorized_keys write appended, so a cohort launched from
an image of rank 0 reused the parent's private key and kept authorizing the
parent's public key. Rank 0 now mints a key unless an owner file names this
instance; cluster keys carry the spawn-mpi-cohort comment and installs
replace tagged lines; the control plane reads the key only once this
instance minted it; the ssh config block is written once.

group's all-traffic self rules, added to the launch's other groups. Tagged
spawn:managed + spawn:created, so the TTL reaper's managed network sweep
deletes it once unused.

Fixes #1338
Fixes #1168
@scttfrdmn
scttfrdmn force-pushed the fix/1338-1168-mpi-efa branch from d77eb92 to 32864b5 Compare October 27, 2026 00:42
@scttfrdmn
scttfrdmn merged commit a27277c into main Oct 27, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1338-1168-mpi-efa branch October 27, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant