1818FROM quay.io/ascend/cann:9.0.1-a3-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=""
2126
2227ENV DEBIAN_FRONTEND=noninteractive
2328
@@ -30,12 +35,13 @@ RUN apt-get update -y && \
3035 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3136 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3237 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
33- python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
38+ python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3439 rm -rf /var/cache/apt/* && \
3540 rm -rf /var/lib/apt/lists/*
3641
3742# Install modelscope (for fast download) and ray (for multinode)
3843RUN 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 && \
3945 python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4046 python3 -m pip cache purge
4147
@@ -48,10 +54,11 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
4854 git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4955 git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5056 else \
57+ if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5158 git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5259 fi
5360# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
54- RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
61+ RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5562 python3 -m pip uninstall -y triton && \
5663 python3 -m pip cache purge
5764
@@ -64,13 +71,13 @@ ENV SOC_VERSION=$SOC_VERSION \
6471 OMP_NUM_THREADS=1
6572COPY . /vllm-workspace/vllm-ascend/
6673
67- RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi " && \
74+ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL} " && \
6875 export VLLM_BATCH_INVARIANT=1 && \
6976 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7077 source /usr/local/Ascend/nnal/atb/set_env.sh && \
71- python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
78+ python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
7279 python3 -m pip uninstall -y triton triton-ascend && \
73- python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
80+ python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7481 python3 -m pip cache purge
7582
7683# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH
0 commit comments