-
Notifications
You must be signed in to change notification settings - Fork 128
wasmtime: read config from env variable TOML #1105
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,15 +55,19 @@ pub trait Compiler: Sync { | |
| /// | ||
| /// This hash will be used in the following way: | ||
| /// "runwasi.io/precompiled/<Shim::name()>/<cache_key>" | ||
| fn cache_key(&self) -> impl Hash; | ||
| fn cache_key(&self, _envs: &[String]) -> impl Hash; | ||
|
|
||
| /// `compile` passes supported OCI layers to engine for compilation. | ||
| /// This is used to precompile the layers before they are run. | ||
| /// It is called only the first time a module is run and the resulting bytes will be cached in the containerd content store. | ||
| /// The cached, precompiled layers will be reloaded on subsequent runs. | ||
| /// The runtime is expected to return the same number of layers passed in, if the layer cannot be precompiled it should return `None` for that layer. | ||
| /// In some edge cases it is possible that the layers may already be precompiled and None should be returned in this case. | ||
| async fn compile(&self, _layers: &[WasmLayer]) -> Result<Vec<Option<Vec<u8>>>>; | ||
| async fn compile( | ||
| &self, | ||
| _layers: &[WasmLayer], | ||
| _envs: &[String], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was your decision process around adding the configurability to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kinda misunderstood the role of |
||
| ) -> Result<Vec<Option<Vec<u8>>>>; | ||
| } | ||
|
|
||
| /// Like the unstable never type, this type can never be constructed. | ||
|
|
@@ -78,11 +82,15 @@ pub enum NoCompiler {} | |
| pub const NO_COMPILER: Option<NoCompiler> = None; | ||
|
|
||
| impl Compiler for NoCompiler { | ||
| fn cache_key(&self) -> impl Hash { | ||
| fn cache_key(&self, _envs: &[String]) -> impl Hash { | ||
| unreachable!() | ||
| } | ||
|
|
||
| async fn compile(&self, _layers: &[WasmLayer]) -> anyhow::Result<Vec<Option<Vec<u8>>>> { | ||
| async fn compile( | ||
| &self, | ||
| _layers: &[WasmLayer], | ||
| _envs: &[String], | ||
| ) -> anyhow::Result<Vec<Option<Vec<u8>>>> { | ||
| unreachable!() | ||
| } | ||
| } | ||
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 sure we want to pass all container environment variables to compile.