-
Notifications
You must be signed in to change notification settings - Fork 66
feat(image): add WASM OCI image support #596
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
base: main
Are you sure you want to change the base?
feat(image): add WASM OCI image support #596
Conversation
Add comprehensive support for WebAssembly OCI images, including WASM content layers, configuration blobs, compression, and encryption. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
|
✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6644 |
|
Packit jobs failed. @containers/packit-build please check. |
This updates skopeo dependency of `go.podman.io/image/v5` based on the new changes as of containers/container-libs#596 Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
mtrmac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I can’t see how this could possibly work.
AFAICS the WASM OCI specification doesn’t support compressing layers, so by default I don’t know why we should do so. Is that, at least, a current design discussion in that project?
I feel somewhat similarly about the encryption part, although in there it might be more plausible to just do things without specification… except that the image’s config is not encrypted in the current c/image implementation. Is that really an encryption mechanism to commit to, in this entirely new format?!
As a starting hypothesis, continuing to treat these objects as non-image artifacts should mostly work — sure, without some of the extra features.
| // old image manifests work (docker v2s1 especially). | ||
| func (m *manifestOCI1) OCIConfig(ctx context.Context) (*imgspecv1.Image, error) { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig && m.m.Config.MediaType != internalManifest.WasmConfigMediaType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICS the two objects are not interchangeable and it makes no sense to parse the WASM one as an OCI one.
| // This does not change the state of the original manifestOCI1 object. | ||
| func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, options *types.ManifestUpdateOptions) (*manifestSchema2, error) { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig && m.m.Config.MediaType != internalManifest.WasmConfigMediaType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would that work??!
| // This does not change the state of the original manifestOCI1 object. | ||
| func (m *manifestOCI1) convertToManifestSchema1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { | ||
| if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig && m.m.Config.MediaType != internalManifest.WasmConfigMediaType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
| func (m *OCI1) Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error) { | ||
| if m.Config.MediaType != imgspecv1.MediaTypeImageConfig { | ||
| // We could return at least the layers, but that’s already available in a better format via types.Image.LayerInfos. | ||
| if m.Config.MediaType != imgspecv1.MediaTypeImageConfig && m.Config.MediaType != manifest.WasmConfigMediaType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again
| imgspecv1.MediaTypeImageManifest, | ||
| imgspecv1.MediaTypeLayoutHeader, | ||
| ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc: | ||
| ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is deprecated and has no known users, so I don’t see much point in extending it.
|
Also, for |
Description
This PR adds comprehensive support for WebAssembly (WASM) OCI images to the container-libs image package, enabling WASM container images to be stored, distributed, and managed through the OCI registry ecosystem.
Changes
application/vnd.wasm.content.layer.v1andapplication/vnd.wasm.config.v1+json)Use Case
This change enables users to work with WASM container images using Podman, Buildah, Skopeo, and other tools in the containers ecosystem. WASM images can now be pulled, pushed, inspected, and managed just like traditional container images, integrating seamlessly with the existing crun-wasm runtime support for wasi/wasm platforms.