Open absynthe opened 1 year ago
Just ran into the exact issue today. Any ideas on how to solve this?
So far I did not find a fix. For now I am using the default name and just putting the different containers in different image tags.
Found the issue @absynthe, at least in my case.
Check the IAM permissions for the CodeBuild execution. In my case, repo names must start with sagemaker
in their names to be pushed. The IAM policy should look like this, and this could be the reason why images are not being pushed.
{
"Effect": "Allow",
"Action": [
"ecr:CreateRepository",
"ecr:BatchGetImage",
"ecr:CompleteLayerUpload",
"ecr:DescribeImages",
"ecr:DescribeRepositories",
"ecr:UploadLayerPart",
"ecr:ListImages",
"ecr:InitiateLayerUpload",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage"
],
"Resource": "arn:aws:ecr:*:*:repository/sagemaker*"
}
Ah, so it's a feature not a bug. Then it should either be documented or the permissions have to be opened up :D
Found the issue @absynthe, at least in my case.
Check the IAM permissions for the CodeBuild execution. In my case, repo names must start with
sagemaker
in their names to be pushed. The IAM policy should look like this, and this could be the reason why images are not being pushed.{ "Effect": "Allow", "Action": [ "ecr:CreateRepository", "ecr:BatchGetImage", "ecr:CompleteLayerUpload", "ecr:DescribeImages", "ecr:DescribeRepositories", "ecr:UploadLayerPart", "ecr:ListImages", "ecr:InitiateLayerUpload", "ecr:BatchCheckLayerAvailability", "ecr:PutImage" ], "Resource": "arn:aws:ecr:*:*:repository/sagemaker*" }
Thank you!. I was struggling with issue. Just updated the repo name in the policy and issue resolved.
Building a container with the default naming works, but using a custom name leads to time out when the repository flag is used. The repository will be created, but a new version will not be pushed.
Steps to reproduce:
sm-docker build . --role YOUR_ROLE --repository CUSTOM_NAME:VERSION
You will get a log similar to the below: