youki-dev / youki

A container runtime written in Rust
https://youki-dev.github.io/youki/
Apache License 2.0
6.33k stars 347 forks source link

(Question) The Linux kernel is a requirement, what APIs are used? #2933

Open hardBSDk opened 1 month ago

utam0k commented 1 month ago

We don't have a specific list for this question. How about running youki with bpftrace or ptrace? e.g., https://github.com/containers/youki/blob/main/hack/debug.bt for bpftrace

hardBSDk commented 1 month ago

@utam0k AFAIK Redox supports ptrace or strace, if only Linux system calls are used it can be easily ported.

I'm concerned with kernel interfaces.

utam0k commented 1 month ago

Anyway, we should give it a try and observe the error message. Is there an easy way to run youki on Redox?

hardBSDk commented 1 month ago

@utam0k I created a recipe for it yesterday, I didn't built it yet:

https://gitlab.redox-os.org/redox-os/cookbook/-/blob/master/recipes/wip/containers/youki/recipe.toml

If you want to build/test it use the following command on GNU Bash:

cd cookbook && git pull && cd .. && make r.youki
YJDoc2 commented 1 month ago

Hey @hardBSDk , by nature of containers themselves, cgroups and namespaces with their behavior similar to Linux would also be a requirement. I'm not familiar with redox, does it have similar concepts? I don't think these two come under POSIX, right?

hardBSDk commented 1 month ago

@YJDoc2 Redox support namespaces using capabilities (Contain), like the Capsicum from FreeBSD.

Thus I think the file descriptors are similar to Linux, but it still don't have a cgroups equivalent.