-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
chore: update grpc runtime library #8929
Conversation
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Alexander Matyushentsev <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #8929 +/- ##
==========================================
+ Coverage 43.40% 44.88% +1.48%
==========================================
Files 186 212 +26
Lines 23373 25310 +1937
==========================================
+ Hits 10145 11361 +1216
- Misses 11779 12341 +562
- Partials 1449 1608 +159
Continue to review full report at Codecov.
|
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
Signed-off-by: Leonardo Luz Almeida <[email protected]>
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.
LGTM.
Code changes look good. Tested CLI locally as well and could not find any bugs. Lets merge it !
* chore: update grpc POC Signed-off-by: Leonardo Luz Almeida <[email protected]> * fix: register gogo codec (#1) Signed-off-by: Alexander Matyushentsev <[email protected]> * Remove gogo annotations from application.proto Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix unit tests Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix e2e test Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix lint Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix lint Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix unit-test Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix LogEntry.Last required field not populated Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix LogEntry required fields Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix get log content Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix app actions list Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix ApplicationPodLogsQuery Signed-off-by: Leonardo Luz Almeida <[email protected]> * Fix RunResourceAction Signed-off-by: Leonardo Luz Almeida <[email protected]> Co-authored-by: Alexander Matyushentsev <[email protected]> Signed-off-by: wojtekidd <[email protected]>
In the argoproj#8929, the project parameter had changed to projects. https://github.com/argoproj/argo-cd/blob/5f5d7aa59b4c818192b178f260eed8c0ac0b3669/server/application/application.proto#L23 Signed-off-by: neosu <[email protected]>
In the argoproj#8929, the project parameter had changed to projects. https://github.com/argoproj/argo-cd/blob/5f5d7aa59b4c818192b178f260eed8c0ac0b3669/server/application/application.proto#L23 Signed-off-by: neosu <[email protected]>
In the #8929, the project parameter had changed to projects. https://github.com/argoproj/argo-cd/blob/5f5d7aa59b4c818192b178f260eed8c0ac0b3669/server/application/application.proto#L23 Signed-off-by: neosu <[email protected]>
In the #8929, the project parameter had changed to projects. https://github.com/argoproj/argo-cd/blob/5f5d7aa59b4c818192b178f260eed8c0ac0b3669/server/application/application.proto#L23 Signed-off-by: neosu <[email protected]>
@@ -44,13 +43,13 @@ type ApplicationQuery struct { | |||
// forces application reconciliation if set to true | |||
Refresh *string `protobuf:"bytes,2,opt,name=refresh" json:"refresh,omitempty"` | |||
// the project names to restrict returned list applications | |||
Projects []string `protobuf:"bytes,3,rep,name=project" json:"project,omitempty"` | |||
Projects []string `protobuf:"bytes,3,rep,name=projects" json:"projects,omitempty"` |
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.
FYI, this change deleted all of our apps since we used project=XX
. The filter on project was not there and resulted in all our apps being listed and deleted. This was not in the changelog.
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.
@victorboissiere would you mind opening an issue requesting that the upgrade guide be changed to include a note about this?
We probably also need to establish a stricter policy about API backwards-compatibility.
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.
We probably also need to establish a stricter policy about API backwards-compatibility.
I think we already promise backwards compatibility for the API. And I think this one just slipped through the cracks.
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.
This file is auto-generated. The breaking change originated here. This was probably a misunderstanding about how the gogoproto.customname
worked. Unfortunately this wasn't caught by our automated tests on that occasion. I agree with @jannfis that a stricter policy isn't the answer to this incident. Our API is exposed at /api/v1
and that shouldn't break. What we could do to avoid this type of problem in the future is improving our automated tests. Probably having some sort of contract testing would be beneficial.
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.
@victorboissiere I am sorry about the incident that this change caused. To avoid this type of issue to happen again in the future, I created the following proposal: #12589
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.
@victorboissiere what was your client? I'm investigating whether this is a problem with the CLI.
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 the issue! it was not the CLI, we’ve built an internal tool that cleanup from time to time some project applications. The filter stopped working and we’ve lost ~8000 pods.
Thanks for the effort to avoid this in the future 🙏
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.
Sweet, thanks! PR to fix the issue: #12594
I had written up some warnings about the CLI, but after investigation, I don't think the CLI is impacted. Only the JSON API.
Signed-off-by: Leonardo Luz Almeida [email protected]
TL;DR
This PR updates the gRPC runtime library (to the current latest version v1.45.0) used in ArgoCD.
Analysis
In ArgoCD we have a mix of
proto3
andproto2
used for gRPC messages:proto2
is used by the Application gRPC APIs and uses gogo-protobuf annotations.proto3
is used for all other operations provided by the API server.With this scenario, updating the grpc runtime library works for most of UI/CLI operations but fail in Application ones with the error:
Error explanation details can be found here. As this is coming from the
gogo
marshaling code, one other possibility would be to removegogo
plugin from the project and use the standard provided by google.protobuf. Unfortunately this is still not possible because of Kubernetes proto files incompatibility issues described here.Solution
With this scenario, the only possibility to update gRPC runtime library in ArgoCD is by removing all
gogo
annotations from theapplication.proto
so we don't need to rely on generated Marshallers code and avoid the incompatibility issue. However we still need to usegogo
plugin for go stubs generation to maintain the compatibility with Kubernetes protos.This PR is an attempt to implement the solution above.
Relates to #4972
Checklist: