-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use youki libcontainer crate for all shims #131
Comments
I'd be happy to work on this |
I did try to use libcontainer functions for adding support for OCI devices and seccomp. The seccomp code is at https://github.com/ipuustin/runwasi/commits/seccomp and the devices code is here: https://github.com/ipuustin/runwasi/commits/oci-devices. My finding was that libcontainer can very well be used on this level, but it is a lot of effort and will bring a lot of duplicated code to runwasi. I mean, the seccomp code I needed to add in the seccomp branch alone is hundreds of lines of code, a lot of it However, what would make sense IMHO would be to go through the libcontainer initialization code and figure out what exactly is needed for running Wasm/WASI modules securely. For example, do we really need a PID namespace if the Wasm module will not even have the concept of a process? Or does it make sense to have the Masked Paths OCI feature, if we anyway control precisely which files are available? If the result of this study is that the optimal Wasm initialization path is a lot different from traditional container initialization, we might want to contribute to libcontainer a different way for loading the container, or maybe just do it using the lower-level primitives as you suggest. I'm myself curious to what we could do in runwasi shared mode using just threads for running the Wasm VMs -- would we get anywhere close to a working "container"? |
@ipuustin looking briefly at your code for seccomp I don't understand completely why you need to duplicate the code for each shim, can't we add this one level up the stack, in |
Most of the seccomp code is in containerd-shim-wasm (see ipuustin@78c3c4d). It's just being called from the WasmEdge and Wasmtime shims. The reason there needs to be some code in shims is that the open FD for seccomp notification needs to be passed over socket to main process and then to the external notifier process. |
The main thing here is we are using linux containerization as an extra boundary, plus it also helps wasm play nicely with other linux containers/processes.
Primarily we can't use memory cgroups with threads. |
I have implemented the integration with Implement the
|
Tha ks for the analysis, it's very useful. I'm all in for moving as much as possible into Do you know if there is any incompatibility between the way |
…nce trait This commits adds a new YoukiInstance trait in the containerd-shim-wasm crate. It refactors the common youki Instance implementation into this trait and as a consequence, all the Instance implementation from both the wasmtime and wasmedge shims moved to a common place. This closes containerd#131 Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
The work in #78 enabled
youki
'slibcontainer
for the WasmEdge shim.The Issue #110 intents to repeat the same work for the wasmtime shim.
During #78, @rumpl 's comment mentioned that we could enable
youki
'slibcontainer
in a lower level inrunwasi
, so that all shims can benefit from it.Any thoughts?
The text was updated successfully, but these errors were encountered: