由于没有简单的方法添加额外的 proto 文件,我们将不得不克隆一些仓库并将 proto 文件复制到我们的项目中
protocolbuffers/protobuf - Protocol Buffers 的官方仓库。我们需要位于
src/google/protobuf
下的 protobuf 文件
» mkdir -p thirdparty && cd thirdparty
» git clone --depth 1 https://github.com/protocolbuffers/protobuf.git
bentoml/bentoml - 我们需要
bentoml/grpc/
下的service.proto
来构建客户端;因此,我们将执行 稀疏检出 (sparse checkout) 以仅检出bentoml/grpc
目录
» mkdir bentoml && pushd bentoml
» git init
» git remote add -f origin https://github.com/bentoml/BentoML.git
» git config core.sparseCheckout true
» cat <<EOT >|.git/info/sparse-checkout
src/bentoml/grpc
EOT
» git pull origin main && mv src/bentoml/grpc .
» popd