1414# limitations under the License.
1515# This file is a part of the vllm-ascend project.
1616#
17- ARG CANN_QUAY_URL="quay.io/ascend/cann"
18- ARG CANN_VERSION="9.0.1"
19- ARG BASE_OS="ubuntu22.04"
20- FROM ${CANN_QUAY_URL}:${CANN_VERSION}-910b-${BASE_OS}-py3.12
2117
22- ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
18+ FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-910b-ubuntu22.04-py3.12
19+
20+ ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
21+ ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22+ ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
23+ ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
24+ ARG PIP_TRUSTED_HOST=""
25+ ARG GIT_PROXY=""
26+ ARG APTMIRROR
2327
2428WORKDIR /workspace
2529
2630# Install clang-15 (for triton-ascend) and Mooncake
2731ARG MOONCAKE_TAG=0.3.11.post1
28- RUN apt-get update -y && \
32+ RUN if [ -n "$APTMIRROR" ]; then \
33+ sed -Ei "s@(ports|archive).ubuntu.com@${APTMIRROR#http://}@g" /etc/apt/sources.list; \
34+ fi && \
35+ apt-get update -y && \
2936 apt-get install -y git vim wget net-tools gcc g++ cmake numactl libnuma-dev libibverbs-dev libjemalloc2 libhiredis-dev clang-15 && \
3037 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3138 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3239 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 && \
40+ python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3441 rm -rf /var/cache/apt/* && \
3542 rm -rf /var/lib/apt/lists/*
3643
@@ -41,17 +48,18 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} && \
4148
4249# Install vLLM
4350ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
44- ARG VLLM_TAG=v0.26.0
51+ ARG VLLM_TAG=v0.25.1
4552ARG VLLM_COMMIT=""
4653RUN if [ -n "$VLLM_COMMIT" ]; then \
4754 git init /vllm-workspace/vllm && \
4855 git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4956 git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5057 else \
58+ if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/" .insteadOf https://github.com/; fi && \
5159 git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5260 fi
5361# 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-url https://download.pytorch.org/whl/cpu/ && \
62+ RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5563 python3 -m pip uninstall -y triton && \
5664 python3 -m pip cache purge
5765
@@ -64,38 +72,17 @@ ENV SOC_VERSION=$SOC_VERSION \
6472 OMP_NUM_THREADS=1
6573COPY . /vllm-workspace/vllm-ascend/
6674
67- RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi " && \
75+ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL} " && \
6876 export VLLM_BATCH_INVARIANT=1 && \
6977 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7078 source /usr/local/Ascend/nnal/atb/set_env.sh && \
71- python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu / && \
79+ python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision / && \
7280 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 && \
81+ python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7482 python3 -m pip cache purge
7583
7684# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH
7785RUN echo "export LD_PRELOAD=/usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc
7886RUN echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc
7987
80- # ===== Conditional installation based on BUILD_TYPE =====
81- # All ARG definitions are in the same stage for better maintainability
82- ARG BUILD_TYPE="release"
83- ARG MEMCACHE_VERSION
84- ARG MEMCACHE_DATE
85- ARG MEMFABRIC_VERSION
86- ARG MEMFABRIC_DATE
87- ARG TORCH_NPU_VERSION
88- ARG TORCH_NPU_DATE
89- ARG TRITON_ASCEND_VERSION
90- ARG TRITON_ASCEND_PACKAGE_VERSION
91- ARG DAILY_DEPS_MODE="full"
92-
93- # Install daily packages via shared script
94- COPY .github/workflows/scripts/install_daily_deps.sh /tmp/
95- RUN if [ "$BUILD_TYPE" = "daily" ]; then \
96- bash /tmp/install_daily_deps.sh; \
97- else \
98- echo "Building release version without daily packages" ; \
99- fi && rm -f /tmp/install_daily_deps.sh
100-
10188CMD ["/bin/bash" ]
0 commit comments