solo-io / wasm

Web Assembly tools and SDKs for extending cloud-native infrastructure
Apache License 2.0
306 stars 40 forks source link

Add a variant of Wasm image spec based on standard media types. #265

Closed mathetake closed 3 years ago

mathetake commented 3 years ago

Description

Following the discussion (led by @dgn) in the Istio Wasm-SIG, this PR added a variant of Wasm image spec for storing Wasm binaries as standard container images.

Notably this new spec leverages the existing standard layers with either one of

media type, not based on the OCI Artifact Spec. This allows users to use standard CLI tools in container ecosystem (such as docker, podman, buildah, etc.) and push to any standard registries without requiring support for arbitrary mediaType (including the one used before).

See #208 and a meeting note by @dgn for the background, and appendix sections here for how end-users would operate to build images.

cc @dgn, @yuval-k @PiotrSikora @bianpengyuan @kyessenov

Signed-off-by: Takeshi Yoneda takeshi@tetrate.io

resolves #208

solo-build-bot[bot] commented 3 years ago

Waiting for approval from someone in the solo-io org to start testing.

dgn commented 3 years ago

hi @mathetake! Thanks for working on this.

I believe there has been a misunderstanding. The idea with the OCI-compliant spec, as agreed on with @yuval-k , was not to replace the existing spec, but to add a variant that would only use OCI-compliant mediaTypes. Clients would then be able to look at the manifest and determine (e.g. from an annotation on the manifest) which variant is being used and parse it accordingly - the main difference being that the OCI-compliant variant uses a tarball to package the files, whereas the existing format uses no compression and custom mediaTypes.

That also means we'll want to keep everything that is already in the spec (e.g. all the envoy-specific configuration) and make it available in both variants. We don't want to break any existing users

mathetake commented 3 years ago

@dgn ah right, thanks for clarifying.. will fix accordingly. Thanks.

mathetake commented 3 years ago

@dgn fixed. PTAL.

mathetake commented 3 years ago

@dgn PTAL again when you are back! 🙇 Here's the fetcher implementation for both docker and oci compat images, which I open a PR in Istio once this lands.

mathetake commented 3 years ago

cc @mandarjog (I forgot to cc you).

mathetake commented 3 years ago

JFYI @lizan

mathetake commented 3 years ago

restructured the spec/ directory and added a general instruction as suggested by @mandarjog. PTAL folks https://github.com/mathetake/wasm/tree/oci-compliant-spec/spec

mathetake commented 3 years ago

and there's already working fetcher implementation in Istio for all variants: https://github.com/istio/istio/compare/master...mathetake:wasm-image-fetch?expand=1

mathetake commented 3 years ago

@dgn @mandarjog PTAL!

mathetake commented 3 years ago

Thanks @dgn, addressed all your comments and changed the implementation accordingly.

@Sodman @mandarjog I believe this is ready to land. I already have the implementation here (https://github.com/istio/istio/compare/master...mathetake:wasm-image-fetch?expand=1) which supports all the variants in Istio. I will open the PR against Istio once this lands.

mathetake commented 3 years ago

fyi I just opened a PR for fetching all the variants in Istio: https://github.com/istio/istio/pull/33812