Repository navigation
fix(iam): grant spored role ECR pull so app launch can pull its image (#588) - #589
Merged
Merged
Conversation
… image (#588) sporedDCVRolePolicy granted no ECR actions, so docker login succeeded (account-wide GetAuthorizationToken) but the image pull was denied (ecr:BatchGetImage), the container never ran, and the DCV session --init failed → ready-url timeout. Add read-only ECR pull (GetAuthorizationToken, BatchCheckLayerAvailability, GetDownloadUrlForLayer, BatchGetImage) on Resource:*; cross-account pulls stay gated by the target repo policy. Regression-guarded in TestSporedDCVRolePolicy_Valid. Found by the #286/#389 real-GPU validation run. Fixes #588.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 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.
Fixes #588. Found by the #286/#389 real-GPU validation run.
Problem
spawn app launch <container-app>provisionsspored-instance-rolewithsporedDCVRolePolicy, which granted no ECR actions.docker loginsucceeded (some other policy on the shared role granted account-wideecr:GetAuthorizationToken), but the pull was denied:→ container never starts → DCV session
--initfails → nospawn:ready-url→ launch times out. The #290 container-catalog path was unusable for any image out of the box; it only appeared to work earlier because the shared 942 role had accumulated demo-specific ECR policies.Fix
Add a read-only ECR-pull statement to
sporedDCVRolePolicy(pkg/aws/iam.go):{ "Effect": "Allow", "Action": ["ecr:GetAuthorizationToken","ecr:BatchCheckLayerAvailability","ecr:GetDownloadUrlForLayer","ecr:BatchGetImage"], "Resource": "*" }GetAuthorizationTokenrequiresResource:"*"; the pull actions are read-only and cross-account pulls stay gated by the target repo's own policy, so this doesn't over-grant.SetupSporedIAMRolerewrites the inline policy on every launch, so it takes effect on the next launch with no migration.Tests
TestSporedDCVRolePolicy_Validextended to requireecr:GetAuthorizationToken+ecr:BatchGetImage(regression guard).Validation context
The real-GPU run (g5.xlarge, 942/us-east-1, i-0b46e604b61dc9563, terminated + leak-checked clean) confirmed the #286/#389 change works end to end — DLAMI resolved via SSM, Amazon DCV 2025.0 installed at boot, dcvserver + spored + TLS cert + NVIDIA A10G driver all up,
dcv create-sessioninvoked — with this ECR gap the only remaining failure. A short follow-up validation run after this merges should showreadywith a live session.