Repository navigation
fix(mpi): find fi_info on the real EFA layout, and key the ClientToken per launch - #696
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…n per launch but aws-efa-installer puts fi_info in /opt/amazon/efa/bin and its PATH line in its own zippy_efa.sh — while the efa.sh spawn writes sets no PATH at all. So in SSM's non-login shell the probe reported "efa provider missing" until the budget expired, installed or not. This is analogy. The probe now appends both install directories to PATH directly rather than trusting a third party's script name, and globs *efa*.sh. The tests are now executable: they run the probe under SSM's real PATH with a stub binary and assert exit 0, plus the inverse. The old tests proved the check existed, not that it could succeed. job-array NAME. Two launches sharing a name sent the same token per index — IdempotentParameterMismatch when parameters differ, or EC2 returning the ORIGINAL reservation when they match, which can hand back already-terminated instance IDs as a successful launch. Now keyed on the per-launch jobArrayID: stable within a reconcile, distinct across launches, and `array retry` keeps its original token. Also: --estimate-only rendered --ttl 30m as "0 hr". Fixes #693 Fixes #691
The executable probe test trips dangerous-exec-command. Suppressed narrowly: the script comes from enrollProbeScript, a fixed template with no caller input, and executing it is the entire point of the test. Two gotchas recorded in the comment, each of which cost a CI round-trip: the directive is honoured only on the offending line or the one immediately above, and the rule ID must be the FULL id, which ends in a doubled segment. A truncated id is silently ignored. My local pre-push semgrep missed this because semgrep scans only git-tracked files and the new test file was still untracked.
scttfrdmn
force-pushed
the
fix/691-693-mpi-token-efa-path
branch
from
October 4, 2026 23:43
419807a to
da68b7a
Compare
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 #693. Fixes #691. Plus the
0 hrformatter note from #691's tail.Both reports are correct and both were verified in code before fixing. Thank you for running the hardware pass — and for the two confirmations in #691's tail, which are the first independent check on #671/#678/#687 that isn't mine.
#693 — and your diagnosis of my #684 test is the important part
You were right on all of it.
aws-efa-installerputsfi_infoin/opt/amazon/efa/binwith its PATH line in its ownzippy_efa.sh, and theefa.shspawn writes contains only:No PATH. So sourcing it accomplishes nothing for finding
fi_info, and the probe could not succeed whether EFA was installed or not.This is #684 again, and the reason is that I fixed the
mpirunhalf and assumed the EFA half worked by analogy. My own session had the evidence and I did not read it: when I ranfi_pingpongduring the EFA verification, I wroteexport PATH=/opt/amazon/efa/bin:$PATHby hand because it wasn't on PATH. I treated that as a quirk of my ad-hoc command rather than as the same bug.One data point that may interest you: my 2-node
c5n.9xlarge(x86_64)--efacohort did enroll, and a barefi_info -p efaover SSM returned provider output there. So on that instancefi_infowas resolvable whilefi_pingpongwas not. Your repro isc8g.48xlarge(arm64), where you measuredfi_infoas not-on-default-PATH. I can't explain the difference from here and I'm not going to guess — the fix removes the dependency either way.The probe now appends both install directories to PATH directly instead of trusting a profile file:
Sourcing is kept (so
FI_PROVIDERstill applies) and the glob now catcheszippy_efa.sh. But correctness no longer rests on a third party's filename, because a probe keyed on someone else's script name breaks when they rename it. PATH is appended, not replaced — the probe still needs the system directories.And your suggested test is what I built. The tests now execute the generated probe under the exact PATH an SSM shell gets (
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin, nothing inherited) with a stub binary on PATH, and assert exit 0 — plus the inverse, that a genuinely absent tool still fails, so "always exit 0" can't satisfy it. That is the difference between "the check exists" and "the check can succeed", exactly as you put it.#691 — confirmed in code
cohort.NewEntityIntent(mp.name, id, "g1", CohortID(jobArrayID), …, "")with the empty token falls back toToken(cluster, entity, generation), which issha256(name ‖ entity ‖ gen)— sojobArrayIDis the CohortID and never reaches the token, exactly as you traced.Now
memberIdempotencyToken(jobArrayID, id), passed explicitly. I also verified your note about retry:relaunchArrayMemberspassesrec.ArrayIDintoreconcileArrayMembers, so a retried member keeps its first attempt's token and stays idempotent against it rather than racing it.Tests are the three you asked for plus two more: different tokens across launches of the same name, stable within one launch, distinct per index, retry reuses the original, and a gate that the empty-token call cannot come back (confirmed to fail when I restore
"").Case 2 is the one I'd have hated to find in production — a "successful" launch holding terminated instance IDs. I've kept your framing that it's derived from EC2's documented semantics rather than reproduced.
The
0 hrformatterMine, from #662, and a fair catch:
%.0f hrturned--ttl 30minto0 hr. A correct dollar figure next to a zero duration is the worst combination, because "0" is the number a reader trusts. Now:Verified against your exact invocation shape. Whole hours still read
4 hr, not4.0 hr.Not fixed here
Your "also worth a look": the EFA installer sharing the 5-minute
Enrolledbudget with cold boot and SSM registration. I agree it's a real risk and I haven't measured it, because the probe never got far enough to time. It wants its own issue with a measurement rather than a speculative bump — if you have thec8gtimings from a now-passing run, that would settle the number.Gates
gofmt -lempty,go vet ./...,go test -short ./...,make check-docs, changelog gate,semgrep→ 0 findings. Each fix confirmed to fail when reverted. Also ranmake changelog-fix— merging #690 and #692 had left two### Fixedgroups on main.