feat: add proto#2
Conversation
3748493 to
501fe5b
Compare
|
Hi @innobead, currently, different LH projects use different protobuf package naming.
Originally, I would like to fix the naming in this PR like
In a new LH cluster, this is not a problem. However, when we upgrade an old LH cluster, we may have both old and new longhorn-instance-manager and longhorn-engine. This will be an issue. I get an error like: We have two ways to solve the problem:
|
|
As discussed with/ @FrankYang0529 , we will adopt option 2 to keep the package name as usual, as this is the original design principle of Protobuf (ex: backward compatibility) before we figure out a better way to mitigate this design debt. |
fa4fbc6 to
25f1b5b
Compare
bc21201 to
43613e4
Compare
|
@ejweber @shuo-wu @ChanYiLin Please review this. |
ee78f3e to
9ddb72a
Compare
innobead
left a comment
There was a problem hiding this comment.
LGTM. Just one suggestion about folder naming.
|
|
||
| package bimrpc; | ||
|
|
||
| option go_package = "github.com/longhorn/types/pkg/bimrpc"; |
There was a problem hiding this comment.
| option go_package = "github.com/longhorn/types/pkg/bimrpc"; | |
| option go_package = "github.com/longhorn/types/pkg/generated/bimrpcpb"; |
For Python generated module, suggest generated-py/... instead of rpc-py. WDYT?
There was a problem hiding this comment.
@innobead, If we want to update go_package in bimrpc, I will update all go_package with prefix github.com/longhorn/types/pkg/generated for consistency. The generated-py path also looks good to me.
There was a problem hiding this comment.
Updated it. Thank you.
|
@FrankYang0529 In addition, please use Github Action instead and we only need to run this on amd64. |
|
I am thinking we have the 3rd option: |
Hi @shuo-wu, when users upgrade LH, longhorn-instance-manager needs to connect old and new longhorn-engine. If we change protobuf package name, longhorn-instance-manager has to create two gRPC clients, one for old protobuf and another for new. There are 3 package names need to be changed: |
@FrankYang0529 Have you tested the combability after upgrading Longhorn, for example, creating and deleting volumes in mixed old/new longhorn-manager, instance-instance-manager, and longhorn-engine cluster? |
Yes, in my test steps, I think these two steps cover it. |
| rm -rf ./protobuf/vendor/protobuf/src/google/protobuf | ||
| DIR="./protobuf/vendor/protobuf/src/google/protobuf" | ||
| mkdir -p $DIR | ||
| wget https://raw.githubusercontent.com/protocolbuffers/protobuf/v24.3/src/google/protobuf/empty.proto -P $DIR |
There was a problem hiding this comment.
Make v24.3 as a global variable PROTOBUF_VER
There was a problem hiding this comment.
Updated it. Thank you.
| * protoc 24.3 | ||
| * protoc-gen-go 1.31.0 | ||
| * protoc-gen-go-grpc 1.3.0 | ||
| * python protobuf 4.24.3 |
There was a problem hiding this comment.
nit: Where should developers make changes if they want to update?
There was a problem hiding this comment.
Sorry, I add Dockerfile.dapper* to .gitignore, so we don't see it here. I will add it and force push again. We can change it in Dockerfile.dapper in the future.
There was a problem hiding this comment.
I add Dockerfile.dapper. There are some variables can change the version. Thanks.
Signed-off-by: PoAn Yang <yangpoan@gmail.com>
Signed-off-by: PoAn Yang <yangpoan@gmail.com>
Added it. However, this is first PR to add GItHub Action, so it looks like it's not triggered in this PR. |
|
No worries. You can update the action later if it doesn't work. |
issue: longhorn/longhorn#6744
Test Plan
Please build images from following PRs:
Case 1: New cluster
Case 2: Upgrade from v1.6.1
helm install longhorn . --namespace longhorn-system --create-namespace