Skip to content

ci(docker): add engine-specific image build pipelines - #651

Merged
slin1237 merged 1 commit into
mainfrom
gongwei/docker-engine-builds
Mar 6, 2026
Merged

slin1237 merged 1 commit into
mainfrom
gongwei/docker-engine-builds

Conversation

@slin1237

@slin1237 slin1237 commented Mar 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Add separate Docker workflows and a shared Dockerfile for building engine-specific images (SGLang, vLLM, TRT-LLM). Each workflow builds from a common base image with modular install scripts.

Re-opened from #604 with corrected commit metadata.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced automated Docker image release workflows for SGLang, TRTLLM, and vLLM inference engines, enabling users to easily build and publish customized images with configurable base images and specific commit references.
  • Chores

    • Added installation scripts for streamlined setup of multiple inference engine backends (SGLang, TRTLLM, vLLM, TGL) and required system dependencies.

Add separate Docker workflows and a shared Dockerfile for building
engine-specific images (SGLang, vLLM, TRT-LLM). Each workflow builds
from a common base image with modular install scripts.

Co-authored-by: gongwei-130 <weigong28@gmail.com>
Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@github-actions github-actions Bot added ci CI/CD configuration changes docker Docker configuration changes labels Mar 6, 2026
@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 significantly enhances the Docker build infrastructure by introducing a flexible, engine-agnostic Dockerfile and corresponding installation scripts. This change allows for the creation of specialized Docker images for different large language model engines like SGLang, vLLM, and TRT-LLM, all while leveraging a shared base and modular installation logic. The primary impact is a more streamlined and maintainable process for building and deploying these engine-specific environments.

Highlights

  • New Dockerfile for Engine-Specific Builds: Introduced a new multi-stage Dockerfile.engine to build Docker images tailored for various LLM engines (SGLang, vLLM, TRT-LLM, TGL).
  • Modular Installation Scripts: Implemented dedicated installation scripts for each engine (install-vllm.sh, install-sglang.sh, install-trtllm.sh, install-tgl.sh) and a shared script for SMG (install-smg.sh), promoting modularity.
  • Common Base Image Strategy: Enabled the construction of engine-specific images from a common base, enhancing reusability and consistency across different engine environments.
Changelog
  • docker/Dockerfile.engine
    • Added a new multi-stage Dockerfile to support building images for vLLM, SGLang, TRT-LLM, and TGL.
  • scripts/installation/install-sglang.sh
    • Added a new shell script for installing SGLang from source.
  • scripts/installation/install-smg.sh
    • Added a new shell script for installing SMG from source, including dependencies like Git, build-essential, Protobuf, and Rust.
  • scripts/installation/install-tgl.sh
    • Added a new shell script for installing TGL from source.
  • scripts/installation/install-trtllm.sh
    • Added a new shell script for installing TRT-LLM from source, handling Git LFS and submodules.
  • scripts/installation/install-vllm.sh
    • Added a new shell script for installing vLLM from source.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/release-sglang-docker.yml
    • .github/workflows/release-trtllm-docker.yml
    • .github/workflows/release-vllm-docker.yml
Activity
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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. ↩

@slin1237
slin1237 merged commit 70edc4a into main Mar 6, 2026
9 of 11 checks passed
@slin1237
slin1237 deleted the gongwei/docker-engine-builds branch March 6, 2026 00:00
@coderabbitai

coderabbitai Bot commented Mar 6, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ae8d871a-c105-469d-b867-5c2f0145d5c5

📥 Commits

Reviewing files that changed from the base of the PR and between f102828 and e31addf.

📒 Files selected for processing (9)
  • .github/workflows/release-sglang-docker.yml
  • .github/workflows/release-trtllm-docker.yml
  • .github/workflows/release-vllm-docker.yml
  • docker/Dockerfile.engine
  • scripts/installation/install-sglang.sh
  • scripts/installation/install-smg.sh
  • scripts/installation/install-tgl.sh
  • scripts/installation/install-trtllm.sh
  • scripts/installation/install-vllm.sh

📝 Walkthrough

Walkthrough

This pull request introduces a complete Docker image release pipeline for SMG with engine-specific variants (vLLM, SGLang, TRTLLM). It adds three GitHub Actions workflows that build and publish tagged images to GHCR with configurable engine repositories, a multi-stage Dockerfile for engine-specific builds, and five installation scripts for deploying different engine backends.

Changes

