-
Notifications
You must be signed in to change notification settings - Fork 95
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
Consolidate the RuntimeContext API to use one EntryPoint and expose Source for WASI files #398
Conversation
The wasmedge error looks like something with k3s, going to re-trigger
|
Signed-off-by: James Sturtevant <[email protected]>
3a96d65
to
8878701
Compare
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.
Thanks for working on this! :-)
I'm not sure how I feel about WasiLoadingStrategy
. I personally would make it part of the entrypoint.
Something like:
pub struct Entrypoint<'a> {
// The entrypoint function in the wasm module.
// Usualy "_start".
pub func: String,
// A name that can be used to identify the module.
// Usualy the name of the wasm file.
pub name: Option<String>,
// The raw arg0 provived in the OCI spec.
pub arg0: Option<&'a Path>,
// The source for the WASI module / components
pub srouce: WasiSource<'a>,
}
// The source for a WASI module / components.
pub enum WasiSource<'a> {
// The WASI module is a file in the file system.
// This case is only valid with WASI preview1 modules.
File(PathBuf),
// The WASI module / component is provided in the OCI spec.
// For a WASI preview 1 module this is usually a single element array.
// For a WASI preview 2 component this is an array of one or more
// elements, where each element is a component.
// Runtimes can additionally provide a list of layer types they support,
// and they will be included in this array, e.g., a `toml` file with the
// runtime configuration.
Oci(&'a [WasmLayer]),
}
nice! I was struggling with the entrypoint vs loading strategy but hadn't figured it out yet. They shared similar data and logic, I believe your suggestion resolves the dissonance I was feeling. Will give this a go |
ddb6ce3
to
f68f7d7
Compare
Signed-off-by: James Sturtevant <[email protected]>
f68f7d7
to
1f5d6f3
Compare
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.
Awesome! Thanks @jsturtevant !
Just two minor nits, and I'm happy for this to be merged :-)
20258bd
to
bdd8aea
Compare
Signed-off-by: James Sturtevant <[email protected]>
bdd8aea
to
7244408
Compare
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.
Thanks, lgtm!
This PR makes a few changes to the the
RuntimeContext
API regarding OCI:entrypoint
vswasiEntrypoint
and thought this might simplify it. Feedback welcome.