-
Notifications
You must be signed in to change notification settings - Fork 9
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
Wasmedge #192
Merged
Merged
Wasmedge #192
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vasilvas99
force-pushed
the
wasmedge
branch
from
September 13, 2023 12:31
e88b1e4
to
bfc19c4
Compare
stlachev
approved these changes
Oct 31, 2023
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WASM-based containers in Leda
General
WASM+WASI allows to develop for an abstract machine (WASM) with an abstract system interface (WASI ~ POSIX), compile once and deploy on any architecture/machine that has the appropriate WASM/WASI runtime.
WASMEdge is one such runtime that is lightweight, while supporting wasi-preview1 + some of the extensions provided by wasi-preview2 (e.g. sockets, threads).
Preview2-features are not stable yet (and officially supported by the compiler vendors such as clang, rustc, etc) so they require a lot of library patching/ad hoc solutions.
Therefore, developers are encouraged to limit themselves to WASI-preview1.
Implementation
clang-layer
io.containerd.runc.v2
APIRequirements
You now should include meta-clang, since wasm runtimes/compilers generally emit LLVM IR, which is then compiled by the system-specific LLVM to native code. If you use kas, add:
ref: https://github.com/eclipse-leda/leda-distro/compare/main...SoftwareDefinedVehicle:leda-distro-fork:wasmedge?expand=1
Test setup
This PR was tested by building from the
wasmedge
branch of https://github.com/SoftwareDefinedVehicle/leda-distro-forkTests
Builds created with this PR should be able to run the container examples from the wasmedge website:
https://wasmedge.org/docs/develop/deploy/cri-runtime/containerd-crun/
The quick-test example you can use to verify everything is correct is to run the "rng generator container" with.
Issues
CRUN depends on the top-level runtime providing the
module.wasm.image/variant=compat-smart
"magic" label for the container to distinguish WASM from "normal"/native containers. This is implemented as annotations in k8s.Kanto Container Management however, does not seem to implement the labels part of the OCI spec (see The containers.proto file for containerd which requires the labels map to be handled specially by the top-level run-time). My assumption is that since "all" labels should be included in update calls and Kanto does not implement labels as part of its interface, they are never passed to containerd even if they were added in the dockerfile/manually with ctr after the image was pulled.
This limits the applicability of WASM containers in our case.