-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Migrate RPC to ConnectRPC #703
Conversation
cff9804
to
b85c9ff
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
==========================================
+ Coverage 49.11% 49.27% +0.15%
==========================================
Files 69 69
Lines 10194 10081 -113
==========================================
- Hits 5007 4967 -40
+ Misses 4656 4598 -58
+ Partials 531 516 -15 ☔ View full report in Codecov by Sentry. |
Before merging this PR, we need to ensure that mobile SDKs can communicate with the server. Yorkie Go Server already multiplexes the existing grpc protocol, we expect no issues. Could we test dashboard works well too? |
@chacha912 This is because dashboard also uses |
Related to yorkie-team/dashboard#42 |
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 your contribution.
ConnectRPC supports following features: - Supports interoperation and multiplexing of grpc, grpc-web, and Connect protocols. - Supports language-familiar primitives like net/http and fetch. - Supports simple and no-boilerplate codes. With this support, we can resolve several issues: - Removes dependency with Envoy proxy to communicate with JS SDK web client by grpc-web. - Removes dependency with deprecated gogo/protobuf. - Supports JSON based REST API which will satisfy these needs.
What this PR does / why we need it:
Migrate RPC to ConnecRPC.
ConnectRPC supports following features:
grpc
,grpc-web
, andConnect
protocols.net/http
andfetch
.With this support, you can resolve several issues:
Which issue(s) this PR fixes:
Related to #668
Special notes for your reviewer:
Note
After merging this PR, I will remove envoy proxy on docker configuration on other repositories too.
Note
JS SDK compatibility: Since
connect-go
does not supportgrpc-web-text
which current JS SDK gRPC-web client uses, we need to migrate JS SDK's RPC to ConnectRPC as well. We can temporary change JS SDK's docker-compose settings (keep envoy proxy and change server rpc port to11101
) to support compatibility with ConnectRPC server and JS SDK gRPC-web client before finishing migration of ConnectRPC on JS SDK.Note
Server configuration: We need to find corresponding
net/http
server configurations that matches withgRPC
server options such asMaxRequestBytes
,MaxConnectAge
andMaxConnectionAgeGrace
. Because of this issue,watch document test
is temporary commented.Note
gRPC Metrics: Since we cannot use
go-grpc-prometheus
that measured gRPC server metrics, I have implemented RPC metrics by referencinggo-grpc-prometheus
. Because the syntax of newly implemented metrics are different fromgo-grpc-prometheus
, we also need to update Grafana query (ex:grpc_server_handled_total
toyorkie_rpc_server_handled_total
,grpc_type
torpc_type
).Note
Since we no longer have Envoy proxy to handle CORS, I have implemented CORS on RPC server. But for cluster mode, we have ingressgateway to handle CORS. So we need to implement disable option for CORS on server.
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: