-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refactored executor and executor manager #2186
Conversation
Refactored the executor and executor manager to be clone-able and more ergonomics. Removed the use of executor manager with a vector of executor. Instead we favor composing executors into a new executor. Composing also allows the implementer to be precise about the execution orders. The old executor manager with its vector implementation is not explicit enough about the order when multiple executor is involved. Re-implement the executor to be a function pointer instead of the Fn family traits. Traits will type erase and difficult to deal with when implementing clone. Refactored the wasm related exectors to use the new scheme. Signed-off-by: yihuaf <yihuaf@unkies.org>
I will be responsible for fixing any breakage with runwasi if required. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2186 +/- ##
==========================================
+ Coverage 64.91% 64.97% +0.06%
==========================================
Files 129 129
Lines 14985 14970 -15
==========================================
Hits 9727 9727
+ Misses 5258 5243 -15 |
|
||
impl Executor for DefaultExecutor { | ||
fn exec(&self, spec: &Spec) -> Result<(), ExecutorError> { | ||
pub fn get_executor() -> Executor { |
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.
May I ask you to add a comment to this function?
Can you add Developer Documentation on this so we can use another PR or just create an issue? |
Signed-off-by: yihuaf <yihuaf@unkies.org>
Signed-off-by: yihuaf <yihuaf@unkies.org>
I added a section in the libcontainer.md. I don't think there is any previous mentions of executor. Let me know if this is good enough for now. |
Can you post an example of how to use it, just another PR? |
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.
Thansks!
Refactored the executor and executor manager to be clone-able and more ergonomics.
Removed the use of executor manager with a vector of executor. Instead we favor composing executors into a new executor. Composing also allows the implementer to be precise about the execution orders. The old executor manager with its vector implementation is not explicit enough about the order when multiple executor is involved.
Re-implement the executor to be a function pointer instead of the Fn family traits. Traits will type erase and difficult to deal with when implementing clone.
Refactored the wasm related exectors to use the new scheme.