-
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's libcontainer APIs to implement wasmtime shim. #142
Conversation
Since youki now uses thiserror instead of anyhow, this PR also updates the containerd-shim-wasmedge to properly map the error. Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
- Implement Executor trait for wasmtime executor. - Use libcontainer's lifecycle APIs to implement runwasi's Instance trait. Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
@Mossaka Do you want me to review this PR? |
I would appreciate your feedback once this PR is ready to review :) |
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
The purpose of this crate is to provide common helper functionalities to shim implementors that use youki's libcontainer crate. Notice that the "containerd-shim-wasm" crate does not depend on libcontainer. This commit refactors shared implementation from the wasmtime and wasmedge shims to the newly created common crate. Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
This PR is ready to review for now. The Error: Any(failed to receive. "waiting for init ready". BrokenChannel
Caused by:
channel connection broken) |
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.
Looks great, I am looking with an eye towards how this would work when Windows is added and I think this actually makes a few things easier. The awkward part might be re-using the WasmtimeExecutor
directly vs via a youki Container
since Windows isn't supported in youki but I think it will work.
Ok(_) => 0, | ||
Err(e) => { | ||
if e == Errno::ECHILD { | ||
0 |
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.
I assume this code came from my code, but it has to plant the log in this case.
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.
Could you elaborate more about "plant the log"? Do you want me to log a message when Errno::ECHILD
was returned?
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.
when Errno::ECHILD was returned?
Yes 👍
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.
I have added a log messaging saying "no child process" when Errno::ECHILD
was returned in both the shims.
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.
I am not entirely sure when people see this log message, that actions they can do to mitigate. Or is this an issue at all in the first place? I would appreciate if anyone can help me to understand it.
Co-authored-by: Toru Komatsu <k0ma@utam0k.jp> Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
All the tests are passing 🥳 |
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, Joe – just some small comments here and there.
…hims Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Co-authored-by: Dan Chiarlone <danilochiarlone@gmail.com> Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
…nto wasmtime-youki
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
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
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
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.
Looks good to me, but This PR introduces a big change, so I recommend getting one more approval.
Thanks everyone for reviewing!! 🥂🙌 |
trait.
PTAL @utam0k
TODO