From 635dd6aae656f3b47d174461f34d3de799f2dc94 Mon Sep 17 00:00:00 2001 From: Connor Carpenter Date: Mon, 10 Aug 2026 13:34:39 -0700 Subject: [PATCH] [Build][gRPC] Publish protobuf schemas to Buf (#51276) Signed-off-by: Connor Carpenter Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/buf.yml | 56 +++++++++++++++++++++++++++++++++++++++ rust/proto/README.md | 12 +++++++++ rust/proto/buf.md | 8 ++++++ rust/proto/buf.yaml | 9 +++++++ 4 files changed, 85 insertions(+) create mode 100644 .github/workflows/buf.yml create mode 100644 rust/proto/README.md create mode 100644 rust/proto/buf.md create mode 100644 rust/proto/buf.yaml diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml new file mode 100644 index 0000000000..e079240afd --- /dev/null +++ b/.github/workflows/buf.yml @@ -0,0 +1,56 @@ +name: Buf + +on: + pull_request: + paths: + - "rust/proto/**" + - ".github/workflows/buf.yml" + push: + tags: + - "v*" + schedule: + - cron: "0 8 * * *" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + proto: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + - uses: bufbuild/buf-action@8c6a16e16f12ba20b6470afa9c2ba9b5ba8c97c3 # v1.5.0 + with: + version: 1.72.0 + input: rust/proto + token: ${{ github.repository == 'vllm-project/vllm' && github.event_name != 'pull_request' && secrets.BUF_TOKEN || '' }} + format: false + breaking: false + pr_comment: false + push: false + - name: Publish nightly schema + if: github.repository == 'vllm-project/vllm' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + run: >- + buf push rust/proto + --create + --create-default-label main + --create-visibility public + --label nightly + --source-control-url "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" + - name: Publish release schema + if: github.repository == 'vllm-project/vllm' && github.event_name == 'push' + run: >- + buf push rust/proto + --create + --create-default-label main + --create-visibility public + --label main + --label "${GITHUB_REF_NAME}" + --source-control-url "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" diff --git a/rust/proto/README.md b/rust/proto/README.md new file mode 100644 index 0000000000..a9960f3bb8 --- /dev/null +++ b/rust/proto/README.md @@ -0,0 +1,12 @@ +# gRPC protocol + +This directory is the canonical source for vLLM's gRPC schema. + +The schema is published to `buf.build/vllm-project/vllm`: + +- A daily workflow publishes the latest Git `main` schema to the `nightly` label. +- The workflow can be run manually to retry nightly publication. +- Tags matching `v*` update the Buf `main` label and publish the corresponding release label. +- Buf commits and generated SDK versions are immutable and can be pinned by consumers. + +Repository setup requires a `BUF_TOKEN` GitHub Actions secret with permission to create and push the public Buf module. Register the Prost and Tonic generated SDKs for the `main` and `nightly` labels once so subsequent pushes generate them automatically. diff --git a/rust/proto/buf.md b/rust/proto/buf.md new file mode 100644 index 0000000000..065124feee --- /dev/null +++ b/rust/proto/buf.md @@ -0,0 +1,8 @@ +# vLLM gRPC API + +Protocol definitions for the optional gRPC server exposed by the vLLM Rust frontend. + +- `Inference` provides unary and streaming generation. +- `Control` provides discovery and request control. + +The `nightly` label is updated daily from vLLM's `main` branch. The `main` label tracks the latest vLLM release, and version labels match tags such as `v0.27.0`. Pin a Buf commit or generated SDK version for reproducible builds. diff --git a/rust/proto/buf.yaml b/rust/proto/buf.yaml new file mode 100644 index 0000000000..64764f561e --- /dev/null +++ b/rust/proto/buf.yaml @@ -0,0 +1,9 @@ +version: v2 +modules: + - path: . + name: buf.build/vllm-project/vllm +lint: + use: + - MINIMAL + except: + - PACKAGE_DIRECTORY_MATCH