Repository navigation
fix(ami): resolve instance arch from EC2, not a Graviton allow-list (#410) - #411
Merged
Merged
Conversation
…410) A plain 'spawn launch' on m9g.24xlarge (Graviton5) picked an x86_64 AMI and failed with 'architecture arm64 does not match x86_64', because DetectArchitecture recognized arm64 only from a hardcoded set of Graviton family prefixes — and m9g (a 2026 family) wasn't in it, so it fell through to the x86_64 default. Same class as the #384 GPU allow-list bug. GetRecommendedAMI (the single-launch auto-AMI path) now resolves arch authoritatively via DescribeInstanceTypes → ProcessorInfo.SupportedArchitectures (new resolveArchitecture, mirroring ValidateInstanceTypeForNestedVirtualization), so any new arm64 family works with no code change. Falls back to the static allow-list when the API is unavailable; that list also gained the current next-gen families (m9g/r9g/c9g/hpc7g/i8g/…) as a belt-and-suspenders default. Extracted instanceFamily; the pure DetectArchitecture stays for the no-client call sites (wizard, sweep grouping key). Closes #410
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.
Summary
Fixes #410 — a plain
spawn launchonm9g.24xlarge(Graviton5) picked an x86_64 AMI for an arm64 instance and failed immediately:Root cause
DetectArchitecture(pkg/aws/ami.go) recognized arm64 only from a hardcoded allow-list of Graviton family prefixes.m9g(a 2026 family) wasn't in it → fell through to thex86_64default. Same class of bug as #384 (the GPU allow-list). Older families (c6g/c7g/c8g) launched fine because they were listed.Fix
GetRecommendedAMI(the single-launch auto-AMI path, already has ctx+region+client) now resolves arch authoritatively from EC2:DescribeInstanceTypes → ProcessorInfo.SupportedArchitectures(newresolveArchitecture, mirroring the existingValidateInstanceTypeForNestedVirtualizationpattern). Any new arm64 family works with no code change.DetectArchitectureallow-list when the API is unavailable (offline/throttled/unknown type) — preserves today's behavior.m9g/r9g/c9g/m8gd/c8gn/hpc7g/i8g/…) as a belt-and-suspenders default.instanceFamily; pureDetectArchitecturestays for the no-client call sites (wizard, sweep grouping key, create-ami).Testing
DetectArchitecturetable extended with the Single-launch auto-AMI picks x86_64 for m9g (Graviton5) — unknown arm64 families not detected as arm64 #410 regression cases (m9g/r9g/c9g/hpc7g/i8g → arm64); newinstanceFamilytest.resolveArchitectureitself needs EC2, so it's covered by the gated smoke test below, not a unit test.go test ./pkg/aws/,go vet, gofmt clean; no docs drift; Semgrep clean.--ami), confirm it resolves an arm64 AL2023 AMI and boots, then terminate + leak-check. I'll verify the exact arm64 family available and propose the spec for approval before any billable launch.Closes #410