-
Notifications
You must be signed in to change notification settings - Fork 9
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
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
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. Just one suggestion about folder naming.
protobuf/bimrpc/bimrpc.proto
Outdated
|
||
package bimrpc; | ||
|
||
option go_package = "github.com/longhorn/types/pkg/bimrpc"; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
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.
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.
|
scripts/generate_grpc
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make v24.3
as a global variable PROTOBUF_VER
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.
Updated it. Thank you.
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Where should developers make changes if they want to update?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.
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