[CI/Build][CPU] Remove global extra index (#47687)
Signed-off-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
@@ -25,7 +25,6 @@ FROM ubuntu:22.04 AS base-common
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
ARG PYTHON_VERSION=3.12
|
ARG PYTHON_VERSION=3.12
|
||||||
ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
|
|
||||||
|
|
||||||
ARG max_jobs=32
|
ARG max_jobs=32
|
||||||
ENV MAX_JOBS=${max_jobs}
|
ENV MAX_JOBS=${max_jobs}
|
||||||
@@ -53,8 +52,6 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|||||||
ENV UV_HTTP_TIMEOUT=500
|
ENV UV_HTTP_TIMEOUT=500
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
|
|
||||||
ENV UV_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
|
|
||||||
ENV UV_INDEX_STRATEGY="unsafe-best-match"
|
ENV UV_INDEX_STRATEGY="unsafe-best-match"
|
||||||
ENV UV_LINK_MODE="copy"
|
ENV UV_LINK_MODE="copy"
|
||||||
|
|
||||||
@@ -64,7 +61,7 @@ COPY requirements/cpu.txt requirements/cpu.txt
|
|||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv pip install --upgrade pip && \
|
uv pip install --upgrade pip && \
|
||||||
uv pip install -r requirements/cpu.txt
|
uv pip install -r requirements/cpu.txt --torch-backend cpu
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ENV TARGETARCH=${TARGETARCH}
|
ENV TARGETARCH=${TARGETARCH}
|
||||||
@@ -149,7 +146,7 @@ RUN if [ "$TARGETARCH" = "arm64" ] && [ "$VLLM_CPU_X86" != "0" ]; then \
|
|||||||
COPY requirements/build/cpu.txt requirements/build/cpu.txt
|
COPY requirements/build/cpu.txt requirements/build/cpu.txt
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv pip install -r requirements/build/cpu.txt
|
uv pip install -r requirements/build/cpu.txt --torch-backend cpu
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
@@ -205,7 +202,7 @@ RUN case "$(uname -m)" in \
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv pip install -r requirements/test/cpu.txt
|
uv pip install -r requirements/test/cpu.txt --torch-backend cpu
|
||||||
|
|
||||||
######################### DEV IMAGE #########################
|
######################### DEV IMAGE #########################
|
||||||
FROM vllm-build AS vllm-dev
|
FROM vllm-build AS vllm-dev
|
||||||
@@ -231,7 +228,7 @@ COPY --from=vllm-test-deps /vllm-workspace/requirements/test/cpu.txt requirement
|
|||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv pip install -r requirements/lint.txt && \
|
uv pip install -r requirements/lint.txt && \
|
||||||
uv pip install -r requirements/test/cpu.txt && \
|
uv pip install -r requirements/test/cpu.txt --torch-backend cpu && \
|
||||||
pre-commit install --hook-type pre-commit --hook-type commit-msg
|
pre-commit install --hook-type pre-commit --hook-type commit-msg
|
||||||
|
|
||||||
ENTRYPOINT ["bash"]
|
ENTRYPOINT ["bash"]
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
NUMBA_WHL_FILE=$(ls /tmp/numba-wheels/*.whl) && \
|
NUMBA_WHL_FILE=$(ls /tmp/numba-wheels/*.whl) && \
|
||||||
OPENCV_WHL_FILE=$(ls /tmp/opencv-wheels/*.whl) && \
|
OPENCV_WHL_FILE=$(ls /tmp/opencv-wheels/*.whl) && \
|
||||||
GUIDANCE_WHL_FILE=$(ls /tmp/guidance-wheels/*.whl) && \
|
GUIDANCE_WHL_FILE=$(ls /tmp/guidance-wheels/*.whl) && \
|
||||||
uv pip install -v \
|
uv pip install -v \
|
||||||
$ARROW_WHL_FILE \
|
$ARROW_WHL_FILE \
|
||||||
$VISION_WHL_FILE \
|
$VISION_WHL_FILE \
|
||||||
$HF_XET_WHL_FILE \
|
$HF_XET_WHL_FILE \
|
||||||
@@ -257,6 +257,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
$NUMBA_WHL_FILE \
|
$NUMBA_WHL_FILE \
|
||||||
$OPENCV_WHL_FILE \
|
$OPENCV_WHL_FILE \
|
||||||
$GUIDANCE_WHL_FILE \
|
$GUIDANCE_WHL_FILE \
|
||||||
|
--torch-backend cpu \
|
||||||
--index-strategy unsafe-best-match \
|
--index-strategy unsafe-best-match \
|
||||||
-r requirements/build/cpu.txt \
|
-r requirements/build/cpu.txt \
|
||||||
-r requirements/cpu.txt
|
-r requirements/cpu.txt
|
||||||
|
|||||||
@@ -35,15 +35,10 @@ After installation of XCode and the Command Line Tools, which include Apple Clan
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/vllm-project/vllm.git
|
git clone https://github.com/vllm-project/vllm.git
|
||||||
cd vllm
|
cd vllm
|
||||||
uv pip install -r requirements/cpu.txt --index-strategy unsafe-best-match
|
uv pip install -r requirements/cpu.txt
|
||||||
uv pip install -e .
|
uv pip install -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! tip
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu`, which is currently the only supported device.
|
On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu`, which is currently the only supported device.
|
||||||
|
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ Execute the following commands to build and install vLLM from source.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
uv pip install -v \
|
uv pip install -v \
|
||||||
--extra-index-url https://download.pytorch.org/whl/cpu \
|
|
||||||
--torch-backend auto \
|
|
||||||
-r requirements/build/cpu.txt \
|
-r requirements/build/cpu.txt \
|
||||||
-r requirements/cpu.txt \
|
-r requirements/cpu.txt \
|
||||||
|
--torch-backend cpu \
|
||||||
|
--index-strategy unsafe-best-match && \
|
||||||
VLLM_TARGET_DEVICE=cpu python setup.py bdist_wheel && \
|
VLLM_TARGET_DEVICE=cpu python setup.py bdist_wheel && \
|
||||||
uv pip install dist/*.whl
|
uv pip install dist/*.whl
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cpu
|
|
||||||
cmake>=3.26.1
|
cmake>=3.26.1
|
||||||
ninja
|
ninja
|
||||||
packaging>=24.2
|
packaging>=24.2
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cpu
|
|
||||||
# Common dependencies
|
# Common dependencies
|
||||||
-r common.txt
|
-r common.txt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user