Cohort / File(s) Summary
Release Workflows
.github/workflows/release-vllm-docker.yml, .github/workflows/release-sglang-docker.yml, .github/workflows/release-trtllm-docker.yml
Three workflow_dispatch-triggered pipelines for building and publishing engine-specific Docker images to GHCR. Each accepts inputs for base image, engine repo/commit, SMG repo/commit, and optional tag. Workflows handle checkout, Docker Buildx setup, GHCR authentication, dynamic image tagging via version derivation, multi-arg image builds, and push to ghcr.io with final summary output. Release-trtllm includes conditional base image build logic and post-push cleanup.
Docker Build Infrastructure
docker/Dockerfile.engine
Multi-stage Dockerfile with a sources stage and four engine-specific targets (custom-vllm, custom-sglang, custom-trtllm, custom-tgl). Accepts build args for engine/SMG repos and commits. Each target conditionally installs engine and SMG sources from the sources stage, copies installation scripts, and executes them based on provided repository references.
Installation Scripts
scripts/installation/install-smg.sh, scripts/installation/install-vllm.sh, scripts/installation/install-sglang.sh, scripts/installation/install-trtllm.sh, scripts/installation/install-tgl.sh
Five shell scripts for building and installing engine packages from source. Install-smg.sh is the most complex, installing system dependencies, protoc, Rust toolchain, maturin, and building Python bindings with vendored OpenSSL. Other install scripts perform simpler source-based pip installs with engine-specific setup (git-lfs for trtllm, submodule init for trtllm, precompiled flag for vllm).

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant GHA as GitHub Actions
    participant GHRepo as GitHub Repos<br/>(SMG, Engine)
    participant Docker as Docker Buildx
    participant GHCR as GitHub<br/>Container Registry

    User->>GHA: Trigger workflow_dispatch<br/>(base_image, engine_repo, smg_repo, tag)
    GHA->>GHRepo: Checkout SMG & Engine repos
    GHRepo-->>GHA: Source code
    GHA->>GHCR: Authenticate (GHCR login)
    GHCR-->>GHA: Auth token
    GHA->>GHA: Resolve image_tag<br/>(use provided tag or derive<br/>from version strings)
    GHA->>Docker: Build multi-stage image<br/>(sources → engine-specific target)<br/>with engine/SMG build args
    Docker->>GHRepo: Clone engine repo (if needed)<br/>during build
    GHRepo-->>Docker: Engine source code
    Docker->>Docker: Execute install scripts<br/>(install-smg.sh, install-engine.sh)
    Docker-->>GHA: Built image
    GHA->>GHCR: Tag & push image to<br/>ghcr.io/smg:image_tag
    GHCR-->>GHA: Pushed successfully
    GHA->>User: Output final image name<br/>in job summary
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • Setup Docker Release workflow #5: Implements the requested Docker image build and release automation for engine-specific variants with configurable source repositories and version tagging.

Possibly related PRs

Suggested labels

ci, docker

Suggested reviewers

  • CatherineSue
  • key4ng
  • XinyueZhang369

Poem

🐰 Workflows spin and Dockerfiles compile,
Engine variants stack in organized style,
GHCR awaits each freshly baked image,
From source repos cloned—no chaotic damage,
Install scripts whisper sweet setup spells,
Release pipelines ring their CI/CD bells! 🔔

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gongwei/docker-engine-builds

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

@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: e31addf3d6

ℹ️ 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/Dockerfile.engine
Comment on lines +13 to +14
git clone --depth 1 "${ENGINE_REPO}" /opt/engine-sr \
&& ( cd /opt/engine-src && ( [ "${ENGINE_COMMIT}" = "latest" ] || git checkout "${ENGINE_COMMIT}" ) ); \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Clone engine into the directory used for checkout

When ENGINE_REPO is provided, this step clones into /opt/engine-sr but then immediately runs cd /opt/engine-src for checkout. In runs where users set engine repo inputs (the intended “refresh engine code” path), /opt/engine-src does not exist and the Docker build fails before any engine install step can run.

Useful? React with 👍 / 👎.

Comment thread docker/Dockerfile.engine
Comment on lines +16 to +17
&& git clone --depth 1 "${SMG_REPO}" /tmp/smg-src \
&& ( cd /tmp/smg-src && ( [ "${SMG_COMMIT}" = "latest" ] || git checkout "${SMG_COMMIT}" ) )

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 Fetch full history before checking out requested refs

This uses git clone --depth 1 and then conditionally checks out SMG_COMMIT; if the input is a tag/SHA that is not the default-branch tip (which the workflow inputs explicitly allow), the object is missing from a shallow clone and checkout fails. The same shallow-clone-plus-checkout pattern is also used for ENGINE_COMMIT, so non-HEAD engine refs are affected too.

Useful? React with 👍 / 👎.

