Sharing .proto files among different repositories

Suppose, there are 2 services in different repositories (client and server). They communicate via gRPC and, as a result, they need to compile .proto files to generate appropriate stubs.

The question is how to share these files among them?

I’d like to create a third repository for proto-schemas. I’ve read to push changes there, and then, automatically (by CI/CD) generate stubs, pack them (Maven?) and upload to some kind of Registry (for example Github Packages). Then download them as a package (pom.xml in Java), include in project.

I’ve encountered some problems during such a configuration.
Can you give me some tips, your ideas, different approach?

An alternative solution is to add the proto-schemas repo as a Git submodule to both services’ repos. You have to generate the stubs in both builds, but it removes the need for a registry for uploading them.

I’ve felt, while reading different options, that submodules are a valid option, but not the best and not so flexible - anyway, I’ll look into that, thanks.

Let me ask you a second question. I want to develop an app in Kubernetes using something like Skaffold or Tilt-dev (<-- preferably). These tools help to automatically deploy services into local cluster, but how to host databases? I have docker-compose files that can run them as well, but should I keep them outside of cluster during local development or put them inside? Is it possible to keep state and data during cluster restart?

Thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.