1818FROM quay.io/ascend/cann:9.0.1-910b-ubuntu22.04-py3.12
1919
2020ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21- ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22- ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23- ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24- ARG PIP_TRUSTED_HOST=""
25- ARG GIT_PROXY=""
2621
2722WORKDIR /workspace
2823
@@ -33,13 +28,12 @@ RUN apt-get update -y && \
3328 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3429 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3530 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
36- python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
31+ python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
3732 rm -rf /var/cache/apt/* && \
3833 rm -rf /var/lib/apt/lists/*
3934
4035# Install modelscope (for fast download) and ray (for multinode)
4136RUN pip config set global.index-url ${PIP_INDEX_URL} && \
42- if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST" ; fi && \
4337 python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4438 python3 -m pip cache purge
4539
@@ -52,11 +46,10 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5246 git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5347 git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5448 else \
55- if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/" .insteadOf https://github.com/; fi && \
5649 git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5750 fi
5851# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
59- RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
52+ RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
6053 python3 -m pip uninstall -y triton && \
6154 python3 -m pip cache purge
6255
@@ -69,13 +62,13 @@ ENV SOC_VERSION=$SOC_VERSION \
6962 OMP_NUM_THREADS=1
7063COPY . /vllm-workspace/vllm-ascend/
7164
72- RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL} " && \
65+ RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi " && \
7366 export VLLM_BATCH_INVARIANT=1 && \
7467 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7568 source /usr/local/Ascend/nnal/atb/set_env.sh && \
76- python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
69+ python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
7770 python3 -m pip uninstall -y triton triton-ascend && \
78- python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
71+ python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
7972 python3 -m pip cache purge
8073
8174# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH
0 commit comments