-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
API: Add extension information the Node message. #9301
Conversation
Signed-off-by: Yan Avlasov <yavlasov@google.com>
This PR is to discuss how to best add versioning and categorization to the extension registry so it can be added to the Node message. Specifically:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yanavlasov thanks, this is pretty much aligned with what we had previously discussed, so looks great. A few nits and I've tagged folks who might be interested in the review.
/wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looping me in, @htuch!
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Run proto_format Fix tests with deprecated build_version Signed-off-by: Yan Avlasov <yavlasov@google.com>
…umented client features Signed-off-by: Yan Avlasov <yavlasov@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks great, thanks. @jpeach any further comments?
/wait
api/envoy/api/v2/core/base.proto
Outdated
// configuration, e.g. envoy.router, com.acme.widget. | ||
string name = 1; | ||
|
||
// Category of the extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add docs on where to find these names and some examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Right now the category comes from the factory's category() method. There is no single place where all categories are listed. Also not categories right now do not follow the DNS naming. I.e. tracers use the "tracing" category.
Some things to consider:
- Should we consolidate all category names into a common header?
- Should we add a notion of a deprecated category name and rename all non-conforming categories to use DNS notation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move towards (2), probably file an issue. For now, I think if we could do (1) with decent comments that would be awesome, we could just provide the GitHub URL to that header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #9425
* version is used for registering vendor specific factories that are versioned | ||
* independently of Envoy. | ||
*/ | ||
static void registerFactory(Base& factory, absl::string_view name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we registering all the Envoy in-builts as well (using the semver of Envoy itself)? I think we should do this, as end users can optionally build Envoy with/without different filters, and it helps to know which ones are around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, yes. There is RegisterInternalFactory that does not register a category, which is used for some internal factories (i.e. SslContext). I'm unsure if these need to be reported as well. Perhaps we should audit these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pastebin what the full Node looks like somewhere? I'm curious to take a look at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that the build version information isn't populated; do we assume it's the same as the Envoy version? I think for semantic version this is fair. For labels, we actually have this metadata already in BUILD rules, see https://github.com/envoyproxy/envoy/blob/master/bazel/envoy_library.bzl#L70.
I wonder if we want to populate labels with the security posture and status of extensions? Seems a pretty cool use of them and should not be too hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markdroth will gRPC use SemVer for extension versioning? If not, what is your versioning scheme?
If we make an assumption that an empty extension version means that the version is the same as the "user agent", should the "user_agent_version" include SemVer as well? Will you version your xDS client using SemVer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gRPC client itself does use semantic versioning, and it definitely makes sense to use SemVer as the format for user_agent_version.
The question of versions for plugins is an interesting one. In principle, it seems reasonable for plugins to use their own semantic versioning, but in order to provide those versions to xDS, gRPC would probably need to provide a way for the plugin to record its version when it registers itself. @ejona86 and @dfawley, thoughts...?
It might be a little confusing to assume that the default extension version matches the user agent version, because there could be some very simple plugins that don't bother to set a version. It might make more sense to just treat an empty version as a unique value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose how the empty version is treated is up to the xDS server. Are you suggesting removing the note about empty version from the proto doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think we should just say that an empty version means no version specified, not that it defaults to the user agent version.
string name = 1; | ||
|
||
// Category of the extension | ||
string category = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, I would assume specific type/name of the WASM filter would go into the category as well? Because its name would be a generic "envoy.wasm" in all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is populated from the factory's category() method. I've read through the #9358 and I'm still clear on what needs to happen for wasm filters. Perhaps WASM filter category should be supplied with the config somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PiotrSikora could you please chime in on how WASM could be reporting its specific kind through this API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also @jplevyak. I think that we can add some higher-order category support later for things like WASM. Ultimately I'd like to see how this plays out, but we shouldn't block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasm doesn't use protobuf for configuration. Do we need an alternative way to categorize / type the Wasm filters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this would be rather unfortunate to add separate categorization for wasm extensions. What does wasm extensions use for configuration? Can they provide an identity config proto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasm just uses an opaque blob. The reason being protobuf limits the choice of languages (and it's pretty slow in general).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can support Wasm additively after this PR ships. While the Wasm extension providing the runtime is a true Envoy extension, its plugins will be their own thing and probably need a structured reporting mechanism. I don't think we break that by going with what is in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 I think wasm can fit into this scheme by having all its plugin to have the same category i.e. "wasm" and add thread safe implementation of the FactoryRegistryProxy that can provide names of available wasm plugins. The name can come from config metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine for now, but I hope wasm will develop some first-class integration with xDS/Envoy version reporting mechanism, rather just leaving it for generic "wasm" and then providing opaque blob for the rest. That's a note for wasm in general, not specifically for this implementation.
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
This PR extends #9468 to support a distinct notion of transport and resource API version. The intuition here is that the opaque resources (and their type URLs) can be delivered via either v2 or v3 xDS, and the DiscoveryRequest etc. messages have their own versioning. Currently, the v2 and v3 transport protocols are indistinguishable modulo service endpoint. As v3 evolves, e.g. with #9301, differences will be introduced. At this point it will be necessary to have enhanced support in the gRPC mux and HTTP subscription modules to handle the protocol differences. This is technically a breaking v2 API change, but since the field it breaks was only added today, I think it's safe to assume it is not in use yet. Risk level: Low Testing: Integration tests added to validate service endpoint and type URL selection based on transport/resource version. Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, need to get CI to pass..
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
Signed-off-by: Yan Avlasov <yavlasov@google.com>
@yanavlasov LGTM, but format CI check is still failing. |
Signed-off-by: Yan Avlasov <yavlasov@google.com>
I'm going to merge this as is, since the |
This is a followup to envoyproxy#9301, where it was not possible to deprecate a field on DiscoveryRequest as we were previously assuming identical v2/v3 transport protocols. After this deprecation, build_version can't appear in v3 messages, and we need to convert back to a true v2 DiscoveryRequest prior to JSON serializing for REST. There's more work to be done in the future, when we add new v3-only fields, but this should work for 1.13.0. Future work tracked at envoyproxy#9619. Risk level: Low Testing: coverage of the behaviors for both gRPC and REST config sources is provided by api_version_integration_test (failing previously as soon as build_version was deprecated). Fixes envoyproxy#9604 Signed-off-by: Harvey Tuch <htuch@google.com>
This is a followup to #9301, where it was not possible to deprecate a field on DiscoveryRequest as we were previously assuming identical v2/v3 transport protocols. After this deprecation, build_version can't appear in v3 messages, and we need to convert back to a true v2 DiscoveryRequest prior to JSON serializing for REST. There's more work to be done in the future, when we add new v3-only fields, but this should work for 1.13.0. Future work tracked at #9619. Risk level: Low Testing: coverage of the behaviors for both gRPC and REST config sources is provided by api_version_integration_test (failing previously as soon as build_version was deprecated). Fixes #9604 Signed-off-by: Harvey Tuch <htuch@google.com>
Report extension information in the Node message.
Risk Level: Low
Testing: Unit Tests
Docs Changes: N/A
Release Notes: N/A
Fixes: #8332
Signed-off-by: Yan Avlasov yavlasov@google.com