A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 9, 12:30 UTC
[Feature]: Container image WORKDIR consistency (#33159)
Signed-off-by: SouthWest7 <am1ao@qq.com> Co-authored-by: SouthWest7 <am1ao@qq.com>
Xinan Miao committed
Jan 28, 2026 at 11:06 UTC
604e3b87e8456535a073348e210ad74cc28407ca
1 file changed
+17
-20
docker/Dockerfile.cpu
+17
-20
@@ -25,7 +25,7 @@
25
######################### COMMON BASE IMAGE #########################
26
FROM ubuntu:22.04 AS base-common
27
28
-WORKDIR /workspace/
28
+WORKDIR /workspace
29
30
ARG PYTHON_VERSION=3.12
31
ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
@@ -35,7 +35,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
35
--mount=type=cache,target=/var/lib/apt,sharing=locked \
36
apt-get update -y \
37
&& apt-get install -y --no-install-recommends sudo ccache git curl wget ca-certificates \
38
- gcc-12 g++-12 libtcmalloc-minimal4 libnuma-dev ffmpeg libsm6 libxext6 libgl1 jq lsof \
38
+ gcc-12 g++-12 libtcmalloc-minimal4 libnuma-dev ffmpeg libsm6 libxext6 libgl1 jq lsof \
39
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12 \
40
&& curl -LsSf https://astral.sh/uv/install.sh | sh
41
@@ -109,7 +109,7 @@ ENV VLLM_CPU_AVX512VNNI=${VLLM_CPU_AVX512VNNI}
109
ARG VLLM_CPU_AMXBF16=1
110
ENV VLLM_CPU_AMXBF16=${VLLM_CPU_AMXBF16}
111
112
-WORKDIR /workspace/vllm
112
+WORKDIR /vllm-workspace
113
114
# Copy build requirements
115
COPY requirements/cpu-build.txt requirements/build.txt
@@ -123,13 +123,13 @@ RUN if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
123
124
RUN --mount=type=cache,target=/root/.cache/uv \
125
--mount=type=cache,target=/root/.cache/ccache \
126
- --mount=type=cache,target=/workspace/vllm/.deps,sharing=locked \
126
+ --mount=type=cache,target=/vllm-workspace/.deps,sharing=locked \
127
VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38
128
129
######################### TEST DEPS #########################
130
FROM base AS vllm-test-deps
131
132
-WORKDIR /workspace/vllm
132
+WORKDIR /vllm-workspace
133
134
# Copy test requirements
135
COPY requirements/test.in requirements/cpu-test.in
@@ -138,12 +138,12 @@ COPY requirements/test.in requirements/cpu-test.in
138
RUN \
139
sed -i '/mamba_ssm/d' requirements/cpu-test.in && \
140
remove_packages_not_supported_on_aarch64() { \
141
- case "$(uname -m)" in \
142
- aarch64|arm64) \
143
- sed -i '/decord/d' requirements/cpu-test.in; \
144
- sed -i '/terratorch/d' requirements/cpu-test.in; \
145
- ;; \
146
- esac; \
141
+ case "$(uname -m)" in \
142
+ aarch64|arm64) \
143
+ sed -i '/decord/d' requirements/cpu-test.in; \
144
+ sed -i '/terratorch/d' requirements/cpu-test.in; \
145
+ ;; \
146
+ esac; \
147
}; \
148
remove_packages_not_supported_on_aarch64 && \
149
sed -i 's/^torch==.*/torch==2.10.0/g' requirements/cpu-test.in && \
@@ -157,7 +157,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
157
######################### DEV IMAGE #########################
158
FROM vllm-build AS vllm-dev
159
160
-WORKDIR /workspace/vllm
160
+WORKDIR /vllm-workspace
161
162
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
163
--mount=type=cache,target=/var/lib/apt,sharing=locked \
@@ -174,7 +174,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
174
--mount=type=bind,source=.git,target=.git \
175
VLLM_TARGET_DEVICE=cpu python3 setup.py develop
176
177
-COPY --from=vllm-test-deps /workspace/vllm/requirements/cpu-test.txt requirements/test.txt
177
+COPY --from=vllm-test-deps /vllm-workspace/requirements/cpu-test.txt requirements/test.txt
178
179
RUN --mount=type=cache,target=/root/.cache/uv \
180
uv pip install -r requirements/dev.txt && \
@@ -185,10 +185,10 @@ ENTRYPOINT ["bash"]
185
######################### TEST IMAGE #########################
186
FROM vllm-test-deps AS vllm-test
187
188
-WORKDIR /workspace/
188
+WORKDIR /vllm-workspace
189
190
RUN --mount=type=cache,target=/root/.cache/uv \
191
- --mount=type=bind,from=vllm-build,src=/workspace/vllm/dist,target=dist \
191
+ --mount=type=bind,from=vllm-build,src=/vllm-workspace/dist,target=dist \
192
uv pip install dist/*.whl
193
194
ADD ./tests/ ./tests/
@@ -197,9 +197,6 @@ ADD ./benchmarks/ ./benchmarks/
197
ADD ./vllm/collect_env.py .
198
ADD ./.buildkite/ ./.buildkite/
199
200
-# Create symlink for vllm-workspace to maintain CI compatibility
201
-RUN ln -sf /workspace /vllm-workspace
202
-
200
# install development dependencies (for testing)
201
RUN --mount=type=cache,target=/root/.cache/uv \
202
uv pip install -e tests/vllm_test_utils
@@ -207,11 +204,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
204
######################### RELEASE IMAGE #########################
205
FROM base AS vllm-openai
206
210
-WORKDIR /workspace/
207
+WORKDIR /vllm-workspace
208
209
RUN --mount=type=cache,target=/root/.cache/uv \
210
--mount=type=cache,target=/root/.cache/ccache \
214
- --mount=type=bind,from=vllm-build,src=/workspace/vllm/dist,target=dist \
211
+ --mount=type=bind,from=vllm-build,src=/vllm-workspace/dist,target=dist \
212
uv pip install dist/*.whl
213
214
# Add labels to document build configuration