@@ -27,6 +27,9 @@ RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
27
27
&& ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
28
28
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
29
29
&& python3 --version && python3 -m pip --version
30
+ # Install uv for faster pip installs
31
+ RUN --mount=type=cache,target=/root/.cache/pip \
32
+ python3 -m pip install uv
30
33
31
34
# Upgrade to GCC 10 to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92519
32
35
# as it was causing spam when compiling the CUTLASS kernels
@@ -52,13 +55,13 @@ WORKDIR /workspace
52
55
# after this step
53
56
RUN --mount=type=cache,target=/root/.cache/pip \
54
57
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
55
- python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cu126 "torch==2.7.0.dev20250121+cu126" "torchvision==0.22.0.dev20250121" ; \
58
+ uv pip install --system --index-url https://download.pytorch.org/whl/nightly/cu126 "torch==2.7.0.dev20250121+cu126" "torchvision==0.22.0.dev20250121" ; \
56
59
fi
57
60
58
61
COPY requirements-common.txt requirements-common.txt
59
62
COPY requirements-cuda.txt requirements-cuda.txt
60
63
RUN --mount=type=cache,target=/root/.cache/pip \
61
- python3 -m pip install -r requirements-cuda.txt
64
+ uv pip install --system -r requirements-cuda.txt
62
65
63
66
# cuda arch list used by torch
64
67
# can be useful for both `dev` and `test`
@@ -79,7 +82,7 @@ ARG TARGETPLATFORM
79
82
COPY requirements-build.txt requirements-build.txt
80
83
81
84
RUN --mount=type=cache,target=/root/.cache/pip \
82
- python3 -m pip install -r requirements-build.txt
85
+ uv pip install --system -r requirements-build.txt
83
86
84
87
COPY . .
85
88
ARG GIT_REPO_CHECK=0
@@ -144,7 +147,7 @@ COPY requirements-lint.txt requirements-lint.txt
144
147
COPY requirements-test.txt requirements-test.txt
145
148
COPY requirements-dev.txt requirements-dev.txt
146
149
RUN --mount=type=cache,target=/root/.cache/pip \
147
- python3 -m pip install -r requirements-dev.txt
150
+ uv pip install --system -r requirements-dev.txt
148
151
# ################### DEV IMAGE ####################
149
152
150
153
# ################### vLLM installation IMAGE ####################
@@ -174,6 +177,9 @@ RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
174
177
&& ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
175
178
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
176
179
&& python3 --version && python3 -m pip --version
180
+ # Install uv for faster pip installs
181
+ RUN --mount=type=cache,target=/root/.cache/pip \
182
+ python3 -m pip install uv
177
183
178
184
# Workaround for https://github.com/openai/triton/issues/2507 and
179
185
# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
@@ -187,13 +193,13 @@ RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
187
193
# after this step
188
194
RUN --mount=type=cache,target=/root/.cache/pip \
189
195
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
190
- python3 -m pip install --index-url https://download.pytorch.org/whl/nightly/cu124 "torch==2.6.0.dev20241210+cu124" "torchvision==0.22.0.dev20241215" ; \
196
+ uv pip install --system --index-url https://download.pytorch.org/whl/nightly/cu124 "torch==2.6.0.dev20241210+cu124" "torchvision==0.22.0.dev20241215" ; \
191
197
fi
192
198
193
199
# Install vllm wheel first, so that torch etc will be installed.
194
200
RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/dist \
195
201
--mount=type=cache,target=/root/.cache/pip \
196
- python3 -m pip install dist/*.whl --verbose
202
+ uv pip install --system dist/*.whl --verbose
197
203
198
204
# If we need to build FlashInfer wheel before its release:
199
205
# $ export FLASHINFER_ENABLE_AOT=1
@@ -210,7 +216,7 @@ RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/dist
210
216
RUN --mount=type=cache,target=/root/.cache/pip \
211
217
. /etc/environment && \
212
218
if [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
213
- python3 -m pip install https://github.com/flashinfer-ai/flashinfer/releases/download/v0.2.1.post1/flashinfer_python-0.2.1.post1+cu124torch2.5-cp38-abi3-linux_x86_64.whl ; \
219
+ uv pip install --system https://github.com/flashinfer-ai/flashinfer/releases/download/v0.2.1.post1/flashinfer_python-0.2.1.post1+cu124torch2.5-cp38-abi3-linux_x86_64.whl ; \
214
220
fi
215
221
COPY examples examples
216
222
@@ -220,7 +226,7 @@ COPY examples examples
220
226
# TODO: Remove this once FlashInfer AOT wheel is fixed
221
227
COPY requirements-build.txt requirements-build.txt
222
228
RUN --mount=type=cache,target=/root/.cache/pip \
223
- python3 -m pip install -r requirements-build.txt
229
+ uv pip install --system -r requirements-build.txt
224
230
225
231
# ################### vLLM installation IMAGE ####################
226
232
@@ -233,15 +239,15 @@ ADD . /vllm-workspace/
233
239
234
240
# install development dependencies (for testing)
235
241
RUN --mount=type=cache,target=/root/.cache/pip \
236
- python3 -m pip install -r requirements-dev.txt
242
+ uv pip install --system -r requirements-dev.txt
237
243
238
244
# install development dependencies (for testing)
239
245
RUN --mount=type=cache,target=/root/.cache/pip \
240
- python3 -m pip install -e tests/vllm_test_utils
246
+ uv pip install --system -e tests/vllm_test_utils
241
247
242
248
# enable fast downloads from hf (for testing)
243
249
RUN --mount=type=cache,target=/root/.cache/pip \
244
- python3 -m pip install hf_transfer
250
+ uv pip install --system hf_transfer
245
251
ENV HF_HUB_ENABLE_HF_TRANSFER 1
246
252
247
253
# Copy in the v1 package for testing (it isn't distributed yet)
@@ -262,9 +268,9 @@ FROM vllm-base AS vllm-openai-base
262
268
# install additional dependencies for openai api server
263
269
RUN --mount=type=cache,target=/root/.cache/pip \
264
270
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
265
- pip install accelerate hf_transfer 'modelscope!=1.15.0' 'bitsandbytes>=0.42.0' 'timm==0.9.10' boto3 runai-model-streamer runai-model-streamer[s3]; \
271
+ uv pip install --system accelerate hf_transfer 'modelscope!=1.15.0' 'bitsandbytes>=0.42.0' 'timm==0.9.10' boto3 runai-model-streamer runai-model-streamer[s3]; \
266
272
else \
267
- pip install accelerate hf_transfer 'modelscope!=1.15.0' 'bitsandbytes>=0.45.0' 'timm==0.9.10' boto3 runai-model-streamer runai-model-streamer[s3]; \
273
+ uv pip install --system accelerate hf_transfer 'modelscope!=1.15.0' 'bitsandbytes>=0.45.0' 'timm==0.9.10' boto3 runai-model-streamer runai-model-streamer[s3]; \
268
274
fi
269
275
270
276
ENV VLLM_USAGE_SOURCE production-docker-image
0 commit comments