@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 introduces a modular approach for building engine-specific Docker images using a multi-stage Dockerfile and separate installation scripts. The overall structure is good, but I've identified a critical path error in the Dockerfile that will prevent builds from succeeding. I've also included a suggestion to improve the Dockerfile's maintainability by reducing code duplication across the different build stages.

Comment thread docker/Dockerfile.engine
ARG SMG_COMMIT
RUN apk add --no-cache git \
&& if [ -n "${ENGINE_REPO}" ] && [ -n "${ENGINE_COMMIT}" ]; then \
git clone --depth 1 "${ENGINE_REPO}" /opt/engine-sr \

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.

critical

There's a typo in the destination path of the git clone command. It's set to /opt/engine-sr, but the subsequent cd command on line 14 attempts to access /opt/engine-src. This will cause the RUN command to fail.

Please correct the destination path to /opt/engine-src.

         git clone --depth 1 "${ENGINE_REPO}" /opt/engine-src \

Comment thread docker/Dockerfile.engine
Comment on lines +26 to +68
FROM ${BASE_IMAGE_REF} AS custom-vllm

ARG ENGINE_REPO
ENV SMG_DEFAULT_BACKEND=vllm
COPY --from=sources /opt/engine-src /opt/vllm-src
COPY --from=sources /tmp/smg-src /opt/smg-src
COPY --from=sources /tmp/install-vllm.sh /tmp/install-vllm.sh
COPY --from=sources /tmp/install-smg.sh /tmp/install-smg.sh
RUN bash /tmp/install-smg.sh /opt/smg-src
RUN if [ -n "${ENGINE_REPO}" ]; then bash /tmp/install-vllm.sh /opt/vllm-src; fi

FROM ${BASE_IMAGE_REF} AS custom-sglang

ARG ENGINE_REPO
ENV SMG_DEFAULT_BACKEND=sglang
COPY --from=sources /opt/engine-src /opt/sglang-src
COPY --from=sources /tmp/smg-src /opt/smg-src
COPY --from=sources /tmp/install-sglang.sh /tmp/install-sglang.sh
COPY --from=sources /tmp/install-smg.sh /tmp/install-smg.sh
RUN bash /tmp/install-smg.sh /opt/smg-src
RUN if [ -n "${ENGINE_REPO}" ]; then bash /tmp/install-sglang.sh /opt/sglang-src; fi

FROM ${BASE_IMAGE_REF} AS custom-trtllm

ARG ENGINE_REPO
ENV SMG_DEFAULT_BACKEND=trtllm
COPY --from=sources /opt/engine-src /opt/trtllm-src
COPY --from=sources /tmp/smg-src /opt/smg-src
COPY --from=sources /tmp/install-trtllm.sh /tmp/install-trtllm.sh
COPY --from=sources /tmp/install-smg.sh /tmp/install-smg.sh
RUN bash /tmp/install-smg.sh /opt/smg-src
RUN if [ -n "${ENGINE_REPO}" ]; then bash /tmp/install-trtllm.sh /opt/trtllm-src; fi

FROM ${BASE_IMAGE_REF} AS custom-tgl

ARG ENGINE_REPO
ENV SMG_DEFAULT_BACKEND=sglang
COPY --from=sources /opt/engine-src /opt/tgl-src
COPY --from=sources /tmp/smg-src /opt/smg-src
COPY --from=sources /tmp/install-tgl.sh /tmp/install-tgl.sh
COPY --from=sources /tmp/install-smg.sh /tmp/install-smg.sh
RUN bash /tmp/install-smg.sh /opt/smg-src
RUN if [ -n "${ENGINE_REPO}" ]; then bash /tmp/install-tgl.sh /opt/tgl-src; 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

The stages for custom-vllm, custom-sglang, custom-trtllm, and custom-tgl all repeat the same set of commands to copy and install smg. This code duplication can make the Dockerfile harder to maintain, as any changes to the smg installation process would need to be updated in four different places.

To improve this, consider introducing a common intermediate stage that handles the smg installation. The engine-specific stages could then use this common stage as their base, reducing repetition.

For example:

# ... after 'sources' stage

FROM ${BASE_IMAGE_REF} AS smg-installed
COPY --from=sources /tmp/smg-src /opt/smg-src
COPY --from=sources /tmp/install-smg.sh /tmp/install-smg.sh
RUN bash /tmp/install-smg.sh /opt/smg-src

FROM smg-installed AS custom-vllm
# ... vllm-specific installation ...

FROM smg-installed AS custom-sglang
# ... sglang-specific installation ...

vschandramourya pushed a commit that referenced this pull request Mar 6, 2026
Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
Co-authored-by: gongwei-130 <weigong28@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes docker Docker configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant