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

extension: added generic proxy network filter #22826

Merged
merged 39 commits into from
Sep 13, 2022

Conversation

wbpcode
Copy link
Member

@wbpcode wbpcode commented Aug 24, 2022

Commit Message: extension: added generic proxy framework
Additional Description:

This is very long story. Please check #18209 for more detailed discussions and background.
And there is the design proposol https://docs.google.com/document/d/1y_ALyjGp_H1_TRrrRxZxnqENISqeZI6eLn71FAFsZPk/edit#heading=h.a0godkb0g8bc
for why we want the extension.

Due to my personal reasons, I consistently did not finish the final testing of this extension, so it was delayed until now.
I picked this up finally and will complete it in this time.

It's sad the @rojkov cannot sponsor it. So I will self sponsor this extension.

Risk Level: Low. New extension.
Testing: Add.
Docs Changes: Wait.
Release Notes: Wait.
Platform Specific Features: Wait.

wbpcode and others added 16 commits November 9, 2021 06:15
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <wbphub@live.com>
Signed-off-by: wbpcode <wbphub@live.com>
Signed-off-by: wbpcode <wbphub@live.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <wbphub@live.com>
Signed-off-by: wbpcode <wbphub@live.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #22826 was opened by wbpcode.

see: more, trace.

@wbpcode
Copy link
Member Author

wbpcode commented Aug 24, 2022

  • integration test.
  • docs & release note.

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 api

CODEOWNERS Outdated Show resolved Hide resolved
@lizan lizan marked this pull request as draft August 25, 2022 18:25
@lizan
Copy link
Member

lizan commented Aug 25, 2022

@wbpcode mark this ready for review when it's no longer WIP and you can request reviewer yourself :)

wbpcode added 3 commits September 1, 2022 06:51
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@wbpcode
Copy link
Member Author

wbpcode commented Sep 4, 2022

/retest

wbpcode added 4 commits September 4, 2022 09:00
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@wbpcode wbpcode marked this pull request as ready for review September 5, 2022 13:31
@wbpcode wbpcode changed the title [WIP] extension: added generic proxy framework extension: added generic proxy framework Sep 5, 2022
@wbpcode
Copy link
Member Author

wbpcode commented Sep 5, 2022

cc @mattklein123 Hi, this PR is ready for review. Could you take a look when you have free time? Thanks.

@wbpcode
Copy link
Member Author

wbpcode commented Sep 5, 2022

Because it's long time after last dicussion. Here is some simple context about the extention.

Why we need this extensions?

Third-party RPC or private protocol support is a common requirement for users of Envoy/Mesh. However it's very complex to developed a new Envoy extension to proxy a third-party RPC or private protocol for now.
This generic proxy is L4 network filter which will provides common route, L7 filter chain, stream management, etc. The developers could add new protocol support to the Envoy by just implementing the core codec of this specific protocol. This reduce much of the complexity of new protocol support.

About this extension

The design of this extension is come from many others contribution. The initial idea of implement generic proxy in the Envoy is come from @zhaohuabing (aeraki-mesh). The xds matcher based route table is come from @htuch. The async codec API is come from @rojkov. And now, we finally have a implementation for the Envoy community. (The aeraki-mesh will keep their extension because by this way they can add new features more quickly and freely. So we renamed this extension to simple generic_proxy to distinguish this extension from the aeraki-mesh's extension and avoid the name conflict in the aeraki-mesh's building.)

Next step of this extension?

  1. Because the async codec API and xds matcher based route table, implementation in this PR is almost complete different with our internal implementation or aeraki-mesh's implementation. So more tests are necessary to ensure everything is work. (The current coverage rate is 95%.)
  2. Dubbo codec support. Dubbo proxy has very simple stream model and could be easily to migrate it to this new extension. After that, we can avoid the cost of maintaining the dubbo proxy. Of course, we will have a long, long time to gradually deprecate the old dubbo proxy.
  3. More features, such rds support, observability, route level config, etc.

@wbpcode wbpcode changed the title extension: added generic proxy framework extension: added generic proxy network filter Sep 5, 2022
wbpcode added 2 commits September 5, 2022 13:57
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@wbpcode wbpcode requested a review from mattklein123 September 5, 2022 23:31
@mattklein123 mattklein123 self-assigned this Sep 6, 2022
wbpcode added 5 commits September 7, 2022 08:52
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@mattklein123
Copy link
Member

@wbpcode this is too much code for me to reasonably review. I'm not sure the best way of moving this forward. I think rewriting Dubbo to use this would give me a lot more confidence. How would you suggest incrementally moving this forward?

@wbpcode
Copy link
Member Author

wbpcode commented Sep 9, 2022

@mattklein123 As I originally planned, after this PR is merged, I would first move dubbo decoder/encoder of current dubbo proxy to extensions/common. And then I will implement dubbo codec for generic proxy based on these encoder/decoder. The rds supports will be added after that.

With luck, Dubbo will then be able to use the new extension as a proxy

@wbpcode
Copy link
Member Author

wbpcode commented Sep 9, 2022

Yeah, this is a super big PR that hard to review. 🤣 But this extension still be marked as WIP, so we still have chance to correct it in the future if there are something wrong.

IMO, the core should be the message API and codec API, you can check these code in the genetic_proxy/interface. These API still be very simple for now.

wbpcode added 4 commits September 10, 2022 14:51
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@wbpcode
Copy link
Member Author

wbpcode commented Sep 12, 2022

This extension was moved to contrib as our offline discussion. @mattklein123

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. I'm OK merging this into contrib. Once Dubbo has been rewritten to use this and vetted in production I think we can deprecate/remove the existing Dubbo filter and move this all into core. Thank you!

@wbpcode wbpcode merged commit 51c0d6f into envoyproxy:main Sep 13, 2022
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.

4 participants