Skip to content
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

Handle wasm workloads as container images #7492

Open
saschagrunert opened this issue Nov 20, 2023 · 3 comments
Open

Handle wasm workloads as container images #7492

saschagrunert opened this issue Nov 20, 2023 · 3 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@saschagrunert
Copy link
Member

ORAS supports pushing artifacts into OCI registries, which could be used to easily distribute WASM workloads.

A few things have to be considered for that:

  • ORAS per default uses the manifest.config.mediaType of application/vnd.oci.empty.v1+json, which will be treated as error in c/cimage. To avoid that, we have to select application/vnd.oci.image.config.v1+json as media type
  • c/storage can only handle compressed tarballs, which means that the artifact has to be compressed before pushing

This means we can push any file like this:

# Generate a config.json to match the platform
jq --null-input '.architecture = "amd64" | .os = "linux"' > config.json

# Compress the workload
tar cfvz layer.tar run.wasm

# Push the wasm workload
oras push --config config.json:application/vnd.oci.image.config.v1+json localhost:5000/test.wasm:v1 layer.tar

# Pull the image in CRI-O's c/storage
crictl pull localhost:5000/test.wasm:v1

We now can interfere the container creation process either by image naming convention (*.wasm) or by using an additional image annotation. CRI-O can call into the WebAssembly runtime to start the workload other than using the OCI runtime.

cc @mrunalp @sohankunkerkar

@saschagrunert saschagrunert added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 20, 2023
@saschagrunert saschagrunert moved this to To do in Feature Roadmap Nov 20, 2023
@saschagrunert
Copy link
Member Author

Refers to containers/buildah#5091

@jsturtevant
Copy link

The CNCF wg-wasm recently published https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/ would this be something that could be looked at as part of this work?

@saschagrunert
Copy link
Member Author

The CNCF wg-wasm recently published https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/ would this be something that could be looked at as part of this work?

Yeah probably, thank you for the link!

cc @sohankunkerkar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: To do
Development

No branches or pull requests

3 participants