You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wagi --env is good for global env vars for all modules, but for some cases, I need to inject some secret vars for a Wasm module only, not for all modules. I found the example from https://github.com/deislabs/wagi-examples/tree/main/env_wagi
[[module]]
# Mount this to example.com/envroute = "/env"# Point to the directory that 'cargo build' wrote the WASM filemodule = "/path/to/env_wagi/target/wasm32-wasi/release/env_wagi.wasm"# Mount the source code of this repovolumes = { "/" = "/path/to/env_wagi" }
# Set an environment variableenvironment.TEST_NAME = "test value"
But it does not work on 0.3.0, any clue?
pubstructModule{/// The route, begining with a leading slash.////// The suffix "/..." means "this route and all sub-paths". For example, the route/// "/foo/..." will match "/foo" as well as "/foo/bar" and "/foo/bar/baz"pubroute:String,/// The path to the module that will be loaded.////// This should be an absolute path. It must point to a WASM+WASI 32-bit program/// with the read bit set.pubmodule:String,/// Directories on the local filesystem that can be opened by this module/// The key (left value) is the name of the directory INSIDE the WASM. The value is/// the location OUTSIDE the WASM. Two inside locations can map to the same outside/// location.pubvolumes:Option<HashMap<String,String>>,/// The name of the function that is the entrypoint for executing the module./// The default is `_start`.pubentrypoint:Option<String>,/// The URL fragment for the bindle server.////// If none is supplied, then http://localhost:8080/v1 is usedpubbindle_server:Option<String>,/// List of hosts that the guest module is allowed to make HTTP requests to./// If none or an empty vector is supplied, the guest module cannot send/// requests to any server.puballowed_hosts:Option<Vec<String>>,/// Max http concurrency that the guest module configures for the HTTP/// client. If none, the guest module uses the default concurrency provided/// by the WASM HTTP client module.pubhttp_max_concurrency:Option<u32>,}
The text was updated successfully, but these errors were encountered:
We did intentionally remove support for per-module env vars pending a redesign of how we handle environment variables with the new Bindle support.
The intent is to make bindles the default method of loading modules into Wagi (though we are still planning on supporting modules.toml). But since the bindle is created by the dev team (rather than the ops team), we do not think that we should but the environment variables inside of the bindle.
I think what we need to figure out is how we can pass env vars from the CLI to specific modules. We are still pretty open to coming up with other solutions, though.
In the meantime, I will look to see whether we can simply re-enable the old env var code until we come up with a better way.
wagi --env
is good for global env vars for all modules, but for some cases, I need to inject some secret vars for a Wasm module only, not for all modules. I found the example from https://github.com/deislabs/wagi-examples/tree/main/env_wagiBut it does not work on 0.3.0, any clue?
The text was updated successfully, but these errors were encountered: