Repository navigation
Lazy per-AZ placement group: AZ fallback + placement groups together (MPI cohort Stage 3) - #374
Merged
Merged
Conversation
…age 3) A cluster placement group binds to the AZ of its first instance, so the old eager up-front PG creation was incompatible with AZ fallback. The cohort now manages the auto PG lazily and per-AZ: - Actuator: PlacementGroupPrefix → create spawn-mpi-<name>-<az> on demand before launching into that AZ (create-once per AZ via a mutex-guarded set), set it on the launch, and track created names (CreatedPlacementGroups). New PlacementGroupName helper. LaunchAPI gains Create/DeletePlacementGroup. - runLaunch: for --auto-placement-group, stash config.PlacementGroupPrefix instead of eager-creating a single-AZ PG (leaving PlacementGroup empty so fallback stays on). Explicit --placement-group is unchanged (fixed, AZ-bound, single-rung). - launchCohort: pass the prefix to the Actuator; after reconcile, best-effort delete abandoned-AZ PGs (keep only the surviving AZ's). - buildAZChain gate now keys on a FIXED PlacementGroup (not the auto prefix), so auto-PG MPI launches get AZ fallback. - Tests: TestActuator_PerAZPlacementGroup (one PG per visited AZ, create-once, all instances in surviving AZ, both tracked) + TestPlacementGroupName; fake LaunchAPI implements Create/DeletePlacementGroup. Stage 3 of the cohort MPI integration (plan: majestic-enchanting-kernighan).
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.
Stage 3 of the cohort MPI integration — the central correctness point. Makes AZ capacity fallback (Stage 1) coexist with a cluster placement group.
The problem
A cluster placement group binds to the AZ of its first instance. The auto PG was created up front in one AZ (in
runLaunch), which is fundamentally incompatible with the cohort moving to another AZ onInsufficientInstanceCapacity— the pre-bound PG can't follow. That's why Stage 1 gated AZ fallback off whenever a PG was set.The fix — lazy, per-AZ, owned by the Actuator
PlacementGroupPrefixmakes it createspawn-mpi-<name>-<az>on demand as the cohort enters each AZ (create-once per AZ, mutex-guarded; idempotent create tolerates already-exists), set it on that launch, and track the names (CreatedPlacementGroups). A fresh name per AZ sidesteps the sticky-AZ-affinity of reusing one name across drain→advance→relaunch rounds.LaunchAPIgainsCreate/DeletePlacementGroup.runLaunch: for--auto-placement-group, stashconfig.PlacementGroupPrefixinstead of eager-creating a single-AZ PG (leavingPlacementGroupempty so fallback stays on). An explicit--placement-groupis unchanged — fixed, AZ-bound, single-rung (no fallback), since it's user-managed.launchCohort: passes the prefix to the Actuator and, after reconcile, best-effort deletes the PGs for abandoned AZs (keeps only the surviving AZ's; deletes all on failure).buildAZChaingate now keys on a fixedPlacementGroup, so auto-PG MPI launches finally get AZ fallback.Tests
TestActuator_PerAZPlacementGroup— primary AZ exhausted → cohort advances a→b; asserts exactly one PG created per visited AZ (create-once despite 4 members/round), all instances land in the surviving AZ, and both PGs are tracked for cleanup.TestPlacementGroupName— per-AZ naming (distinct AZs → distinct names).LaunchAPIimplements the two new methods.go build ./...,pkg/mpicohort/cmdtests, e2e tier0 (local), gofmt clean. (Pre-existing unrelatedTestCatalogValidfailure, feat(plugin): permissions declaration block (#388) #392, is not from this change.)Depends on Stages 1 & 2 (#371, #373, merged). Next: Stage 4 (SSM control-plane Assembler).