Skip to content

Commit 2e77041

Browse files
thomasdhcclaude
andauthored
ci(docker): make the fw_base vLLM wheel build optional (#5725)
Signed-off-by: Dong Hyuk Chang <9426164+thomasdhc@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent a95a3da commit 2e77041

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

docker/Dockerfile.fw_base

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
# limitations under the License.
1414

1515
# Build layer variables
16-
# Supported mode: FW_DEP_BUILDER=base, FW_BASE_FINAL=fw_toolkit_builder
16+
# Supported mode: FW_DEP_BUILDER=base, FW_BASE_FINAL=fw_toolkit_builder,
17+
# VLLM_WHEEL_SRC=vllm_wheel_build|vllm_wheel_none
1718
# TRT-LLM stages are not present in this Dockerfile.
1819
ARG FW_DEP_BUILDER
1920
ARG FW_BASE_FINAL
21+
ARG VLLM_WHEEL_SRC=vllm_wheel_build
2022

2123
ARG NEMO_FW_BASE_IMAGE
2224
FROM ${NEMO_FW_BASE_IMAGE} AS base
@@ -31,7 +33,7 @@ ENV NVIDIA_PRODUCT_NAME="NeMo Framework" \
3133
##
3234
##############################################################################
3335

34-
FROM base AS vllm_wheel
36+
FROM base AS vllm_wheel_build
3537

3638
ARG VLLM_VERSION=v0.14.1
3739
ARG MAX_JOBS=4
@@ -47,6 +49,13 @@ RUN mkdir -p /src/vllm && \
4749
pip install -r requirements/build/cuda.txt && \
4850
pip wheel --no-deps --no-build-isolation -v .
4951

52+
# /src/vllm must exist for the install step's bind mount.
53+
FROM base AS vllm_wheel_none
54+
55+
RUN mkdir -p /src/vllm
56+
57+
FROM ${VLLM_WHEEL_SRC} AS vllm_wheel
58+
5059
##############################################################################
5160
##
5261
## Top layer of FW_BASE container
@@ -127,10 +136,14 @@ RUN --mount=type=bind,source=docker/common/install_nsys.sh,target=/opt/install_n
127136
# Copy Wheels
128137
RUN --mount=type=bind,from=vllm_wheel,source=/src/vllm/,target=/tmp/vllm/ \
129138
--mount=type=bind,source=docker/patches/vllm.patch,target=/opt/vllm.patch \
139+
if ! compgen -G "/tmp/vllm/vllm*.whl" >/dev/null; then \
140+
echo "No vLLM wheel produced; skipping vLLM install."; \
141+
else \
130142
pip install /tmp/vllm/vllm*.whl && \
131143
pushd /usr/local/lib/python3.12/dist-packages/vllm && \
132144
patch -p1 < /opt/vllm.patch && \
133-
popd
145+
popd; \
146+
fi
134147

135148
##############################################################################
136149
##

docker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ docker build \
132132
| `FW_BASE_FINAL` | Output stage. `trtllm_install` (with TRT-LLM) or `fw_toolkit_builder` (without) |
133133
| `UV_VERSION` | uv version to install |
134134
| `VLLM_VERSION` | vLLM git tag to build |
135+
| `VLLM_WHEEL_SRC` | Stage supplying the vLLM wheel. `vllm_wheel_build` (default) builds it from source; `vllm_wheel_none` skips both the build and the install |
135136
| `TRT_LLM_COMMIT` | TensorRT-LLM git commit or tag |
136137
| `TRT_LLM_VERSION` | TensorRT-LLM version string embedded as an image environment variable |
137138
| `TRT_VER` | TensorRT version for the TRT-LLM install scripts |

0 commit comments

Comments
 (0)