[CI/Build][CPU] Remove global extra index (#47687)

Signed-off-by: jiang1.li <jiang1.li@intel.com>

Li, Jiang committed Jul 6, 2026 at 13:42 UTC e9cc1fd0934ac115a14a69aebfbebf7ffeea85ee
6 files changed +9 -18
docker/Dockerfile.cpu
+4 -7
@@ -25,7 +25,6 @@ FROM ubuntu:22.04 AS base-common
25 WORKDIR /workspace
26
27 ARG PYTHON_VERSION=3.12
28 -ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
28
29 ARG max_jobs=32
30 ENV MAX_JOBS=${max_jobs}
@@ -53,8 +52,6 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
52 ENV UV_HTTP_TIMEOUT=500
53
54 # Install Python dependencies
56 -ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
57 -ENV UV_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
55 ENV UV_INDEX_STRATEGY="unsafe-best-match"
56 ENV UV_LINK_MODE="copy"
57
@@ -64,7 +61,7 @@ COPY requirements/cpu.txt requirements/cpu.txt
61
62 RUN --mount=type=cache,target=/root/.cache/uv \
63 uv pip install --upgrade pip && \
67 - uv pip install -r requirements/cpu.txt
64 + uv pip install -r requirements/cpu.txt --torch-backend cpu
65
66 ARG TARGETARCH
67 ENV TARGETARCH=${TARGETARCH}
@@ -149,7 +146,7 @@ RUN if [ "$TARGETARCH" = "arm64" ] && [ "$VLLM_CPU_X86" != "0" ]; then \
146 COPY requirements/build/cpu.txt requirements/build/cpu.txt
147
148 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
150
151 COPY . .
152
@@ -205,7 +202,7 @@ RUN case "$(uname -m)" in \
202 esac
203
204 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
206
207 ######################### DEV IMAGE #########################
208 FROM vllm-build AS vllm-dev
@@ -231,7 +228,7 @@ COPY --from=vllm-test-deps /vllm-workspace/requirements/test/cpu.txt requirement
228
229 RUN --mount=type=cache,target=/root/.cache/uv \
230 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 && \
232 pre-commit install --hook-type pre-commit --hook-type commit-msg
233
234 ENTRYPOINT ["bash"]
docker/Dockerfile.s390x
+2 -1
@@ -249,7 +249,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
249 NUMBA_WHL_FILE=$(ls /tmp/numba-wheels/*.whl) && \
250 OPENCV_WHL_FILE=$(ls /tmp/opencv-wheels/*.whl) && \
251 GUIDANCE_WHL_FILE=$(ls /tmp/guidance-wheels/*.whl) && \
252 - uv pip install -v \
252 + uv pip install -v \
253 $ARROW_WHL_FILE \
254 $VISION_WHL_FILE \
255 $HF_XET_WHL_FILE \
@@ -257,6 +257,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
257 $NUMBA_WHL_FILE \
258 $OPENCV_WHL_FILE \
259 $GUIDANCE_WHL_FILE \
260 + --torch-backend cpu \
261 --index-strategy unsafe-best-match \
262 -r requirements/build/cpu.txt \
263 -r requirements/cpu.txt
docs/getting_started/installation/cpu.apple.inc.md
+1 -6
@@ -35,15 +35,10 @@ After installation of XCode and the Command Line Tools, which include Apple Clan
35 ```bash
36 git clone https://github.com/vllm-project/vllm.git
37 cd vllm
38 -uv pip install -r requirements/cpu.txt --index-strategy unsafe-best-match
38 +uv pip install -r requirements/cpu.txt
39 uv pip install -e .
40 ```
41
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 -
42 !!! note
43 On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu`, which is currently the only supported device.
44
docs/getting_started/installation/cpu.s390x.inc.md
+2 -2
@@ -48,10 +48,10 @@ Execute the following commands to build and install vLLM from source.
48
49 ```bash
50 uv pip install -v \
51 - --extra-index-url https://download.pytorch.org/whl/cpu \
52 - --torch-backend auto \
51 -r requirements/build/cpu.txt \
52 -r requirements/cpu.txt \
53 + --torch-backend cpu \
54 + --index-strategy unsafe-best-match && \
55 VLLM_TARGET_DEVICE=cpu python setup.py bdist_wheel && \
56 uv pip install dist/*.whl
57 ```
requirements/build/cpu.txt
-1
@@ -1,4 +1,3 @@
1 ---extra-index-url https://download.pytorch.org/whl/cpu
1 cmake>=3.26.1
2 ninja
3 packaging>=24.2
requirements/cpu.txt
-1
@@ -1,4 +1,3 @@
1 ---extra-index-url https://download.pytorch.org/whl/cpu
1 # Common dependencies
2 -r common.txt
3