-
Notifications
You must be signed in to change notification settings - Fork 322
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
[ECR]: Allow for alternate mediaTypes #308
Comments
There is also another report in Helm slack seeing a 403 instead:
|
Thanks for the feedback. We're aware of the OCI distribution spec proposal, and we attend the weekly OCI calls to track its progress. We will continue to participate to help drive the distribution spec in a direction that we believe is useful to our customers, and if it addresses their needs we will be happy to adopt it over time. |
+1. Would really like to see both charts and container images in one place. |
Almost a year now. Is it so hard to implement? |
I'm definitely disappointed I can't publish helm charts into ECR at this point. We're going to have to build and maintain additional infrastructure as a result. I hope that AWS can prioritize this (as it doesn't look like a ton of development and is massively beneficial to people that use helm). |
We're starting to look at this with a view to support, and would love to hear if there use cases for more than Helm charts that should publish to ECR, and what problem that would help solve. |
@omieomye This is a good starting point to see the direction OCI is going: https://github.com/containers/image/pulls?q=is%3Apr+mediaType+ CNAB mediaType: application/vnd.docker.distribution.manifest.v2+json, application/vnd.cnab.config.v1+json Another good source is containerd: https://github.com/containerd/containerd/blob/master/images/mediatypes.go The criu/checkpoint/restore ones would be extremely useful. I've run in to a few efforts of using wasm as extensions (envoy proxy filters), with those bundles being stored in oci registries. Example "application/vnd.wasm.content.layer.v1+wasm" from https://radu-matei.com/blog/wasm-to-oci/ |
Shipping Helm & CNAB bundles through the registry, plus future support for WASM packages also are motivating factors for us wanting this too. |
Shipping kudo.dev bundles as artifacts is also on our roadmap. |
This addition will be very appreciated. We have clients with several compliance cases where ECR ticks all the boxes and wouldn't require us to look to validate other tools like ChartMuseum |
We're also looking into using Porter.sh and it would be really great if ECR supports CNAB! |
We've been working on this, and looking to release OCI artifact support soon. |
Alright, following up here on what Bob mentioned in his Container Day keynote earlier today. From now on, you can give this feature a try in ap-southeast-1. For now, focus on Helm charts using something like the following:
We will follow up with more details here and the complete set of supported OCI artifacts in Amazon ECR within a week (give or take), so keep an eye on this issue here to learn more. |
Would be great to see artifacts like npm, maven and binaries are also supported. |
Hello, |
We shipped the feature now: |
Closing. |
Hello, sorry to comment on a closed issue. I've just wanted to know if custom OCI config media types is something supported at the moment on AWS ECR? We are aiming to push custom OCI artifacts to AWS ECR that we can do right now but, only if the default It basically means that it's failing every time we try to push an artifact with a custom mediaType. |
What is the custom config media type you're trying to push? Does it match the spec |
Hello @TBBle ! Yes it does, it's something like:
|
That appears to be complaining about the manifest, not the config? Or at least, assuming your code is derived from or using https://github.com/containerd/containerd/blob/v1.5.5/remotes/handlers.go#L55-L86 or similar, it thinks it's a manifest locally, or has been told that explicitly by My guess is that the failure came from the manifest push, when AWS saw the config media type it didn't like for some reason, rather than the config push. One way to distinguish that would be use use
An OCI registry may include more details in the body of a a 4xx error, but sadly the code implementing stringification of this error doesn't show that. Anyway, at this point I'm wild-ass guessing, and a concrete repro case, e.g., if you can fake up something that has the same problem using containerd and |
Wow thanks @TBBle for the detailed explanation! We are indeed using oras (0.11.1) to push the custom artifacts which is pretty simple, one config file and one layer with random text, also pretty straightforward. I've managed to narrow down the error to the following, taking into account the following snippet: memoryStore := content.NewMemoryStore()
layer := memoryStore.Add("simple-component", "application/vnd.vmware.product.subproduct.layer.v1.octet-stream", []byte("random-text"))
pushContents := []ocispec.Descriptor{layer}
configContent := []byte("{}")
config := ocispec.Descriptor{
MediaType: "application/vnd.vmware.product.subproduct.config.v1+json",
Digest: digest.FromBytes(configContent),
Size: int64(len(configContent)),
}
if _, err := oras.Push(context.Background(), getDockerResolver(), "ref:latest", memoryStore, pushContents, oras.WithConfig(config)); err != nil {
// ... That will work and, which would be the same as adding directly oras.WithConfigMediaType("the-type"), as well. If using the memoryStore to create the descriptor, it will populate an additional field
Adding any annotation to the config seems to fail. Haven't check it with recent versions of oras though. |
Yeah, that's a bug in ORAS. Per the Annotation rules:
So AWS is correctly rejecting that descriptor because it has an annotation which is only allowed to be used with these media types. That said, Oops, reading back, you mentioned that any annotation failed. That's an AWS implementation bug, since Annotation is definitely allowed in a Descriptor. I'm not sure if anyone from AWS is actually looking at this, but now that we can see a definite bug, perhaps it can be raised in a new issue here, or as a support ticket somewhere. |
Tell us about your request
Hello. I'd like to request that ECR allow for arbitrary mediatypes specified in image manifests (config mediaType and layer mediaType).
Alternatively, AWS can keep a public whitelist of mediaTypes allowed in ECR and engage the community to request support for new types.
Which service(s) is this request for?
ECR
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
The OCI distribution spec is currently being stretched to support more than just container images (Helm charts, OPA bundles, etc). In order for us to reason about these things, the
mediaType
field of manifests is being replaced with new custom values.When running an out-of-the-box instance of docker distribution (2.7+), these new mediaTypes are allowed to be pushed.
However, when pushing these things to ECR, the user is met with a
404 Not Found
. Please see oras-project/oras#105 where this issue was first reported.To give more context, a manifest pushed using docker CLI looks like this:
Whereas a manifest pushed by Helm 3 looks like this:
It appears that ECR is whitelisting mediaTypes allowed in the registry.
Are you currently working around this issue?
No. The only current solution (while staying on AWS) is to run a custom instance of docker/distribution on an EC2 or in a container.
Additional context
Interest is growing in this concept and we would love to be able to point users to use the registry tied to their cloud provider (AWS) vs. running a custom registry.
Additionally, Azure Container Registry (ACR) allows for this, and maintains a public list of mediaTypes with first-class support.
Attachments
Here are a few links that have some more info on the topic:
I appreciate your time, thank you!
The text was updated successfully, but these errors were encountered: