2025-08-09 08:03:45 +08:00
|
|
|
FROM intel/deep-learning-essentials:2025.1.3-0-devel-ubuntu24.04 AS vllm-base
|
2024-06-18 02:01:25 +08:00
|
|
|
|
2025-03-19 01:29:25 -07:00
|
|
|
RUN rm /etc/apt/sources.list.d/intel-graphics.list
|
2024-06-18 02:01:25 +08:00
|
|
|
|
2025-08-09 08:03:45 +08:00
|
|
|
RUN apt clean && apt-get update -y && \
|
|
|
|
|
apt-get install -y software-properties-common && \
|
|
|
|
|
add-apt-repository ppa:deadsnakes/ppa && \
|
|
|
|
|
apt-get install -y python3.10 python3.10-distutils && \
|
|
|
|
|
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \
|
2024-09-27 23:45:50 -07:00
|
|
|
apt-get install -y --no-install-recommends --fix-missing \
|
|
|
|
|
curl \
|
|
|
|
|
ffmpeg \
|
|
|
|
|
git \
|
|
|
|
|
libsndfile1 \
|
|
|
|
|
libsm6 \
|
|
|
|
|
libxext6 \
|
|
|
|
|
libgl1 \
|
|
|
|
|
lsb-release \
|
|
|
|
|
numactl \
|
2025-08-09 08:03:45 +08:00
|
|
|
python3.10-dev \
|
2024-09-27 23:45:50 -07:00
|
|
|
wget
|
2024-06-18 02:01:25 +08:00
|
|
|
|
2025-08-09 08:03:45 +08:00
|
|
|
|
|
|
|
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
|
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
|
|
|
|
|
|
2024-06-18 02:01:25 +08:00
|
|
|
WORKDIR /workspace/vllm
|
2025-03-08 17:44:35 +01:00
|
|
|
COPY requirements/xpu.txt /workspace/vllm/requirements/xpu.txt
|
|
|
|
|
COPY requirements/common.txt /workspace/vllm/requirements/common.txt
|
2024-06-18 02:01:25 +08:00
|
|
|
|
2024-09-23 18:44:26 +02:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
2024-09-27 23:45:50 -07:00
|
|
|
pip install --no-cache-dir \
|
2025-03-08 17:44:35 +01:00
|
|
|
-r requirements/xpu.txt
|
2024-09-27 23:45:50 -07:00
|
|
|
|
2024-11-07 09:29:03 +08:00
|
|
|
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/"
|
|
|
|
|
|
2024-10-17 19:25:06 +02:00
|
|
|
COPY . .
|
2025-03-11 10:11:47 -07:00
|
|
|
ARG GIT_REPO_CHECK=0
|
2024-10-17 19:25:06 +02:00
|
|
|
RUN --mount=type=bind,source=.git,target=.git \
|
|
|
|
|
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
|
2024-09-27 23:45:50 -07:00
|
|
|
|
|
|
|
|
ENV VLLM_TARGET_DEVICE=xpu
|
2025-06-27 00:27:18 +08:00
|
|
|
ENV VLLM_WORKER_MULTIPROC_METHOD=spawn
|
2024-06-18 02:01:25 +08:00
|
|
|
|
2024-09-23 18:44:26 +02:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
--mount=type=bind,source=.git,target=.git \
|
2024-09-27 23:45:50 -07:00
|
|
|
python3 setup.py install
|
2024-06-18 02:01:25 +08:00
|
|
|
|
|
|
|
|
CMD ["/bin/bash"]
|
2024-09-27 23:45:50 -07:00
|
|
|
|
|
|
|
|
FROM vllm-base AS vllm-openai
|
|
|
|
|
|
|
|
|
|
# install additional dependencies for openai api server
|
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
2025-07-24 11:24:04 +08:00
|
|
|
pip install accelerate hf_transfer pytest pytest_asyncio lm_eval[api] modelscope
|
2024-09-27 23:45:50 -07:00
|
|
|
|
|
|
|
|
ENV VLLM_USAGE_SOURCE production-docker-image \
|
|
|
|
|
TRITON_XPU_PROFILE 1
|
2024-11-26 00:20:04 -08:00
|
|
|
# install development dependencies (for testing)
|
|
|
|
|
RUN python3 -m pip install -e tests/vllm_test_utils
|
2024-09-27 23:45:50 -07:00
|
|
|
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
|