Skip to content

Commit e9cc1fd

Browse files
authored
[CI/Build][CPU] Remove global extra index (#47687)
Signed-off-by: jiang1.li <jiang1.li@intel.com>
1 parent f1073c0 commit e9cc1fd

6 files changed

Lines changed: 9 additions & 18 deletions

File tree

docker/Dockerfile.cpu

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ FROM ubuntu:22.04 AS base-common
2525
WORKDIR /workspace
2626

2727
ARG PYTHON_VERSION=3.12
28-
ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
2928

3029
ARG max_jobs=32
3130
ENV MAX_JOBS=${max_jobs}
@@ -53,8 +52,6 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
5352
ENV UV_HTTP_TIMEOUT=500
5453

5554
# Install Python dependencies
56-
ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
57-
ENV UV_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
5855
ENV UV_INDEX_STRATEGY="unsafe-best-match"
5956
ENV UV_LINK_MODE="copy"
6057

@@ -64,7 +61,7 @@ COPY requirements/cpu.txt requirements/cpu.txt
6461

6562
RUN --mount=type=cache,target=/root/.cache/uv \
6663
uv pip install --upgrade pip && \
67-
uv pip install -r requirements/cpu.txt
64+
uv pip install -r requirements/cpu.txt --torch-backend cpu
6865

6966
ARG TARGETARCH
7067
ENV TARGETARCH=${TARGETARCH}
@@ -149,7 +146,7 @@ RUN if [ "$TARGETARCH" = "arm64" ] && [ "$VLLM_CPU_X86" != "0" ]; then \
149146
COPY requirements/build/cpu.txt requirements/build/cpu.txt
150147

151148
RUN --mount=type=cache,target=/root/.cache/uv \
152-
uv pip install -r requirements/build/cpu.txt
149+
uv pip install -r requirements/build/cpu.txt --torch-backend cpu
153150

154151
COPY . .
155152

@@ -205,7 +202,7 @@ RUN case "$(uname -m)" in \
205202
esac
206203

207204
RUN --mount=type=cache,target=/root/.cache/uv \
208-
uv pip install -r requirements/test/cpu.txt
205+
uv pip install -r requirements/test/cpu.txt --torch-backend cpu
209206

210207
######################### DEV IMAGE #########################
211208
FROM vllm-build AS vllm-dev
@@ -231,7 +228,7 @@ COPY --from=vllm-test-deps /vllm-workspace/requirements/test/cpu.txt requirement
231228

232229
RUN --mount=type=cache,target=/root/.cache/uv \
233230
uv pip install -r requirements/lint.txt && \
234-
uv pip install -r requirements/test/cpu.txt && \
231+
uv pip install -r requirements/test/cpu.txt --torch-backend cpu && \
235232
pre-commit install --hook-type pre-commit --hook-type commit-msg
236233

237234
ENTRYPOINT ["bash"]

docker/Dockerfile.s390x

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \
249249
NUMBA_WHL_FILE=$(ls /tmp/numba-wheels/*.whl) && \
250250
OPENCV_WHL_FILE=$(ls /tmp/opencv-wheels/*.whl) && \
251251
GUIDANCE_WHL_FILE=$(ls /tmp/guidance-wheels/*.whl) && \
252-
uv pip install -v \
252+
uv pip install -v \
253253
$ARROW_WHL_FILE \
254254
$VISION_WHL_FILE \
255255
$HF_XET_WHL_FILE \
256256
$LLVM_WHL_FILE \
257257
$NUMBA_WHL_FILE \
258258
$OPENCV_WHL_FILE \
259259
$GUIDANCE_WHL_FILE \
260+
--torch-backend cpu \
260261
--index-strategy unsafe-best-match \
261262
-r requirements/build/cpu.txt \
262263
-r requirements/cpu.txt

docs/getting_started/installation/cpu.apple.inc.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,10 @@ After installation of XCode and the Command Line Tools, which include Apple Clan
3535
```bash
3636
git clone https://github.com/vllm-project/vllm.git
3737
cd vllm
38-
uv pip install -r requirements/cpu.txt --index-strategy unsafe-best-match
38+
uv pip install -r requirements/cpu.txt
3939
uv pip install -e .
4040
```
4141

42-
!!! tip
43-
The `--index-strategy unsafe-best-match` flag is needed to resolve dependencies across multiple package indexes (PyTorch CPU index and PyPI). Without this flag, you may encounter `typing-extensions` version conflicts.
44-
45-
The term "unsafe" refers to the package resolution strategy, not security. By default, `uv` only searches the first index where a package is found to prevent dependency confusion attacks. This flag allows `uv` to search all configured indexes to find the best compatible versions. Since both PyTorch and PyPI are trusted package sources, using this strategy is safe and appropriate for vLLM installation.
46-
4742
!!! note
4843
On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu`, which is currently the only supported device.
4944

docs/getting_started/installation/cpu.s390x.inc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ Execute the following commands to build and install vLLM from source.
4848

4949
```bash
5050
uv pip install -v \
51-
--extra-index-url https://download.pytorch.org/whl/cpu \
52-
--torch-backend auto \
5351
-r requirements/build/cpu.txt \
5452
-r requirements/cpu.txt \
53+
--torch-backend cpu \
54+
--index-strategy unsafe-best-match && \
5555
VLLM_TARGET_DEVICE=cpu python setup.py bdist_wheel && \
5656
uv pip install dist/*.whl
5757
```

requirements/build/cpu.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
--extra-index-url https://download.pytorch.org/whl/cpu
21
cmake>=3.26.1
32
ninja
43
packaging>=24.2

requirements/cpu.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
--extra-index-url https://download.pytorch.org/whl/cpu
21
# Common dependencies
32
-r common.txt
43

0 commit comments

Comments
 (0)