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

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Feb 22, 2021

Commit Message: wasm: add api for configuring environment variables in VmConfig. This commit adds an API on VmConfig so that users can configure env vars to be injected to Wasm VMs. Resolves #14958

Signed-off-by: Takeshi Yoneda [email protected]

@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
API shepherd assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #15136 was opened by mathetake.

see: more, trace.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks. @PiotrSikora could you take a first pass from Wasm perspective?

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?

PiotrSikora
PiotrSikora previously approved these changes Feb 23, 2021
Copy link
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

LGTM, with a note that it's not defined what happens if both host_env_keys and key_values define the same key. Should we reject such configurations?

@mathetake
Copy link
Member Author

what happens if both host_env_keys and key_values define the same key. Should we reject such configurations?

Thanks, that's a good point. I think we should reject since that case may cause some unintended behavior in Wasm programs. WDYT?

@PiotrSikora
Copy link
Contributor

Thanks, that's a good point. I think we should reject since that case may cause some unintended behavior in Wasm programs. WDYT?

SGTM.

Signed-off-by: Takeshi Yoneda <[email protected]>
PiotrSikora
PiotrSikora previously approved these changes Feb 24, 2021
@mathetake
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15136 (comment) was created by @mathetake.

see: more, trace.

@mathetake mathetake requested a review from htuch February 24, 2021 12:48
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

API LGTM modulo nits, do you want to add the implementation to this PR?
/wait

@mathetake
Copy link
Member Author

do you want to add the implementation to this PR?

Will do.

@htuch htuch added the waiting label Feb 26, 2021
@mathetake mathetake requested a review from lizan as a code owner March 3, 2021 09:07
@repokitteh-read-only repokitteh-read-only bot added deps Approval required for changes to Envoy's external dependencies and removed waiting labels Mar 3, 2021
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #15136 was synchronize by mathetake.

see: more, trace.

@moderation
Copy link
Contributor

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 5, 2021
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
PiotrSikora
PiotrSikora previously approved these changes Mar 5, 2021
Copy link
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

Thanks! @htuch does this work for you?

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM modulo a few small nits, ready to merge when fixed. Thanks!

@htuch htuch added the waiting label Mar 5, 2021
@repokitteh-read-only repokitteh-read-only bot added deps Approval required for changes to Envoy's external dependencies and removed waiting labels Mar 6, 2021
@mathetake
Copy link
Member Author

@htuch Thanks for the review! PTAL 👍

@PiotrSikora
Copy link
Contributor

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15136 (comment) was created by @PiotrSikora.

see: more, trace.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@repokitteh-read-only repokitteh-read-only bot removed the api label Mar 8, 2021
@htuch
Copy link
Member

htuch commented Mar 8, 2021

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 8, 2021
@htuch htuch merged commit 789f8a0 into envoyproxy:main Mar 8, 2021
@mathetake mathetake deleted the wasm-env-api branch March 16, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasm: expose env variables to Wasm VMs through environ_get WASI interface
5 participants