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

api: xDS API version specifier #9468

Merged
merged 9 commits into from
Dec 30, 2019

Conversation

Shikugawa
Copy link
Member

Signed-off-by: shikugawa [email protected]

Description: It enables to specify API versioning for xDS for #8421, allow to write like this config

eds_cluster_config:
    eds_config:
       version: V2 
       api_config_source:
          api_type: GRPC
	  grpc_services:
            envoy_grpc:
               cluster_name: eds_cluster

Risk Level: Low
Testing: unit test(maybe it is needed to add integration test)
Docs Changes: needed
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@repokitteh-read-only
Copy link

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

🐱

Caused by: #9468 was opened by Shikugawa.

see: more, trace.

message ConfigSource {
enum XdsApiVersion {
// set api version automatically, default version is set as v2.
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering whether this should be match the version of ConfigSource, i.e. if the type is v3alpha.ConfigSource, use v3alpha. WDYT @htuch?

Copy link
Member

Choose a reason for hiding this comment

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

Making it explicit (as done in this PR) has the advantage that we can support mixed v2/v3 configurations, e.g. LDS loads from a v3 server but RDS comes from v2. We may get into a situation where a v3 Listener one day is expecting to have some v3-related route table delivered, but I think we can enforce these through consistency checking at config ingestion, the general case is that we support mixed.

Copy link
Member

Choose a reason for hiding this comment

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

To be clear, I meant this for AUTO, we should definitely keep the rest of options explicit.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think that would be reasonable semantics.

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 let's just say that it's V2 for now, it would be ideal to have folks specifically exactly what they are after going forward, and this will encourage that.

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.

This is great @Shikugawa, definitely aligned with where I'm thinking. For this PR, I would suggest you get the build working and existing tests passing. You can skip adding new tests for v3 for now, I'll sync after some more PRs have landed and we can discuss the v3 tests. In my WiP banch, I have some support for testing with mixed v2/v3.

message ConfigSource {
enum XdsApiVersion {
// set api version automatically, default version is set as v2.
Copy link
Member

Choose a reason for hiding this comment

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

Making it explicit (as done in this PR) has the advantage that we can support mixed v2/v3 configurations, e.g. LDS loads from a v3 server but RDS comes from v2. We may get into a situation where a v3 Listener one day is expecting to have some v3-related route table delivered, but I think we can enforce these through consistency checking at config ingestion, the general case is that we support mixed.

api/envoy/api/v3alpha/core/config_source.proto Outdated Show resolved Hide resolved
Signed-off-by: shikugawa <[email protected]>
Signed-off-by: shikugawa <[email protected]>
@htuch
Copy link
Member

htuch commented Dec 26, 2019

FYI, when #9480 lands, we'll need to use those annotations for the type URLs in this PR.

@htuch htuch added the api/v3 Major version release @ end of Q3 2019 label Dec 26, 2019
@htuch
Copy link
Member

htuch commented Dec 26, 2019

@Shikugawa any update here? Would be great to land this soon so we can work on v3 wire xDS.

@Shikugawa
Copy link
Member Author

@htuch there is no update here, but build is failing on CI. This should be resolved, my local build process can work fine so It seems something wrong on CI build process.

@htuch
Copy link
Member

htuch commented Dec 26, 2019

@Shikugawa looking at the CI logs, I'm guessing this might be some interaction with the package movement that @lizan added for SRDS, see https://dev.azure.com/cncf/envoy/_build/results?buildId=24529&view=logs&j=4e3e56d1-4574-5496-ade8-f4f41cead1dc&t=481a44f5-6d65-59dc-f824-e3a9563c67cf.

Signed-off-by: shikugawa <[email protected]>
Signed-off-by: shikugawa <[email protected]>
@Shikugawa Shikugawa marked this pull request as ready for review December 27, 2019 08:29
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.

@Shikugawa this LGTM modulo nits and some tests. I think we just need to validate the correspondence between presented ConfigSource version and the type URL that gets used. Thanks.
/wait

source/common/router/vhds.cc Outdated Show resolved Hide resolved
message ConfigSource {
enum XdsApiVersion {
// set api version automatically, default version is set as v2.
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 let's just say that it's V2 for now, it would be ideal to have folks specifically exactly what they are after going forward, and this will encourage that.

Signed-off-by: shikugawa <[email protected]>
@Shikugawa Shikugawa force-pushed the xds-version-specifier branch from fe7d23b to 4ab383d Compare December 30, 2019 07:09
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 @Shikugawa. I'm going to merge this as is to unblock other v3 works, please do add some unit tests (I'm going to be adding integration tests shortly as well).

@htuch htuch merged commit e3717b5 into envoyproxy:master Dec 30, 2019
htuch added a commit to htuch/envoy that referenced this pull request Dec 30, 2019
This PR extends envoyproxy#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 envoyproxy#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 <[email protected]>
prakhag1 pushed a commit to prakhag1/envoy that referenced this pull request Jan 3, 2020
It enables to specify API versioning for xDS for envoyproxy#8421, allow to write like this config

eds_cluster_config:
    eds_config:
       version: V2 
       api_config_source:
          api_type: GRPC
	  grpc_services:
            envoy_grpc:
               cluster_name: eds_cluster

Risk Level: Low
Testing: unit test(maybe it is needed to add integration test)

Signed-off-by: shikugawa <[email protected]>
Signed-off-by: Prakhar <[email protected]>
htuch added a commit that referenced this pull request Jan 8, 2020
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/v3 Major version release @ end of Q3 2019
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants