Skip to content

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

Merged
htuch merged 31 commits into
envoyproxy:mainfrom
mathetake:wasm-env-api
Mar 8, 2021
Merged

htuch merged 31 commits into
envoyproxy:mainfrom
mathetake:wasm-env-api

Conversation

@mathetake

@mathetake mathetake commented Feb 22, 2021 •

Copy link
Copy Markdown
Member

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
Copy Markdown

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.

@htuch htuch left a comment

Copy link
Copy Markdown
Member

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?

Comment thread api/envoy/extensions/wasm/v3/wasm.proto Resolved
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
Copy Markdown
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

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

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

@htuch htuch left a comment

Copy link
Copy Markdown
Member

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

Comment thread api/envoy/extensions/wasm/v3/wasm.proto Resolved
Comment thread api/envoy/extensions/wasm/v3/wasm.proto Resolved
@mathetake

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Contributor

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?

@htuch htuch left a comment

Copy link
Copy Markdown
Member

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!

Comment thread source/extensions/common/wasm/plugin.cc Resolved
Comment thread source/extensions/common/wasm/plugin.cc Resolved
Comment thread source/extensions/common/wasm/plugin.cc Resolved
@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
Copy Markdown
Member Author

@htuch Thanks for the review! PTAL 👍

Comment thread source/extensions/common/wasm/plugin.cc Resolved
@PiotrSikora

Copy link
Copy Markdown
Contributor

/retest

@repokitteh-read-only

Copy link
Copy Markdown

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

🐱

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

see: more, trace.

@htuch htuch left a comment

Copy link
Copy Markdown
Member

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

htuch commented Mar 8, 2021

Copy link
Copy Markdown
Member

/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