-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
thrift: adding xDS RDS support for thrift proxy. #17631
Conversation
The implementation is mostly copy form source/common/router/ minus the unnecessary parts. Unfortunatly no common base classes to share code. Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Hi @tkovacs-2, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
@tkovacs-2 this is great, thank you! Any reasons to avoid base classes in source/common/router/ ? My intuition is that we'd want to share, unless you think there'll be irreconcilable differences between HTTP and Thrift towards handling RDS. cc: @htuch to get more guidance towards sharing common RDS code vs having Thrift and HTTP diverge. |
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 LGTM, besides my previous comment about possibly adding base classes to share code with the existing router RDS implementation.
- match: | ||
method_name: bar | ||
route: | ||
cluster: baz |
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.
nit: maybe add a mirroring policy here (#17544)
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.
In these tests the exact content of the route configuration is not important.
If I understand right this mirroring is an attribute for the RouteAction
. What is the benefit of add such here?
I'm not sure I fully understand what is proposed. How can Thrift make use of RDS, which is about HTTP routes? We definitely should not fork the RDS code, there is a lot of subtlety and complexity in the warming, shared providers and lifecycle (for on-demand). I would recommend making the base code more generic if it doesn't add too much complexity to Envoy core (i.e. it's just about making some resource type opaque). CC @envoyproxy/api-shepherds @adisuissa |
@htuch @rgs1 If the static routing rules change in a listener a new listener is created and after a drain period the old one is deleted. This has two negative consequences:
With RDS the routing rules can be changed dynamically without creating new listener and the already established connections can use the new rules immediately, so it is a very good feature. I know the major protocol in envoy is http, but RDS support in other protocols would could come handy sometimes. On api level the RDS is independent from the listener's protocol. I added the 'message Rds' to the thrift part just because I did not want to cross refer to envoy.extensions.filters.network.http_connection_manager.v3 for the same. Of course I did not want Thrift listener with HTTP routing config. What may be better is to turn to templates those classes what I added to the thrift with the protocol's routing config as template parameter and move back to source/common/routing. |
Yeah, that's what I was referring to -- reusing as much as possible as long as it doesn't become too complex. |
I agree with all of this, this is a great addition.
Makes sense.
Yeah that was my concern.
That would be great, shall we go down that path? Thanks! |
So, there is probably two things here to consider API and config plane wise:
|
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Conflicts: source/common/config/type_to_endpoint.cc Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Understood.
In case of RDS without ADS to introduce new endpoints maybe not necessary. Please see the change in the commit 3235184. We can just map the new type url-s back to envoy.config.route.v3.RouteConfiguration and we can reuse the RouteDiscoveryService endpoint. The DiscoveryRequest/DiscoveryResponse doesn't depend on the protocol also it is backward compatible from xds server point of view. Alternatively we can say the non-http RDS can be used just with ADS. |
Sure. |
Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.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.
I agree with @htuch that it's not obvious to me that we want to use exactly the same resource type for HTTP RouteConfiguration and Thrift RouteConfiguration. The resource aliasing thing seems a little ugly. And even if the two resource types happen to be the same right now, who's to say that they won't diverge in the future?
Also, in terms of the API representation, you may want to use the new matching API, which @snowp is working on integrating into RDS in #17633.
api/envoy/extensions/filters/network/thrift_proxy/v3/thrift_proxy.proto
Outdated
Show resolved
Hide resolved
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Retrying Azure Pipelines: |
@tkovacs-2 thanks. I think the next step is as follows:
|
@htuch We have built an unified RDS solution in Aeraki https://github.com/aeraki-framework/meta-protocol-proxy, proven working with both Thrift and Dubbo. The MetaProtocol PR is intended to push what we have done in Aeraki to the Envoy, including unified routing (RDS), tracing, logging, etc., so it can be used as the chassis for Dubbo, Thrift, and other request/response, stateless style protocols users would like to support in Envoy with their own codecs. |
Hi @zhaohuabing, One things are not clear for me in the metaprotocol: |
The RDS(we call it MetaRDS) in Aeraki is a unified solution for all the applications built on top of the MetaProtocol Proxy, including Thrift, Dubbo, and other proprietary protocols. We didn't include HTTP/gRPC routing in the MetaRDS because HTTP Routing is already handled very well by the current RDS and HCM, and it's not in the design scope of the MetaProtcol proxy.
The goal of the MetaProtocol Proxy is to build a unified solution for all request/response, stateless protocols, avoiding duplication and allowing users to create protocol filters more easily. For example, if you want to create a X protocol filter, instead of writing the whole TCP filter, now you only need to implement the codec Interface of MetaProtocol Proxy. More about the goal and design can be found here: https://docs.google.com/document/d/1y_ALyjGp_H1_TRrrRxZxnqENISqeZI6eLn71FAFsZPk/edit#heading=h.ic0mhtrvlmy9 |
@zhaohuabing |
The framework code will be pushed to the MetaProtocol proxy filter. Although Dubbo and Thrift have been proven working on top of the Meta Protocol proxy, however, we need community consense if we'd like to port dubbo and thrift to metaprotocol. The core maintainers and owners of Dubbo and Thrift should agree on that before the shift. I personally think it's not the key issue here, Thrift filter could exist as it is now if the community think it should be, and the MetaProtocol proxy can be used to facilitate protocols that are not currently supported in the Envoy.
It's not just APIs. The implementation will be pushed later after the community agrees on the design and finalizes the API. The application protocols built on top of the MetaProtocol proxy only needs to implement the codec interface. Sorry for causing the confusion. |
@tkovacs-2 |
I think there are a few things going on here that would be good to clarify:
|
Hi, @htuch We will rewrite the whole meta protocol proxy, so it doesn't matter what the old implementation is before. After merging the core framework of new meta protocol proxy, we will have another special PR and design to do this work. I think at that time, #18846 will be very helpful. And, replacing the dubbo proxy and thrift proxy is not our goal. Although we have implemented thrift codec/dubbo codec in the old meta protocol proxy, but it would not be the part of new meta protocol proxy. So there is no need to worry about the co-existence of thrift proxy and meta protocol thrift. |
OK, thanks for the clarity; it makes sense to hold back on replacing extant filters until we have stability here and there is enough commonality that we can ahead with the refactoring PR. I wonder if we want both TRDS and MetaRDS though; could these be the same t hing once we merge #18846? |
I think they can't be exactly the same, since the type of route config ( I have planned to introduce a template default implementation for these under |
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! I think this looks good generally, but I was only able to give it cursory look today. I'm also out tomorrow, so I can't get back to this until Friday.
@zuercher @htuch Do you have some suggestion how to handle thrift part? |
@tkovacs-2 "Or just collect the comments here and fix here after #18846 is merged?" <-- yep, GitHub doesn't have very good support for a PR pipeline that I know of. |
Wait for #18846 to be merged. |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
…ation. (#18846) Extracting base classes from the existing code as reusable generic routing DS implementation. Additional Description: - The current RDS implementation is tied to the HTTP protocol. To make it reusable for other protocols base classes containing the generic part are extracted from the existing code. - The Config and RouteConfiguration proto classes are opaque for the generic implementation. - The location of the base classes are envoy/rds and source/common/rds and the Envoy::Rds namespace. - Existing code is reworked to use the base classes and HTTP specific features added back by decorator pattern (StaticRouteConfigProviderImpl, RdsRouteConfigProviderImpl, RouteConfigUpdateReceiverImpl) and template method pattern (RdsRouteConfigSubscription). - One thing which has to be implemented separately for every protocol is the Rds::ConfigTraits and Rds::ProtoTraits interface which provides basic information about the otherwise opaque classes. - Other is a wrapper around the Rds::RouteConfigProviderManagerImpl which creates the provider objects with the proper types. This PR is split from #17631 Risk Level: Medium Testing: - Unittest - Manual test with static routing from bootstrap config, static routing and dynamic routing from GRPC based xDS server. Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Adding xDS routing discovery support for thrift proxy. The routing discovery is supported only through ADS. No separate service endpoints added for thrift routing config type url. This PR is split from #17631 Risk Level: Low Testing: - Unittest - Manual test with static routing from bootstrap config, static routing and dynamic routing from GRPC based xDS server. Docs Changes: Comment added to the new API field. Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Adding xDS routing discovery support for thrift proxy. The routing discovery is supported only through ADS. No separate service endpoints added for thrift routing config type url. This PR is split from envoyproxy#17631 Risk Level: Low Testing: - Unittest - Manual test with static routing from bootstrap config, static routing and dynamic routing from GRPC based xDS server. Docs Changes: Comment added to the new API field. Signed-off-by: Tamas Kovacs <tamas.2.kovacs@nokia-sbell.com>
Commit Message:
Adding xDS RDS support for thrift proxy.
Additional Description:
base classes containing the generic part are extracted from the existing code.
(StaticRouteConfigProviderImpl, RdsRouteConfigProviderImpl, RouteConfigUpdateReceiverImpl)
and template method pattern (RdsRouteConfigSubscription).
RouteConfigProviderManagerImpl::createRdsRouteConfigProvider and
RouteConfigProviderManagerImpl::createStaticRouteConfigProvider functions.
To make it easier helper functions are added to Rds::RouteConfigProviderManagerImpl.
Risk Level:
Medium
Testing:
Docs Changes:
Comment added to the new API field.
Release Notes:
Platform Specific Features: