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: clarify how configuration is passed #10782

Merged
merged 9 commits into from
Apr 22, 2020

Conversation

kyessenov
Copy link
Contributor

Signed-off-by: Kuat Yessenov kuat@google.com

Description: clarify how configuration is passed
Risk Level:
Testing:
Docs Changes: only
Release Notes:
Fixes #10781

Signed-off-by: Kuat Yessenov <kuat@google.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #10782 was opened by kyessenov.

see: more, trace.

@@ -37,6 +37,8 @@ message VmConfig {
config.core.v3.AsyncDataSource code = 3;

// The Wasm configuration used in initialization of a new VM (proxy_on_start).
// `google.protobuf.Struct` and `google.protobuf.Value` are serialized as JSON before passing them
Copy link
Member

Choose a reason for hiding this comment

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

Please see my comment in #10781

Copy link
Member

Choose a reason for hiding this comment

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

Are there any follow ups here? Do we want to specialize further types or just leave it at this for now?

/wait-any

@mattklein123 mattklein123 self-assigned this Apr 15, 2020
@mattklein123
Copy link
Member

I'm fine with this approach but let's wait for the discussion to finish on the linked issue.

/wait-any

@yskopets
Copy link
Member

I would like to see in the description the finite list of supported types and expected Envoy behaviour in that case.

@kyessenov
Copy link
Contributor Author

@yskopets Value is just a dynamic value in protobuf (see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto). It has a list of options that could be directly serialized as string, number, JSON.

@yskopets
Copy link
Member

Yes, but google.protobuf.StringValue and google.protobuf.BytesValue are not covered by google.protobuf.Value.

Will google.protobuf.StringValue and google.protobuf.BytesValue be supported ?

@yskopets
Copy link
Member

The difference is that google.protobuf.Value requires serialization into JSON before passing that value to a Wasm extension, while a value inside google.protobuf.StringValue and google.protobuf.BytesValue should be passed "as is".

@kyessenov
Copy link
Contributor Author

I see your point about BytesValue. JSON doesn't have an easy way to wrap a byte array, and we don't want to force the use of protobuf for byte arrays. TBH this isn't implemented yet, so we're free to add other wrapper types and customize how they're passed to modules.

Signed-off-by: Kuat Yessenov <kuat@google.com>
mattklein123
mattklein123 previously approved these changes Apr 21, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM but will defer to @htuch @lizan @yskopets to review. Thank you!

yskopets
yskopets previously approved these changes Apr 21, 2020
Copy link
Member

@yskopets yskopets left a comment

Choose a reason for hiding this comment

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

@htuch Should we also keep updating v2 docs?

@@ -36,7 +36,10 @@ message VmConfig {
// The Wasm code that Envoy will execute.
config.core.v3.AsyncDataSource code = 3;

// The Wasm configuration used in initialization of a new VM (proxy_on_start).
// The Wasm configuration used in initialization of a new VM
// (proxy_on_start). `google.protobuf.Struct` is serialized as JSON before
Copy link
Member

Choose a reason for hiding this comment

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

Let's use name proxy_on_vm_start instead of proxy_on_start for consistency with https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we leave the naming for later? It's guaranteed to churn endlessly and will only freeze when the code lands.

Copy link
Member

Choose a reason for hiding this comment

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

Sure

@@ -70,6 +73,9 @@ message PluginConfig {

// Filter/service configuration used to configure or reconfigure a plugin
// (proxy_on_configuration).
Copy link
Member

Choose a reason for hiding this comment

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

Let's use name proxy_on_configure instead of proxy_on_configuration for consistency with https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT

@mattklein123
Copy link
Member

@htuch Should we also keep updating v2 docs?

Yeah good call we should do that, thanks.

@kyessenov
Copy link
Contributor Author

Why do we need to update v2? This is not even implemented, and when it does, they should just use v3.

@mattklein123
Copy link
Member

Why do we need to update v2? This is not even implemented, and when it does, they should just use v3.

I'm fine either way, but generally for fields that exist already in v2 we have been updating the docs there also.

@kyessenov
Copy link
Contributor Author

Should we just delete v2 version then? I think it was desired to ship before v3 split, but now that v3 is separated, there is no need to maintain v2.

@mattklein123
Copy link
Member

Should we just delete v2 version then? I think it was desired to ship before v3 split, but now that v3 is separated, there is no need to maintain v2.

Sure that would be great.

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov kyessenov dismissed stale reviews from yskopets and mattklein123 via 10f7c94 April 21, 2020 23:34
Signed-off-by: Kuat Yessenov <kuat@google.com>
mattklein123
mattklein123 previously approved these changes Apr 22, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

yskopets
yskopets previously approved these changes Apr 22, 2020
@@ -4,5 +4,3 @@ WASM
.. toctree::
:glob:
:maxdepth: 2

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove the entire file then

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, +1, thanks.

/wait

Copy link
Member

Choose a reason for hiding this comment

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

I think this file still needs deleting?

/wait

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 239620e into envoyproxy:master Apr 22, 2020
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 FWIW, I missed this one originally.

spenceral added a commit to spenceral/envoy that referenced this pull request Apr 23, 2020
Signed-off-by: Spencer Lewis <slewis@squareup.com>
* master: (46 commits)
  allow specifying the API version of bootstrap from the command line (envoyproxy#10803)
  config: adding connect matcher (unused) (envoyproxy#10894)
  Add missing dependency on `assert.h` (envoyproxy#10918)
  Lower heap and disk space used by kafka tests (envoyproxy#10915)
  [tools] handle commits merged without PR in deprecated script (envoyproxy#10723)
  tools: including working tree in modified_since_last_github_commit.sh diff. (envoyproxy#10911)
  rocketmq_proxy: implement rocketmq proxy
  [docs] PR template to include commit message (envoyproxy#10900)
  docs: breaking long word to stop content overflow. (envoyproxy#10880)
  Delete legacy connection pool code. (envoyproxy#10881)
  wasm: clarify how configuration is passed (envoyproxy#10782)
  issue template: clarify security/crash reporting (envoyproxy#10885)
  api/faq: add entry on incremental xDS. (envoyproxy#10876)
  router: retry overloaded requests (envoyproxy#10847)
  Remove inclusion of pthread.h, not needed for linux compilation (envoyproxy#10895)
  request_id: Add option to always set request id in response (envoyproxy#10808)
  xray: Use correct types for segment document output (envoyproxy#10834)
  router: fixing a watermark bug for streaming retries (envoyproxy#10866)
  http: auditing Path() calls for safety with Pathless CONNECT (envoyproxy#10851)
  Remove hardcoded type urls Part.2 (envoyproxy#10848)
  ...
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: allow non-proto configuration
4 participants