-
Notifications
You must be signed in to change notification settings - Fork 354
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
Youki builds for custom executors #2428
Comments
@0xE282B0 Thanks for your proposal. |
Hey @utam0k, yes I use it extensively with libcontainer. But in this case I want to compile an OCI compliant runtime like the youki binary but with a spin executor to use it with CRI-O. It could look like #2429. |
I think the libcontainer crate is sufficient. It is easy to imagine that users will probably ask youki crate(lib) for various parameters. It should not be only Executors that the users want to pass as a parameter. |
I know that this change is only for one purpose and I understand that it is not the scope of youki to make OCI runtimes from executors other that the already included. Yes, the libcontainer crate is sufficient to run implementaions of the executor trait. But to call it from CRI-O/Podman I need to reimplement/copy the cli commands of the youki crate or is there a way to import them? |
@Overflow0xFFFF we have liboci-cli crate which would provide the clap impl for oci spec compliant command params for runtime,but you will have to copy over quite a bit of code that is currently in youki binary crate. |
Hey all, I just want to clarify an important point here: what is being described is not a library to build "OCI runtimes" -- that is actually what the current It's important to keep in mind that the runtime-spec only specifies high-level operations which the All that being said, the runc interface is not completely implementation-defined, a (outdated) subset exists at https://github.com/opencontainers/runtime-tools/blob/master/docs/command-line-interface.md for example. Still, I think it needs to be clear that "real" implementations will need more than is in the spec (e.g. to support the new concept of There's certainly value in building binaries which something that knows how to interface with runc can interoperate with, however I think it should made very clear what is being provided and that this is not the runtime CLI (because there is none). TL;DR: I think |
@neersighted Thanks for your comment! At least almost all functions used from containerd are written in the oci runtime spec. The days of runc having original functions are ending. This is an important meaning of youki's existence. It is important to maintain the specification properly, and youki does that well. Youki's contribution in this respect is significant. In fact, I am also a specification maintainer.
Maybe you know, but I tell that the oci runtime spec also defines not only CLI interface but also the behavior of the linux containers,
Sorry but it is hard to rename it because it is used widely.
|
However, the exact interface in code used to invoke these operations is only part of runtime-tools, and even then it's a very reduced subset. Indeed, the runtime spec also encodes elements of the kernel-userspace interface, which has lead to some level of debate as to how "pure" it is and how to interpret certain fields which are influenced by kernel implementation. Would love to pick your brain on some of the above (the "purity" and Linux-isms) at some point, if you have time. |
I am puzzled this is being written here. Shouldn't this properly be discussed in the specifications? What would be your request to youki? I wasn't sure, sorry ... 😭 Can I ask you to be more specific? |
Sorry, it's not directly related to Youki -- it was meant to be an observation of what is part of runtime-spec, and what is not. My real point is that the command line interface is not part of runtime-spec, and I would find a rename (of |
What names do you prefer? |
I'd suggest something like |
Hi, |
TLDR;
I want to use Youki to run containerd-wasm-shims with CRI-O.
Problem description
Youki supports different runtimes using the executor trait. The current runtimes are WasmTime, WasmEdge, Wasmer. These runtimes are also implemented by the
runwasi
project, which makes them available as containerd shims, where the Unix implementation is based onlibcontainer
and also uses the executor trait.There are other shims based on runwasi, and the deislabs/containerd-wasm-shims repo contains shims for slight, spin, wws, and lunatic.
Issue summary
Possible solutions
The easiest solution to run additional runtimes with youki is to copy the executor implementation into the youki crate. But this is not desirable for several reasons, like it would duplicate code and increase maintenance work for the youki crate.
What I'd prefer is to build a specialized version of youki that uses a custom executor. This approach is inspired by how the runwasi shims build their binaries. There the main function is a minimal call to runwasi that configures the shim instance.
Unfortunately, this requires the youki crate to be a library that can be imported into the project where the executor is implemented. To demonstrate how this works, I created a branch based on youki 0.2.0 that converts the youki crate into a lib. In this commit:
Example
With that changes the main function of the youki crate is looking like this:
To test this approach I created a branch in the containerd-wasm-shims repository. The PR c8fe9ffa shows the changes necessary to build the youki-spin binary which is a build of youki with a spin executor. The main function for it looks like this:
Questions
The text was updated successfully, but these errors were encountered: