Skip to content

fix(docker): install gRPC proto and servicer for vLLM images - #843

Merged
slin1237 merged 1 commit into
mainfrom
slin/docker-vllm-grpc
Mar 21, 2026
Merged

slin1237 merged 1 commit into
mainfrom
slin/docker-vllm-grpc

Conversation

@slin1237

@slin1237 slin1237 commented Mar 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Installs smg-grpc-proto and smg-grpc-servicer[vllm] in vLLM Docker images so gRPC mode works out of the box.

Problem

vLLM doesn't include gRPC support by default. The Docker image was built without the gRPC servicer, so running with --connection-mode grpc would fail.

Both build paths were affected:

  • Base image (vllm/vllm-openai:v0.17.0): no gRPC included
  • Source build (ENGINE_REPO set): install-vllm.sh uses --no-deps without [grpc] extra

What changed

  • docker/engine.Dockerfile: Added a conditional pip install step that runs only for vLLM images, installing smg-grpc-proto and smg-grpc-servicer[vllm] from PyPI after engine installation.

SGLang and TRT-LLM have native gRPC and are not affected.

Test plan

  • Build vLLM Docker image: docker build --build-arg BASE_IMAGE_REF=vllm/vllm-openai:v0.17.0 --build-arg ENGINE=vllm ...
  • Verify smg-grpc-servicer is importable inside the container
  • --connection-mode grpc works with vLLM backend

Summary by CodeRabbit

  • Chores
    • Enhanced Docker engine build configuration with updated container startup initialization
    • Optimized vllm engine dependency resolution for improved compatibility

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical dependency issue in vLLM Docker images by ensuring that gRPC support is properly installed. It addresses the problem where vLLM instances running in Docker could not utilize gRPC for communication, making the --connection-mode grpc option functional out of the box.

Highlights

  • gRPC Support for vLLM Docker Images: Enabled gRPC functionality for vLLM Docker images by installing the necessary smg-grpc-proto and smg-grpc-servicer[vllm] packages.
  • Conditional Installation: Implemented a conditional pip install step within docker/engine.Dockerfile that specifically targets and executes only when the ENGINE build argument is set to "vllm".
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Mar 21, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The docker/engine.Dockerfile has been updated to install vllm-specific gRPC packages conditionally when the ENGINE variable equals vllm, and an ENTRYPOINT directive has been added to specify the container startup command.

Changes

Cohort / File(s) Summary
Docker Engine Configuration
docker/engine.Dockerfile
Added conditional installation of smg-grpc-proto and smg-grpc-servicer[vllm] packages for vllm engine builds, and configured container ENTRYPOINT to invoke smg command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

grpc

Suggested reviewers

  • CatherineSue
  • gongwei-130
  • key4ng

Poem

🐰 A rabbit hops through Docker's neat layer,
vllm now whispers gRPC player,
ENTRYPOINT set for swift command start,
Proto packages load, each playing their part! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding gRPC proto and servicer installation for vLLM Docker images, which directly aligns with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slin/docker-vllm-grpc

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the docker Docker configuration changes label Mar 21, 2026
vLLM doesn't include gRPC support by default. The smg-grpc-proto and
smg-grpc-servicer packages (published to PyPI) provide the gRPC server
that wraps vLLM's Python API for SMG gateway communication.

Previously, gRPC was missing from both cases:
- Base image (vllm/vllm-openai) has no gRPC
- Source install (install-vllm.sh) uses --no-deps without [grpc] extra

The install runs after both install-smg.sh and install-vllm.sh (if used)
so it works regardless of whether vLLM came from the base image or source.

SGLang and TRT-LLM have native gRPC support and don't need this.

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@slin1237
slin1237 force-pushed the slin/docker-vllm-grpc branch from b5ade0b to 842c7f8 Compare March 21, 2026 01:52

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly adds the necessary gRPC dependencies to the vLLM Docker image, fixing an issue where gRPC mode would fail. The change is isolated to the engine.Dockerfile and conditionally installs smg-grpc-proto and smg-grpc-servicer[vllm] only when the engine is vllm. My feedback includes a minor suggestion to improve the shell syntax in the RUN command for better readability and adherence to common Dockerfile practices.

Comment thread docker/engine.Dockerfile
Comment on lines +67 to 70
fi \
&& if [ "${ENGINE}" = "vllm" ]; then \
pip install --no-cache-dir smg-grpc-proto "smg-grpc-servicer[vllm]"; \
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While functionally correct, the shell syntax here can be improved for readability and to follow common Dockerfile conventions. The fi \ && if... structure is unusual, and the trailing backslash on the pip install line is unnecessary. A cleaner way to chain these commands is to place && \ at the end of the line before the continuation.

       fi && \
    if [ "${ENGINE}" = "vllm" ]; then \
         pip install --no-cache-dir smg-grpc-proto "smg-grpc-servicer[vllm]"; \
    fi

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5ade0be5a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docker/engine.Dockerfile
bash /tmp/scripts/install-${ENGINE}.sh /opt/engine-src; \
fi \
&& if [ "${ENGINE}" = "vllm" ]; then \
pip install --no-cache-dir smg-grpc-proto "smg-grpc-servicer[vllm]"; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install gRPC deps from local checkout, not PyPI

This pip install pulls smg-grpc-proto and smg-grpc-servicer from PyPI instead of from the already-cloned /opt/smg-src tree, so the gRPC layer is no longer tied to the selected SMG_COMMIT. If someone builds with an unreleased SHA/branch (or any commit where gRPC code changed before publishing new wheels), the image can mix new SMG core code with older published gRPC packages and break --connection-mode grpc at runtime due to protocol/API skew.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docker/engine.Dockerfile`:
- Around line 68-70: The pip install line that runs when the shell variable
ENGINE equals "vllm" installs smg-grpc-proto and smg-grpc-servicer[vllm] without
version constraints; change the Dockerfile's install invocation (the conditional
block that checks ENGINE) to pin those packages to specific versions or at least
minimum versions (e.g., smg-grpc-proto==<VERSION> and
smg-grpc-servicer[vllm]==<VERSION> or using >=) to ensure reproducible builds
and compatibility.
- Line 72: The Dockerfile’s ENTRYPOINT ["smg"] lacks runtime hardening: add a
HEALTHCHECK that runs a lightweight probe (e.g., curl or the binary’s built-in
health endpoint) to allow orchestrators to detect unhealthy containers, and
create/switch to a non-root user before ENTRYPOINT (e.g., add a user/group,
chown the smg binary and any necessary dirs, then set USER) so the container
does not run as root; ensure the smg executable permissions and owned
directories are adjusted so the non-root user can execute ENTRYPOINT ["smg"] and
perform required I/O.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 160ad2d1-fcee-4c7d-9bf6-a3edcfce513b

📥 Commits

Reviewing files that changed from the base of the PR and between 6e95914 and 842c7f8.

📒 Files selected for processing (1)
  • docker/engine.Dockerfile

Comment thread docker/engine.Dockerfile
Comment thread docker/engine.Dockerfile
@slin1237
slin1237 merged commit 1b68ebc into main Mar 21, 2026
26 checks passed
@slin1237
slin1237 deleted the slin/docker-vllm-grpc branch March 21, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant