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

config: distinct resource/transport API versions. #9526

Merged
merged 23 commits into from
Jan 8, 2020

Conversation

htuch
Copy link
Member

@htuch htuch commented Dec 30, 2019

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.

Some other misc. changes that were needed:

  • Type URL added to REST DiscoveryRequest.
  • Fixed SDS type URL determination.

Risk level: Medium (introduction of type URL in REST DiscoveryRequests is a wire addition.
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

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 <htuch@google.com>
@repokitteh-read-only
Copy link

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

🐱

Caused by: #9526 was opened by htuch.

see: more, trace.

@htuch htuch requested review from Shikugawa and lizan December 30, 2019 23:56
@htuch htuch added the api/v3 Major version release @ end of Q3 2019 label Dec 30, 2019
@htuch
Copy link
Member Author

htuch commented Dec 30, 2019

@Shikugawa @lizan the api_verion_integration_test is still WiP and I need to version switch the ADS gRPC endpoint URL still, but this PR is basically where I see us heading; distinct resource and transport API versions and an e2e test to validate the basics across resource types, config types and config versions.

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added 13 commits January 2, 2020 10:43
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Member Author

htuch commented Jan 2, 2020

@lizan @Shikugawa @mattklein123 this now has tests added for functional coverage and is ready for review.

@Shikugawa
Copy link
Member

@htuch Great thanks for this work. This is very helpful functionality for my planning implementation for API fallback. I will add some comment.

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.

At a high level this looks fine to me with one API question.

api/envoy/api/v2/core/config_source.proto Show resolved Hide resolved
htuch added 3 commits January 3, 2020 13:36
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit to htuch/envoy that referenced this pull request Jan 6, 2020
Previously, type_to_endpoint.cc had a lot of hardcoding, which doesn't scale well with multiple API
versions. See envoyproxy#9526 for an example of the issues
encountered.

This patch switches to using explicit resource type annotations on service descriptors, which is
great for documentation (previously this was sometimes given in comments, sometimes not), and allows
for a reflection driven reverse map from resource type URL to endpoints to be built at runtime.

Risk level: Low
Testing: New unit tests for type_to_endpoint.cc and golden protoxform tests for the new annotations.

Fixes envoyproxy#9454.

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit that referenced this pull request Jan 6, 2020
#9566)

Previously, type_to_endpoint.cc had a lot of hardcoding, which doesn't scale well with multiple API
versions. See #9526 for an example of the issues
encountered.

This patch switches to using explicit resource type annotations on service descriptors, which is
great for documentation (previously this was sometimes given in comments, sometimes not), and allows
for a reflection driven reverse map from resource type URL to endpoints to be built at runtime.

Risk level: Low
Testing: New unit tests for type_to_endpoint.cc and golden protoxform tests for the new annotations.

Fixes #9454.

Signed-off-by: Harvey Tuch <htuch@google.com>
mattklein123 pushed a commit to envoyproxy/data-plane-api that referenced this pull request Jan 6, 2020
…. (#9566)

Previously, type_to_endpoint.cc had a lot of hardcoding, which doesn't scale well with multiple API
versions. See envoyproxy/envoy#9526 for an example of the issues
encountered.

This patch switches to using explicit resource type annotations on service descriptors, which is
great for documentation (previously this was sometimes given in comments, sometimes not), and allows
for a reflection driven reverse map from resource type URL to endpoints to be built at runtime.

Risk level: Low
Testing: New unit tests for type_to_endpoint.cc and golden protoxform tests for the new annotations.

Fixes #9454.

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ cceab393664429a3063d787cf28cade3c8ab01c7
@htuch
Copy link
Member Author

htuch commented Jan 7, 2020

@mattklein123 @lizan ready for another pass, thanks.

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 at a high level. Will defer to @lizan and @Shikugawa for in-depth review.

source/common/config/type_to_endpoint.cc Outdated Show resolved Hide resolved
source/common/router/scoped_rds.cc Show resolved Hide resolved
Copy link
Member

@lizan lizan left a comment

Choose a reason for hiding this comment

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

LGTM, one nit

source/common/config/protobuf_link_hacks.h Show resolved Hide resolved
@repokitteh-read-only repokitteh-read-only bot removed the api label Jan 7, 2020
@htuch htuch merged commit df05827 into envoyproxy:master Jan 8, 2020
@htuch htuch deleted the v3-endpoints branch January 8, 2020 02:40
htuch pushed a commit that referenced this pull request Jan 10, 2020
#9526 force linked most method descriptors. However, HDS was missing. This PR force links HDS v2.

Risk Level: low
Testing: compiled with Envoy Mobile's iOS dist target which, as discussed here, requires the hack currently in place.

Signed-off-by: Jose Nino <jnino@lyft.com>
htuch pushed a commit that referenced this pull request Mar 18, 2020
This is only refactoring. Aggregated xDS type urls. In previous implementation, loadTypeUrl is scattered on all of xDS subscription classes. That is poor outlook so refactored all of them.

Risk Level: Low
Testing: None

Relates to issues 9468 #9526

Signed-off-by: shikugawa <rei@tetrate.io>
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.

4 participants