Skip to content

Guarantee SSM on every instance profile (MPI cohort Stage 0) - #370

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/mpi-cohort-stage0-ssm-baseline
Jul 19, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/mpi-cohort-stage0-ssm-baseline

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Stage 0 of the cohort MPI integration (plan: full cohort adoption for MPI/collective launches). Foundational and independently valuable — makes SSM reliable on every spawn'd instance.

Why

The MPI cohort work (upcoming stages) assembles peers and probes readiness over SSM with no on-instance fallback, so SSM must be present on every node. Today it's only best-effort: the default spored role attaches AmazonSSMManagedInstanceCore but swallows failures as a warning (iam.go), and the custom --iam-role path doesn't attach it at all. This also makes spawn connect's SSM fallback reliable everywhere.

Change

  • New ensureSSMManagedPolicy — idempotent AttachRolePolicy of AmazonSSMManagedInstanceCore, returns an error on failure.
  • Default role (SetupSporedIAMRole): attach is now a hard error instead of a logged warning.
  • Custom --iam-role/policy path (CreateOrGetInstanceProfile): attaches SSM core too, for both new and pre-existing roles.
  • Batch-queue's raw --iam-role (used directly as a pre-existing profile name, bypassing role creation) is unchanged — documented in CHANGELOG as the caller's responsibility.

Verification

go build ./..., go vet, gofmt, and pkg/aws tests pass. No new lint findings in changed files (the 36 pre-existing make check staticcheck findings are all in untouched files). IAM SDK paths have no interface seam in this codebase (consistent with existing tests being pure policy-doc logic), so this is covered by the existing build/vet gate + the upcoming Stage 4/5 e2e that exercises SSM end-to-end.

Part of the cohort MPI integration; no behavior change to launches beyond the guaranteed SSM attach.

…tage 0)

spore.host baseline: every spawn-launched instance must be SSM-capable. The MPI
cohort's control-plane peer assembly and readiness probes run over SSM with no
on-instance fallback, and `spawn connect` already relies on it.

- Add ensureSSMManagedPolicy: idempotent AttachRolePolicy of
  AmazonSSMManagedInstanceCore, returning an error on failure.
- Default spored role (SetupSporedIAMRole): the attach is now a hard error
  instead of a logged warning.
- Custom --iam-role path (CreateOrGetInstanceProfile): also attach SSM core, for
  both freshly-created and pre-existing roles.

Batch-queue's raw --iam-role (used as a pre-existing profile name) is unchanged
and documented in the CHANGELOG as the caller's responsibility.

Stage 0 of the cohort MPI integration (plan: majestic-enchanting-kernighan).
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.94118% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/iam.go 52.94% 6 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit cdc1274 into main Jul 19, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/mpi-cohort-stage0-ssm-baseline branch July 19, 2026 00:09
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.

1 participant