Skip to content

Longhorn Protobuf

PoAn Yang edited this page Apr 18, 2024 · 2 revisions

We collect all protobuf files in https://github.com/longhorn/types. Please using the repository to modify protobuf fields.

Upgrade protoc version

  1. When upgrading protoc, also upgrading PROTOBUF_VER_PY in Dockerfile.dapper.
  2. Upgrade empty.proto in scripts/generate_grpc.
rm ./protobuf/vendor/protobuf/src/google/protobuf
make generate_grpc

Modify protobuf files

Please follow Proto Best Practices to modify protobuf files. For example, don't update the type of a field, adding a new field with a new tag number, etc.

Currently, we have some legacy package names. For example, imrpc.proto didn't define package name, but other protobuf files have. We can't change the package name for existent files. However, for new files, please follow the format <service>rpc to name a new service. For example, imrpc for instance manager, bimrpc for backing image manager, etc.

  1. If there is new protobuf folder, remember to add it to generate_grpc.
  2. After modifying protobuf files, run make generate_grpc to generate go and python files.
  3. For longhorn-engine repository, it need python generated files to run integration test, so we have to run make sync-grpc-py in longhorn-engine repository.
Clone this wiki locally