-
Notifications
You must be signed in to change notification settings - Fork 355
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
Options to pass env vars from OCI Spec to WASI Context #2815
Comments
It would be nice for libcontainer to provide an API to the Linux executor -> remains the same |
Expanding |
@Mossaka If you don't mind, I'd like to make this issue a good first issue. |
cc @musaprg |
Hi, I'd love to pick this up. Let me try. |
Sure! |
Wasm containers are different from Linux containers in many ways, one of them being their handling of environment variables. A Wasm runtime, by default, does not grant any environment variables to Wasm modules unless explicitly passed to the WASI Context (e.g., using wasmtime's API). This contrasts with Linux containers, which can utilize all the environment variables available to them.
Given this difference, it seems unnecessary for
libcontainer
to modify the main process's environment variables before fork-exec container processes (as seen here) in Wasm use cases. Moreover, mutating environment variables before callingExecutor::exec
complicates the delineation between the Containerd shim and Wasm containers (see more in this issue fromrunwasi
). The runwasi shim sets up the Wasm runtime (e.g., Spin, Wasmtime, WasmEdge, etc.) within the container namespace, but this setup is not part of the user's Wasm container code. Runwasi introduces a third layer, the Wasm runtime, between the traditional shim and Linux container layers.We propose that container environment variables, such as those from the PodSpec in Kubernetes, should be directly passed to the WASI Context instead of the shim process, which is still configuring the Wasm runtime.
I am not sure how exactly we can achieve this, but I have shared some ideas in this issue. I welcome your thoughts on this matter.
The text was updated successfully, but these errors were encountered: