1515# This file is a part of the vllm-ascend project.
1616#
1717
18- FROM quay.io/ ascend/cann:9.0.1-a3-ubuntu22.04-py3.12
18+ FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ ascend-ci /cann:9.0.1-a3-ubuntu22.04-py3.12
1919
20- ARG PIP_INDEX_URL="https://mirrors .tuna.tsinghua.edu.cn/pypi/web /simple"
20+ ARG PIP_INDEX_URL="https://pypi .tuna.tsinghua.edu.cn/simple"
2121ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22- ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2322ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
23+ ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2424ARG PIP_TRUSTED_HOST=""
2525ARG GIT_PROXY=""
26+ ARG APTMIRROR
2627
2728ENV DEBIAN_FRONTEND=noninteractive
2829
2930WORKDIR /workspace
3031
3132# Install clang-15 (for triton-ascend) and Mooncake
3233ARG MOONCAKE_TAG=0.3.11.post1
33- RUN apt-get update -y && \
34+ RUN if [ -n "$APTMIRROR" ]; then \
35+ sed -Ei "s@(ports|archive).ubuntu.com@${APTMIRROR#http://}@g" /etc/apt/sources.list; \
36+ fi && \
37+ apt-get update -y && \
3438 apt-get install -y git vim wget net-tools gcc g++ cmake numactl libnuma-dev libibverbs-dev libjemalloc2 libhiredis-dev clang-15 && \
3539 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3640 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
@@ -41,7 +45,6 @@ RUN apt-get update -y && \
4145
4246# Install modelscope (for fast download) and ray (for multinode)
4347RUN pip config set global.index-url ${PIP_INDEX_URL} && \
44- if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
4548 python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4649 python3 -m pip cache purge
4750
@@ -54,7 +57,7 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5457 git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5558 git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5659 else \
57- if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
60+ if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5861 git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5962 fi
6063# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
@@ -75,7 +78,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
7578 export VLLM_BATCH_INVARIANT=1 && \
7679 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7780 source /usr/local/Ascend/nnal/atb/set_env.sh && \
78- python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
81+ python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7982 python3 -m pip uninstall -y triton triton-ascend && \
8083 python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
8184 python3 -m pip cache purge
0 commit comments