-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicit cache does not work with AWS ECR due to wrong manifest mediatype #3714
Comments
Well, now documentation says that AWS ECR supports explicit cache I'm still receiving same Documentation was changed at #3814, with a reference to https://aws.amazon.com/blogs/containers/announcing-remote-cache-support-in-amazon-ecr-for-buildkit-clients/
cc @tontinton @alexcb from documentation PR: did you check that it actually works? And, if so, can you help me to debug this? |
We recently had a PR submitted (and merged) for this: #3869 it hasn't been released yet, but you could give it a try using our pre-release binaries from https://github.com/earthly/earthly-staging/releases/tag/v0.1710273402.818533702 |
Thanks for quick response!
On this version I'm still checking if it works fine with complex builds, but at least mediatype issue looks resolved. Looking forward to release with fixes |
awesome! thanks for confirming that worked once you added in the extra attributes. We'll likely get a new release out next week. |
What went wrong?
When I try to run earthly with
--remote-cache
pointing to ECR and--push
it fails on the very last step after pushing all blobs withError: error writing manifest blob: failed commit on ref "sha256:823...540": unexpected status from PUT request to https://123.dkr.ecr.eu-central-1.amazonaws.com/v2/build-cache/manifests/explicit-cache-test: 400 Bad Request
To reproduce:
Login to ECR, create private registry and run something like
earthly --remote-cache=123.dkr.ecr.eu-central-1.amazonaws.com/build-cache:foo-explicit-cache --push +foo
(use your ECR id, region and repository name).What should have happened?
Since support for cache manifest is already implemented in ECR (according to aws/containers-roadmap#876, ticket remains opened just for discussion), I expected this to work out-of-box.
Looking closely to said ticket, it seems that ECR would accept only
application/vnd.oci.image.manifest.v1+json
as a manifest mediatype, while BuildKit (and, transitively, earthly) useapplication/vnd.oci.image.index.v1+json
by default.I tried building v0.7.23 from source with this patch on builder/solver.go, and ECR happily accepted push.
I'm not sure that this solution is a proper way to go, maybe other registry implementations would not like it that way.
I did not find a way to work around this without rebuilding earhtly client executable.
Logs from buildkitd and command output were not very helpful, all basically saying the same,
400 Bad Request
without firther explanation. Maybe that's on ECR, did not check all the way here.The text was updated successfully, but these errors were encountered: