Skip to content
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

wasm: add api for configuring environment variable in VmConfig #15136

Merged
merged 31 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c389247
Add environment_variables field in VmConfig
mathetake Feb 22, 2021
2077a4e
review: fix typo
mathetake Feb 24, 2021
fda8ed6
Review: add warning and fix style
mathetake Feb 25, 2021
8bab14a
Merge remote-tracking branch 'origin/main' into wasm-env-api
mathetake Feb 25, 2021
194471b
Write test
mathetake Feb 25, 2021
1fec667
Merge remote-tracking branch 'origin/main' into wasm-env-api
mathetake Mar 3, 2021
dd00186
Fix test and setenv for NullVm consistency
mathetake Mar 3, 2021
065cbe8
Delete the debug code
mathetake Mar 3, 2021
851bd2e
Fix testname
mathetake Mar 3, 2021
0306a2f
Fix testcase
mathetake Mar 3, 2021
8b602a2
Fix test names
mathetake Mar 3, 2021
cb9b1df
Remove unnecessary changes
mathetake Mar 3, 2021
8fa9a02
Fix format & add test
mathetake Mar 3, 2021
dd9568c
Fix Windows build
mathetake Mar 3, 2021
d1eb946
Fix Windows build: part2
mathetake Mar 3, 2021
e8795f5
review: ignore NullVm, check keys regardless of existence
mathetake Mar 3, 2021
824f0e7
Remove unnecessary changes
mathetake Mar 3, 2021
a917095
Reject NullVm with env vars
mathetake Mar 4, 2021
5c1f0f0
Check NullVm first
mathetake Mar 4, 2021
fc931d4
Review: env check in integration test, rename accessor.
mathetake Mar 4, 2021
d6268a8
Fix include path.
mathetake Mar 4, 2021
041286f
Fix include path: part 2
mathetake Mar 4, 2021
22ee914
Merge remote-tracking branch 'origin/main' into wasm-env-api
mathetake Mar 4, 2021
2f1e10b
review: split string
mathetake Mar 4, 2021
b4e5d56
Merge remote-tracking branch 'origin/main' into wasm-env-api
mathetake Mar 5, 2021
3ed2309
review: fix styles
mathetake Mar 5, 2021
435f69a
Relax the restriction on NullVm
mathetake Mar 5, 2021
3d6dc03
fix format
mathetake Mar 5, 2021
78ac3f8
fix format: part 2
mathetake Mar 5, 2021
4e4ccf7
review: fix styles
mathetake Mar 6, 2021
84a4f5c
Merge remote-tracking branch 'origin/main' into wasm-env-api
mathetake Mar 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion api/envoy/extensions/wasm/v3/wasm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ message SanitizationConfig {
}

// Configuration for a Wasm VM.
// [#next-free-field: 7]
// [#next-free-field: 8]
message VmConfig {
// An ID which will be used along with a hash of the wasm code (or the name of the registered Null
// VM plugin) to determine which VM will be used for the plugin. All plugins which use the same
Expand Down Expand Up @@ -93,6 +93,21 @@ message VmConfig {
// update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter
// warming state.
bool nack_on_code_cache_miss = 6;

// Specifies environment variables to be injected to this VM which will be available through
// WASI's `environ_get` and `environ_get_sizes` system calls. Note that these functions are mostly implicitly
// called in your language's standard library, so you do not need to call them directly and you can access to env
// vars just like when you do on native platforms.
EnvironmentVariables environment_variables = 7;
}

message EnvironmentVariables {
// The keys of *Envoy's* environment variables exposed to this VM. In other words, if a key exists in Envoy's environment
// variables, then that key-value pair will be injected. Note that if a key does not exist, it will be ignored.
repeated string host_env_keys = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want some notion of env vars elsewhere in xDS as well, so we might want to factor this message to base types. @markdroth thoughts?


// Explicitly given key-value pairs to be injected to this VM in the form of "KEY=VALUE".
map<string, string> key_values = 2;
}

// Base Configuration for Wasm Plugins e.g. filters and services.
Expand Down
17 changes: 16 additions & 1 deletion generated_api_shadow/envoy/extensions/wasm/v3/wasm.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.