From 8e55d86d1067e7a6fece677b3833667ab359761e Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Thu, 19 Nov 2026 18:55:48 +0800 Subject: [PATCH 01/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index eb7b8cc7813d..a8addaea44cb 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -15,7 +15,7 @@ # This file is a part of the vllm-ascend project. # -FROM swr.cn-north-12.myhuaweicloud.com/atlas_inference/cann:9.3.0_20261113161300-a3-openeuler24.03-py3.12 +FROM swr.cn-north-12.myhuaweicloud.com/atlas_inference/cann:9.1.0_20260731131545-a3-openeuler24.03-py3.12 WORKDIR /workspace @@ -32,7 +32,7 @@ RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3. # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.33.0 +ARG VLLM_TAG=v0.23.0 ARG VLLM_COMMIT="" ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu/" RUN if [ -n "$VLLM_COMMIT" ]; then \ @@ -55,7 +55,7 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \ # Install vllm-ascend # Dependency versions used by the vllm-ascend build. -ARG SOC_VERSION="ascend910_9391" +ARG SOC_VERSION="ascend910_9382" # Cap opc/c++/rust build parallelism to bound memory on shared buildkitd nodes: # the heavy vllm-ascend compile otherwise spawns unbounded jobs and can exhaust # a 128Gi node (OOM-killing kubelet). CI passes --build-arg MAX_JOBS=32 / @@ -80,7 +80,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ # ===== Install FLA and flash_attn_npu ===== ARG FLA_VERSION="26.10.0+feature" ARG FLASH_ATTN_NPU_VERSION="0.5.0" -ARG MOONCAKE_VERSION="0.3.14" +ARG MOONCAKE_VERSION="0.2.28" RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ source /usr/local/Ascend/cann/set_env.sh && \ From f71c3026a4b3f6b6f728b4d0546863fc6e498ef7 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Thu, 19 Nov 2026 19:23:49 +0800 Subject: [PATCH 02/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index a8addaea44cb..2751e07f894d 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -42,14 +42,17 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \ else \ git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \ fi && \ - VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index-url ${PYTORCH_INDEX_URL} && \ + VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm[audio] --extra-index-url ${PYTORCH_INDEX_URL} && \ # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. python3 -m pip uninstall -y triton && \ # The same step also builds the optional Rust frontend (vllm-rs). cd /vllm-workspace/vllm && \ export PATH="/root/.cargo/bin:$PATH" && \ export PROTOC_INCLUDE=/usr/include && \ - python3 -m pip install -r requirements/build/rust.txt && \ + # v0.23.0 does NOT have requirements/build/rust.txt, guard this line for version compatibility + if [ -f requirements/build/rust.txt ]; then \ + python3 -m pip install -r requirements/build/rust.txt; \ + fi && \ bash tools/build_rust.sh && \ python3 -m pip cache purge From 9d5234f22adfd916856efb987e251e2bc0ff0032 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Thu, 19 Nov 2026 20:10:13 +0800 Subject: [PATCH 03/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 2751e07f894d..461c0d449fc0 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -26,6 +26,11 @@ RUN yum update -y && \ yum install -y git vim wget curl protobuf protobuf-compiler protobuf-devel net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel hiredis-devel clang patch && \ rm -rf /var/cache/yum/* +# Install rustup + rust toolchain (required for tools/build_rust.sh / vllm-rs) +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && \ + source /root/.cargo/env && \ + rustc --version && cargo --version + # Install modelscope (for fast download) and ray (for multinode) RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \ python3 -m pip cache purge @@ -35,6 +40,8 @@ ARG VLLM_REPO=https://github.com/vllm-project/vllm.git ARG VLLM_TAG=v0.23.0 ARG VLLM_COMMIT="" ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu/" +# 可选:如果你暂时不需要vllm-rs,可以 ARG BUILD_VLLM_RUST=0 跳过编译 +ARG BUILD_VLLM_RUST=1 RUN if [ -n "$VLLM_COMMIT" ]; then \ git init /vllm-workspace/vllm && \ git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \ @@ -45,15 +52,18 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \ VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm[audio] --extra-index-url ${PYTORCH_INDEX_URL} && \ # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. python3 -m pip uninstall -y triton && \ - # The same step also builds the optional Rust frontend (vllm-rs). cd /vllm-workspace/vllm && \ + source /root/.cargo/env && \ export PATH="/root/.cargo/bin:$PATH" && \ export PROTOC_INCLUDE=/usr/include && \ # v0.23.0 does NOT have requirements/build/rust.txt, guard this line for version compatibility if [ -f requirements/build/rust.txt ]; then \ python3 -m pip install -r requirements/build/rust.txt; \ fi && \ - bash tools/build_rust.sh && \ + # 条件执行rust编译,BUILD_VLLM_RUST=0 直接跳过 + if [ "${BUILD_VLLM_RUST}" = "1" ]; then \ + bash tools/build_rust.sh; \ + fi && \ python3 -m pip cache purge # Install vllm-ascend From 7e45069a39048b62664569bf2d7ad0dd4f9fd046 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Thu, 19 Nov 2026 20:37:29 +0800 Subject: [PATCH 04/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 461c0d449fc0..d709af5e0b00 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -26,11 +26,6 @@ RUN yum update -y && \ yum install -y git vim wget curl protobuf protobuf-compiler protobuf-devel net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel hiredis-devel clang patch && \ rm -rf /var/cache/yum/* -# Install rustup + rust toolchain (required for tools/build_rust.sh / vllm-rs) -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && \ - source /root/.cargo/env && \ - rustc --version && cargo --version - # Install modelscope (for fast download) and ray (for multinode) RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \ python3 -m pip cache purge @@ -40,8 +35,9 @@ ARG VLLM_REPO=https://github.com/vllm-project/vllm.git ARG VLLM_TAG=v0.23.0 ARG VLLM_COMMIT="" ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu/" -# 可选:如果你暂时不需要vllm-rs,可以 ARG BUILD_VLLM_RUST=0 跳过编译 -ARG BUILD_VLLM_RUST=1 +# NOTE: vLLM v0.23.0 has no Rust frontend (no tools/build_rust.sh and no +# requirements/build/rust.txt). The rust toolchain and the rust build step +# that this file used to carry are removed to keep the tag consistent. RUN if [ -n "$VLLM_COMMIT" ]; then \ git init /vllm-workspace/vllm && \ git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \ @@ -52,18 +48,6 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \ VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm[audio] --extra-index-url ${PYTORCH_INDEX_URL} && \ # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. python3 -m pip uninstall -y triton && \ - cd /vllm-workspace/vllm && \ - source /root/.cargo/env && \ - export PATH="/root/.cargo/bin:$PATH" && \ - export PROTOC_INCLUDE=/usr/include && \ - # v0.23.0 does NOT have requirements/build/rust.txt, guard this line for version compatibility - if [ -f requirements/build/rust.txt ]; then \ - python3 -m pip install -r requirements/build/rust.txt; \ - fi && \ - # 条件执行rust编译,BUILD_VLLM_RUST=0 直接跳过 - if [ "${BUILD_VLLM_RUST}" = "1" ]; then \ - bash tools/build_rust.sh; \ - fi && \ python3 -m pip cache purge # Install vllm-ascend From 837586a6c79113b9676a5a0b1d0c917e5d66d345 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Fri, 20 Nov 2026 14:55:46 +0800 Subject: [PATCH 05/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 142 +++++++++++++++++++++++++++------------- 1 file changed, 96 insertions(+), 46 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index d709af5e0b00..644af4ccec24 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -14,30 +14,86 @@ # limitations under the License. # This file is a part of the vllm-ascend project. # +# 基于空白麒麟 V10 SP3(glibc 2.28)自建 vLLM v0.23.0 + vllm-ascend 0.23.0 环境。 +# +# 构建上下文要求: +# ./ascend/Ascend-cann-9.1.0_linux-aarch64.run (toolkit) +# ./ascend/Ascend-cann-nnal_9.1.0_linux-aarch64.run +# ./ascend/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run (可选) +# +# mooncake 与客户环境一致:不做 pip 安装,从源码编译 0.3.12.post1 +# +# 必要条件:--build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> +# 麒麟 init 镜像带 dnf,但没有 repo 配置、没有 gcc,缺此参数第 1 步直接失败。 +# +# 本仓库源码必须是 releases/v0.23.0 分支(main 为 vLLM 0.33 世代,无法在此环境运行)。 -FROM swr.cn-north-12.myhuaweicloud.com/atlas_inference/cann:9.1.0_20260731131545-a3-openeuler24.03-py3.12 +ARG OS_IMAGE=cr.kylinos.cn/kylin/kylin-server-init:v10sp3-2403 +FROM ${OS_IMAGE} -WORKDIR /workspace +ARG PYTHON_VERSION=3.12.4 +ARG KYLIN_REPO_URL="" +ARG CANN_PKG_DIR=ascend +ARG VLLM_REPO=https://github.com/vllm-project/vllm.git +ARG VLLM_TAG=v0.23.0 +ARG VLLM_COMMIT="" +ARG PYTORCH_INDEX_URL=https://download.pytorch.org/whl/cpu/ +ARG ASCEND_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi +ARG SOC_VERSION=ascend910_9382 +ARG FLA_VERSION="26.10.0+feature" +ARG FLASH_ATTN_NPU_VERSION="0.5.0" +ARG MOONCAKE_REPO=https://github.com/kvcache-ai/Mooncake.git +ARG MOONCAKE_TAG=v0.3.12.post1 +ARG MAX_JOBS +WORKDIR /workspace SHELL ["/bin/bash", "-c"] -# Install clang-15 (for triton-ascend) -RUN yum update -y && \ - yum install -y git vim wget curl protobuf protobuf-compiler protobuf-devel net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel hiredis-devel clang patch && \ - rm -rf /var/cache/yum/* +# 1) 系统依赖:麒麟 init 镜像无 repo 配置、无 gcc,必须先注入 dnf 源 +RUN set -e; \ + if [ -n "${KYLIN_REPO_URL}" ]; then \ + curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ + fi; \ + PM="$(command -v dnf || command -v yum || true)"; \ + if [ -z "$PM" ]; then \ + echo "ERROR: 基础镜像无 dnf/yum,需换带包管理器的麒麟基础镜像"; \ + exit 1; \ + fi; \ + $PM install -y git vim wget curl make cmake patch gcc gcc-c++ \ + openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + sqlite-devel readline-devel ncurses-devel \ + numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ + yaml-cpp-devel gflags-devel glog-devel boost-devel \ + jemalloc clang && \ + rm -rf /var/cache/yum/* /var/cache/dnf/* + +# 2) 源码编译 Python 3.12(麒麟 V10 自带 3.7,不满足 torch 2.10 / vLLM 0.23 要求) +RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /tmp/Python.tgz && \ + mkdir -p /tmp/pybuild && tar -xzf /tmp/Python.tgz -C /tmp/pybuild --strip-components=1 && \ + cd /tmp/pybuild && \ + ./configure --prefix=/usr/local --enable-shared --with-ensurepip=install && \ + make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig && \ + rm -rf /tmp/pybuild /tmp/Python.tgz && \ + python3 -V && python3 -m pip install -U pip setuptools wheel + +ENV PATH=/usr/local/bin:$PATH \ + LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + +# 3) 安装 CANN 9.1.0(驱动由宿主机提供,不打进镜像) +COPY ${CANN_PKG_DIR} /tmp/cann/ +RUN set -e && chmod +x /tmp/cann/*.run && \ + /tmp/cann/Ascend-cann-9.1.0_linux-aarch64.run --install && \ + /tmp/cann/Ascend-cann-nnal_9.1.0_linux-aarch64.run --install && \ + if [ -f /tmp/cann/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run ]; then \ + /tmp/cann/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run --install; \ + fi && \ + rm -rf /tmp/cann -# Install modelscope (for fast download) and ray (for multinode) +# 4) modelscope / ray(多机) / protobuf RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \ python3 -m pip cache purge -# Install vLLM -ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.23.0 -ARG VLLM_COMMIT="" -ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu/" -# NOTE: vLLM v0.23.0 has no Rust frontend (no tools/build_rust.sh and no -# requirements/build/rust.txt). The rust toolchain and the rust build step -# that this file used to carry are removed to keep the tag consistent. +# 5) 安装 vLLM v0.23.0(源码方式,TARGET_DEVICE=empty;0.23 无 rust 前端) RUN if [ -n "$VLLM_COMMIT" ]; then \ git init /vllm-workspace/vllm && \ git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \ @@ -45,55 +101,49 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \ else \ git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \ fi && \ - VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm[audio] --extra-index-url ${PYTORCH_INDEX_URL} && \ - # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. + VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] \ + --extra-index-url ${PYTORCH_INDEX_URL} && \ python3 -m pip uninstall -y triton && \ python3 -m pip cache purge -# Install vllm-ascend -# Dependency versions used by the vllm-ascend build. -ARG SOC_VERSION="ascend910_9382" -# Cap opc/c++/rust build parallelism to bound memory on shared buildkitd nodes: -# the heavy vllm-ascend compile otherwise spawns unbounded jobs and can exhaust -# a 128Gi node (OOM-killing kubelet). CI passes --build-arg MAX_JOBS=32 / -# CARGO_BUILD_JOBS=32; leaving them unset keeps the default nproc parallelism. -ARG MAX_JOBS -ARG CARGO_BUILD_JOBS +# 6) 编译安装 vllm-ascend(源码必须是 releases/v0.23.0) ENV SOC_VERSION=$SOC_VERSION \ TASK_QUEUE_ENABLE=1 \ OMP_NUM_THREADS=1 COPY . /vllm-workspace/vllm-ascend/ - -ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi \ - https://mirrors.huaweicloud.com/ascend/repos/pypi/nightly" -ARG COMPILE_CUSTOM_KERNELS=1 RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ export VLLM_BATCH_INVARIANT=1 && \ source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ - python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index-url ${PYTORCH_INDEX_URL} && \ + python3 -m pip install -e /vllm-workspace/vllm-ascend/ \ + --extra-index-url ${PYTORCH_INDEX_URL} && \ python3 -m pip cache purge -# ===== Install FLA and flash_attn_npu ===== -ARG FLA_VERSION="26.10.0+feature" -ARG FLASH_ATTN_NPU_VERSION="0.5.0" -ARG MOONCAKE_VERSION="0.2.28" -RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ +# 7) memfabric kernel + flash-linear-attention + flash_attn_npu +RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ + source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ - source /usr/local/Ascend/cann/set_env.sh && \ - export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ - # Install memfabric_hybrid kernels TORCH_DEVICE_BACKEND_AUTOLOAD=0 mfcli kernel install --soc-version A3 --install-for-all && \ - # Install flash-linear-attention-npu from the Ascend mirror python3 -m pip install --force-reinstall --no-deps \ "flash-linear-attention-npu-a3===${FLA_VERSION}" && \ - # Keep the CANN env and --no-build-isolation: the isolated build env lacks torch/torch_npu. - FLASH_ATTN_BUILD_NPU=910 python3 -m pip install --no-build-isolation "flash_attn_npu==${FLASH_ATTN_NPU_VERSION}" && \ - # Install mooncake-transfer-engine-npu from the Ascend nightly mirror - python3 -m pip install "mooncake-transfer-engine-npu===${MOONCAKE_VERSION}" && \ + FLASH_ATTN_BUILD_NPU=910 python3 -m pip install --no-build-isolation \ + "flash_attn_npu==${FLASH_ATTN_NPU_VERSION}" && \ python3 -m pip cache purge -# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH -RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc +# 8) 从源码编译 mooncake 0.3.12.post1(与客户环境一致,不走 pip 二进制) +RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ + git clone --depth 1 -b ${MOONCAKE_TAG} ${MOONCAKE_REPO} /tmp/Mooncake && \ + cd /tmp/Mooncake && mkdir -p build && cd build && \ + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON && \ + make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig + +# 9) mooncake python 绑定 +RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ + cd /tmp/Mooncake && python3 -m pip install . && \ + rm -rf /tmp/Mooncake && python3 -m pip cache purge + +RUN echo 'export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc CMD ["/bin/bash"] From 0f331382138d39c8aea45e903d0a6a18c1676c86 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Fri, 20 Nov 2026 15:21:35 +0800 Subject: [PATCH 06/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 44 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 644af4ccec24..04535c62deb4 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -16,15 +16,14 @@ # # 基于空白麒麟 V10 SP3(glibc 2.28)自建 vLLM v0.23.0 + vllm-ascend 0.23.0 环境。 # -# 构建上下文要求: -# ./ascend/Ascend-cann-9.1.0_linux-aarch64.run (toolkit) -# ./ascend/Ascend-cann-nnal_9.1.0_linux-aarch64.run -# ./ascend/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run (可选) +# 构建上下文要求:无(CANN 安装包在镜像内下载,无需额外目录) # # mooncake 与客户环境一致:不做 pip 安装,从源码编译 0.3.12.post1 # -# 必要条件:--build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> -# 麒麟 init 镜像带 dnf,但没有 repo 配置、没有 gcc,缺此参数第 1 步直接失败。 +# 可选参数: +# --build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> 基础镜像无源时必填 +# --build-arg CANN_BASE_URL=<内网 CANN 包地址> 外网不可达时改为内网镜像 +# --build-arg MAX_JOBS=32 # # 本仓库源码必须是 releases/v0.23.0 分支(main 为 vLLM 0.33 世代,无法在此环境运行)。 @@ -33,7 +32,6 @@ FROM ${OS_IMAGE} ARG PYTHON_VERSION=3.12.4 ARG KYLIN_REPO_URL="" -ARG CANN_PKG_DIR=ascend ARG VLLM_REPO=https://github.com/vllm-project/vllm.git ARG VLLM_TAG=v0.23.0 ARG VLLM_COMMIT="" @@ -46,6 +44,12 @@ ARG MOONCAKE_REPO=https://github.com/kvcache-ai/Mooncake.git ARG MOONCAKE_TAG=v0.3.12.post1 ARG MAX_JOBS +# CANN 9.1.0 官方包(内网可整体替换 CANN_BASE_URL) +ARG CANN_BASE_URL=https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.1.0 +ARG CANN_TOOLKIT_PKG=Ascend-cann-toolkit_9.1.0_linux-aarch64.run +ARG CANN_NNAL_PKG=Ascend-cann-nnal_9.1.0_linux-aarch64.run +ARG CANN_OPS_PKG=Ascend-cann-A3-ops_9.1.0_linux-aarch64.run + WORKDIR /workspace SHELL ["/bin/bash", "-c"] @@ -77,17 +81,21 @@ RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTH python3 -V && python3 -m pip install -U pip setuptools wheel ENV PATH=/usr/local/bin:$PATH \ - LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - -# 3) 安装 CANN 9.1.0(驱动由宿主机提供,不打进镜像) -COPY ${CANN_PKG_DIR} /tmp/cann/ -RUN set -e && chmod +x /tmp/cann/*.run && \ - /tmp/cann/Ascend-cann-9.1.0_linux-aarch64.run --install && \ - /tmp/cann/Ascend-cann-nnal_9.1.0_linux-aarch64.run --install && \ - if [ -f /tmp/cann/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run ]; then \ - /tmp/cann/Ascend-cann-A3-ops_9.1.0_linux_aarch64.run --install; \ - fi && \ - rm -rf /tmp/cann + LD_LIBRARY_PATH=/usr/local/lib + +# 3) 下载并安装 CANN 9.1.0(toolkit 必装;nnal、A3-ops 存在则装;驱动由宿主机提供) +RUN set -e; cd /tmp; \ + wget -q --header="Referer: https://www.hiascend.com/" \ + "${CANN_BASE_URL}/${CANN_TOOLKIT_PKG}"; \ + wget -q --header="Referer: https://www.hiascend.com/" \ + "${CANN_BASE_URL}/${CANN_NNAL_PKG}"; \ + wget -q --header="Referer: https://www.hiascend.com/" \ + "${CANN_BASE_URL}/${CANN_OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ + chmod +x /tmp/*.run; \ + /tmp/${CANN_TOOLKIT_PKG} --install; \ + /tmp/${CANN_NNAL_PKG} --install; \ + if [ -f "/tmp/${CANN_OPS_PKG}" ]; then /tmp/${CANN_OPS_PKG} --install; fi; \ + rm -f /tmp/*.run # 4) modelscope / ray(多机) / protobuf RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \ From 71bcaa7c6019f14d1fedcefee6af672e6f1b7ff4 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Mon, 23 Nov 2026 16:40:42 +0800 Subject: [PATCH 07/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 57 ++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 04535c62deb4..b8dc5cc265e1 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -16,13 +16,20 @@ # # 基于空白麒麟 V10 SP3(glibc 2.28)自建 vLLM v0.23.0 + vllm-ascend 0.23.0 环境。 # -# 构建上下文要求:无(CANN 安装包在镜像内下载,无需额外目录) +# 交付形态:完全离线镜像。构建期允许联网(麒麟 dnf 源 / PyPI / CANN 下载), +# 运行期所需依赖全部固化进镜像,不依赖外网。 +# +# 构建上下文要求: +# ./offline/motor/*.whl MindIE-Motor 官方 wheel(PD 分离服务,必需) # # mooncake 与客户环境一致:不做 pip 安装,从源码编译 0.3.12.post1 +# memfabric / memcache 由 requirements.txt 固定版本(1.3.0)随 vllm-ascend 安装。 +# etcd 由官方 release 下载后内置,供 MindIE-Motor 做服务发现。 # # 可选参数: -# --build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> 基础镜像无源时必填 +# --build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> 基础镜像已内置源,缺省即用镜像内配置 # --build-arg CANN_BASE_URL=<内网 CANN 包地址> 外网不可达时改为内网镜像 +# --build-arg ETCD_VERSION=v3.5.21 内置 etcd 版本 # --build-arg MAX_JOBS=32 # # 本仓库源码必须是 releases/v0.23.0 分支(main 为 vLLM 0.33 世代,无法在此环境运行)。 @@ -53,17 +60,19 @@ ARG CANN_OPS_PKG=Ascend-cann-A3-ops_9.1.0_linux-aarch64.run WORKDIR /workspace SHELL ["/bin/bash", "-c"] -# 1) 系统依赖:麒麟 init 镜像无 repo 配置、无 gcc,必须先注入 dnf 源 +# 1) 系统依赖:基础镜像已内置 kylin_aarch64.repo(V10SP3-2403 base/updates), +# 这里只校验 dnf 可用;KYLIN_REPO_URL 非空时用外部 .repo 覆盖。 RUN set -e; \ - if [ -n "${KYLIN_REPO_URL}" ]; then \ - curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ - fi; \ PM="$(command -v dnf || command -v yum || true)"; \ if [ -z "$PM" ]; then \ echo "ERROR: 基础镜像无 dnf/yum,需换带包管理器的麒麟基础镜像"; \ exit 1; \ fi; \ - $PM install -y git vim wget curl make cmake patch gcc gcc-c++ \ + if [ -n "${KYLIN_REPO_URL}" ]; then \ + curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ + fi; \ + $PM makecache || { echo "ERROR: dnf 无可用软件源,请配置 .repo 或传 KYLIN_REPO_URL"; exit 1; }; \ + $PM install -y git vim wget curl make patch gcc gcc-c++ \ openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ @@ -97,8 +106,10 @@ RUN set -e; cd /tmp; \ if [ -f "/tmp/${CANN_OPS_PKG}" ]; then /tmp/${CANN_OPS_PKG} --install; fi; \ rm -f /tmp/*.run -# 4) modelscope / ray(多机) / protobuf -RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \ +# 4) modelscope / ray(多机) / protobuf;cmake>=3.26 与 ninja 由 pip 提供 +# (麒麟源里的 cmake 版本低于 vllm-ascend 要求,且镜像初始无 cmake) +RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' \ + 'cmake>=3.26' ninja && \ python3 -m pip cache purge # 5) 安装 vLLM v0.23.0(源码方式,TARGET_DEVICE=empty;0.23 无 rust 前端) @@ -154,4 +165,32 @@ RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ RUN echo 'export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD' >> ~/.bashrc && \ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc +# 10) 内置 etcd(MindIE-Motor 服务发现;离线运行不再依赖外部 etcd) +ARG ETCD_VERSION=v3.5.21 +RUN set -e; \ + case "$(uname -m)" in \ + aarch64) ETCD_ARCH=arm64 ;; \ + x86_64) ETCD_ARCH=amd64 ;; \ + *) echo "ERROR: 不支持的架构 $(uname -m)"; exit 1 ;; \ + esac; \ + ETCD_PKG="etcd-${ETCD_VERSION}-linux-${ETCD_ARCH}"; \ + curl -fsSL "https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/${ETCD_PKG}.tar.gz" \ + -o /tmp/etcd.tgz; \ + tar -xzf /tmp/etcd.tgz -C /tmp; \ + install -m 0755 "/tmp/${ETCD_PKG}/etcd" /usr/local/bin/; \ + install -m 0755 "/tmp/${ETCD_PKG}/etcdctl" /usr/local/bin/; \ + rm -rf /tmp/etcd.tgz "/tmp/${ETCD_PKG}"; \ + etcd --version; etcdctl version + +# 11) MindIE-Motor(PD 分离服务):官方 wheel 打入镜像,运行期离线可用 +COPY offline/motor/ /opt/offline/motor/ +RUN set -e; \ + ls /opt/offline/motor/*.whl >/dev/null 2>&1 || { \ + echo "ERROR: 缺少 MindIE-Motor wheel,请把官方 wheel 放到构建上下文 offline/motor/"; \ + exit 1; \ + }; \ + python3 -m pip install /opt/offline/motor/*.whl && \ + python3 -m pip cache purge && \ + rm -rf /opt/offline/motor + CMD ["/bin/bash"] From ff0b3ff338b812606d581a5e23c01cc95f61178b Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Mon, 23 Nov 2026 17:15:27 +0800 Subject: [PATCH 08/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index b8dc5cc265e1..0855ef196d7a 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -20,7 +20,9 @@ # 运行期所需依赖全部固化进镜像,不依赖外网。 # # 构建上下文要求: -# ./offline/motor/*.whl MindIE-Motor 官方 wheel(PD 分离服务,必需) +# ./offline/motor/*.whl MindIE-Motor 官方 wheel(PD 分离服务) +# 正式交付请传 --build-arg MOTOR_REQUIRED=1,缺 wheel 即失败; +# 缺省 MOTOR_REQUIRED=0 时仅告警并跳过,便于 CI 构建基础镜像。 # # mooncake 与客户环境一致:不做 pip 安装,从源码编译 0.3.12.post1 # memfabric / memcache 由 requirements.txt 固定版本(1.3.0)随 vllm-ascend 安装。 @@ -182,15 +184,22 @@ RUN set -e; \ rm -rf /tmp/etcd.tgz "/tmp/${ETCD_PKG}"; \ etcd --version; etcdctl version -# 11) MindIE-Motor(PD 分离服务):官方 wheel 打入镜像,运行期离线可用 +# 11) MindIE-Motor(PD 分离服务):官方 wheel 打进镜像,运行期离线可用 +# wheel 放在构建上下文 offline/motor/;官方交付请用 MOTOR_REQUIRED=1 强制校验。 +ARG MOTOR_REQUIRED=0 COPY offline/motor/ /opt/offline/motor/ RUN set -e; \ - ls /opt/offline/motor/*.whl >/dev/null 2>&1 || { \ - echo "ERROR: 缺少 MindIE-Motor wheel,请把官方 wheel 放到构建上下文 offline/motor/"; \ - exit 1; \ - }; \ - python3 -m pip install /opt/offline/motor/*.whl && \ - python3 -m pip cache purge && \ + WHEELS="$(ls /opt/offline/motor/*.whl 2>/dev/null || true)"; \ + if [ -z "$WHEELS" ]; then \ + if [ "${MOTOR_REQUIRED}" = "1" ]; then \ + echo "ERROR: 缺少 MindIE-Motor wheel,请把官方 wheel 放到构建上下文 offline/motor/"; \ + exit 1; \ + fi; \ + echo "WARN: 未提供 MindIE-Motor wheel,跳过 PD 分离组件安装"; \ + else \ + python3 -m pip install $WHEELS && \ + python3 -m pip cache purge; \ + fi; \ rm -rf /opt/offline/motor CMD ["/bin/bash"] From d8f000e5f7eba2c9c329c59f0469dcbc34a8767f Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Mon, 23 Nov 2026 17:33:39 +0800 Subject: [PATCH 09/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 0855ef196d7a..e8b86026b6f6 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -19,10 +19,11 @@ # 交付形态:完全离线镜像。构建期允许联网(麒麟 dnf 源 / PyPI / CANN 下载), # 运行期所需依赖全部固化进镜像,不依赖外网。 # -# 构建上下文要求: -# ./offline/motor/*.whl MindIE-Motor 官方 wheel(PD 分离服务) -# 正式交付请传 --build-arg MOTOR_REQUIRED=1,缺 wheel 即失败; -# 缺省 MOTOR_REQUIRED=0 时仅告警并跳过,便于 CI 构建基础镜像。 +# 构建上下文要求:无(CANN/etcd 在镜像内下载,motor wheel 走 build secret) +# +# MindIE-Motor(PD 分离)官方 wheel 通过 build secret 提供: +# docker buildx build --secret id=motor_wheel,src=.whl --build-arg MOTOR_REQUIRED=1 ... +# 未传 secret 且 MOTOR_REQUIRED=0(默认)时仅告警并跳过,便于 CI 构建基础镜像。 # # mooncake 与客户环境一致:不做 pip 安装,从源码编译 0.3.12.post1 # memfabric / memcache 由 requirements.txt 固定版本(1.3.0)随 vllm-ascend 安装。 @@ -185,21 +186,22 @@ RUN set -e; \ etcd --version; etcdctl version # 11) MindIE-Motor(PD 分离服务):官方 wheel 打进镜像,运行期离线可用 -# wheel 放在构建上下文 offline/motor/;官方交付请用 MOTOR_REQUIRED=1 强制校验。 +# wheel 通过 build secret 传入,不依赖构建上下文里存在 offline/ 目录: +# docker buildx build --secret id=motor_wheel,src=.whl ... +# 未传 secret 时按 MOTOR_REQUIRED 决定告警跳过还是失败。 ARG MOTOR_REQUIRED=0 -COPY offline/motor/ /opt/offline/motor/ -RUN set -e; \ - WHEELS="$(ls /opt/offline/motor/*.whl 2>/dev/null || true)"; \ - if [ -z "$WHEELS" ]; then \ - if [ "${MOTOR_REQUIRED}" = "1" ]; then \ - echo "ERROR: 缺少 MindIE-Motor wheel,请把官方 wheel 放到构建上下文 offline/motor/"; \ - exit 1; \ - fi; \ - echo "WARN: 未提供 MindIE-Motor wheel,跳过 PD 分离组件安装"; \ - else \ - python3 -m pip install $WHEELS && \ +RUN --mount=type=secret,id=motor_wheel \ + set -e; \ + if [ -f /run/secrets/motor_wheel ]; then \ + install -m 0644 /run/secrets/motor_wheel /tmp/motor.whl; \ + python3 -m pip install /tmp/motor.whl; \ + rm -f /tmp/motor.whl; \ python3 -m pip cache purge; \ - fi; \ - rm -rf /opt/offline/motor + elif [ "${MOTOR_REQUIRED}" = "1" ]; then \ + echo "ERROR: 未提供 MindIE-Motor wheel,请用 --secret id=motor_wheel,src="; \ + exit 1; \ + else \ + echo "WARN: 未提供 MindIE-Motor wheel,跳过 PD 分离组件安装"; \ + fi CMD ["/bin/bash"] From c2ce0eca4a8be719e2243c5dd41ea0e56c0cf2d6 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Mon, 23 Nov 2026 17:49:10 +0800 Subject: [PATCH 10/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index e8b86026b6f6..06025e2ae14d 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -79,7 +79,7 @@ RUN set -e; \ openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ - yaml-cpp-devel gflags-devel glog-devel boost-devel \ + yaml-cpp-devel gflags-devel boost-devel \ jemalloc clang && \ rm -rf /var/cache/yum/* /var/cache/dnf/* @@ -115,6 +115,17 @@ RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3. 'cmake>=3.26' ninja && \ python3 -m pip cache purge +# 4b) glog:麒麟 V10 SP3 源里没有 glog/glog-devel,mooncake 依赖 libglog,源码编译 +ARG GLOG_TAG=v0.6.0 +RUN git clone --depth 1 -b ${GLOG_TAG} https://github.com/google/glog.git /tmp/glog && \ + cmake -S /tmp/glog -B /tmp/glog/build \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_INSTALL_PREFIX=/usr/local && \ + cmake --build /tmp/glog/build -j"${MAX_JOBS:-$(nproc)}" && \ + cmake --install /tmp/glog/build && ldconfig && \ + rm -rf /tmp/glog + # 5) 安装 vLLM v0.23.0(源码方式,TARGET_DEVICE=empty;0.23 无 rust 前端) RUN if [ -n "$VLLM_COMMIT" ]; then \ git init /vllm-workspace/vllm && \ From 251efae6140216c22b3f95655ee60f809d18111e Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Mon, 23 Nov 2026 17:56:55 +0800 Subject: [PATCH 11/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 06025e2ae14d..a9fc1aeb1fc1 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -75,7 +75,7 @@ RUN set -e; \ curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ fi; \ $PM makecache || { echo "ERROR: dnf 无可用软件源,请配置 .repo 或传 KYLIN_REPO_URL"; exit 1; }; \ - $PM install -y git vim wget curl make patch gcc gcc-c++ \ + $PM install -y git vim wget curl make patch tar gzip gcc gcc-c++ \ openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ From 662559b10d6a4675217f0ee0676d240f976fa136 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 09:37:44 +0800 Subject: [PATCH 12/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index a9fc1aeb1fc1..03128de98eb8 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -88,9 +88,11 @@ RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTH mkdir -p /tmp/pybuild && tar -xzf /tmp/Python.tgz -C /tmp/pybuild --strip-components=1 && \ cd /tmp/pybuild && \ ./configure --prefix=/usr/local --enable-shared --with-ensurepip=install && \ - make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig && \ + make -j"${MAX_JOBS:-$(nproc)}" && make install && \ + mkdir -p /etc/ld.so.conf.d && echo /usr/local/lib > /etc/ld.so.conf.d/usr-local.conf && ldconfig && \ rm -rf /tmp/pybuild /tmp/Python.tgz && \ - python3 -V && python3 -m pip install -U pip setuptools wheel + LD_LIBRARY_PATH=/usr/local/lib python3 -V && \ + LD_LIBRARY_PATH=/usr/local/lib python3 -m pip install -U pip setuptools wheel ENV PATH=/usr/local/bin:$PATH \ LD_LIBRARY_PATH=/usr/local/lib From 385ca55c0131f3cdbb8393ab032c9479d49a7cc6 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 09:50:05 +0800 Subject: [PATCH 13/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 03128de98eb8..d978f5550eb2 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -90,7 +90,7 @@ RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTH ./configure --prefix=/usr/local --enable-shared --with-ensurepip=install && \ make -j"${MAX_JOBS:-$(nproc)}" && make install && \ mkdir -p /etc/ld.so.conf.d && echo /usr/local/lib > /etc/ld.so.conf.d/usr-local.conf && ldconfig && \ - rm -rf /tmp/pybuild /tmp/Python.tgz && \ + cd /tmp && rm -rf /tmp/pybuild /tmp/Python.tgz && \ LD_LIBRARY_PATH=/usr/local/lib python3 -V && \ LD_LIBRARY_PATH=/usr/local/lib python3 -m pip install -U pip setuptools wheel From a6b68219ec1330b2cc34add73ee8c733fa307c00 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 10:04:53 +0800 Subject: [PATCH 14/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index d978f5550eb2..c72fa662d3d7 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -99,12 +99,16 @@ ENV PATH=/usr/local/bin:$PATH \ # 3) 下载并安装 CANN 9.1.0(toolkit 必装;nnal、A3-ops 存在则装;驱动由宿主机提供) RUN set -e; cd /tmp; \ - wget -q --header="Referer: https://www.hiascend.com/" \ - "${CANN_BASE_URL}/${CANN_TOOLKIT_PKG}"; \ - wget -q --header="Referer: https://www.hiascend.com/" \ - "${CANN_BASE_URL}/${CANN_NNAL_PKG}"; \ - wget -q --header="Referer: https://www.hiascend.com/" \ - "${CANN_BASE_URL}/${CANN_OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ + fetch() { \ + echo "INFO: downloading $1"; \ + curl -fL --retry 3 --retry-delay 5 --connect-timeout 30 \ + -H "Referer: https://www.hiascend.com/" \ + -o "$(basename "$1")" "$1"; \ + }; \ + fetch "${CANN_BASE_URL}/${CANN_TOOLKIT_PKG}"; \ + fetch "${CANN_BASE_URL}/${CANN_NNAL_PKG}"; \ + fetch "${CANN_BASE_URL}/${CANN_OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ + ls -lh /tmp/*.run; \ chmod +x /tmp/*.run; \ /tmp/${CANN_TOOLKIT_PKG} --install; \ /tmp/${CANN_NNAL_PKG} --install; \ From 3cecc0d03ac89306dcc25b11422395fa23a2d01d Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 10:15:39 +0800 Subject: [PATCH 15/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index c72fa662d3d7..6eaadad6eef2 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -75,7 +75,7 @@ RUN set -e; \ curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ fi; \ $PM makecache || { echo "ERROR: dnf 无可用软件源,请配置 .repo 或传 KYLIN_REPO_URL"; exit 1; }; \ - $PM install -y git vim wget curl make patch tar gzip gcc gcc-c++ \ + $PM install -y git vim wget curl make patch tar gzip gawk sed grep findutils gcc gcc-c++ \ openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ @@ -108,11 +108,17 @@ RUN set -e; cd /tmp; \ fetch "${CANN_BASE_URL}/${CANN_TOOLKIT_PKG}"; \ fetch "${CANN_BASE_URL}/${CANN_NNAL_PKG}"; \ fetch "${CANN_BASE_URL}/${CANN_OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ + df -h /tmp; \ + for t in awk sed grep tar gzip md5sum; do \ + command -v "$t" >/dev/null || echo "WARN: 缺少命令 $t"; \ + done; \ ls -lh /tmp/*.run; \ chmod +x /tmp/*.run; \ - /tmp/${CANN_TOOLKIT_PKG} --install; \ - /tmp/${CANN_NNAL_PKG} --install; \ - if [ -f "/tmp/${CANN_OPS_PKG}" ]; then /tmp/${CANN_OPS_PKG} --install; fi; \ + /tmp/${CANN_TOOLKIT_PKG} --install || { rc=$?; echo "ERROR: CANN toolkit 安装失败 (exit $rc)"; exit $rc; }; \ + /tmp/${CANN_NNAL_PKG} --install || { rc=$?; echo "ERROR: CANN nnal 安装失败 (exit $rc)"; exit $rc; }; \ + if [ -f "/tmp/${CANN_OPS_PKG}" ]; then \ + /tmp/${CANN_OPS_PKG} --install || { rc=$?; echo "ERROR: CANN A3-ops 安装失败 (exit $rc)"; exit $rc; }; \ + fi; \ rm -f /tmp/*.run # 4) modelscope / ray(多机) / protobuf;cmake>=3.26 与 ninja 由 pip 提供 From c355a03f79a2f1f923b80a4f861bf67d0423e041 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 10:27:58 +0800 Subject: [PATCH 16/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 6eaadad6eef2..ef438644afae 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -114,10 +114,23 @@ RUN set -e; cd /tmp; \ done; \ ls -lh /tmp/*.run; \ chmod +x /tmp/*.run; \ - /tmp/${CANN_TOOLKIT_PKG} --install || { rc=$?; echo "ERROR: CANN toolkit 安装失败 (exit $rc)"; exit $rc; }; \ - /tmp/${CANN_NNAL_PKG} --install || { rc=$?; echo "ERROR: CANN nnal 安装失败 (exit $rc)"; exit $rc; }; \ + fail() { \ + rc=$1; name=$2; shift 2; \ + echo "ERROR: CANN ${name} 安装失败 (exit $rc)"; \ + df -h /tmp /usr/local || true; \ + ls -l /tmp/*.run || true; \ + echo "----- ${name} installer log (tail 80) -----"; \ + tail -n 80 /tmp/cann_install.log || true; \ + if [ -f /var/log/ascend_seclog/ascend_install.log ]; then \ + echo "----- ascend_install.log (tail 80) -----"; \ + tail -n 80 /var/log/ascend_seclog/ascend_install.log; \ + fi; \ + exit $rc; \ + }; \ + /tmp/${CANN_TOOLKIT_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ + /tmp/${CANN_NNAL_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? nnal; \ if [ -f "/tmp/${CANN_OPS_PKG}" ]; then \ - /tmp/${CANN_OPS_PKG} --install || { rc=$?; echo "ERROR: CANN A3-ops 安装失败 (exit $rc)"; exit $rc; }; \ + /tmp/${CANN_OPS_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ fi; \ rm -f /tmp/*.run From edb9aba73ea67a65d2dbe7f4aba10dffdf8cdf04 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 10:45:29 +0800 Subject: [PATCH 17/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index ef438644afae..4f3234fdd65c 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -127,10 +127,10 @@ RUN set -e; cd /tmp; \ fi; \ exit $rc; \ }; \ - /tmp/${CANN_TOOLKIT_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ - /tmp/${CANN_NNAL_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? nnal; \ + /tmp/${CANN_TOOLKIT_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ + /tmp/${CANN_NNAL_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? nnal; \ if [ -f "/tmp/${CANN_OPS_PKG}" ]; then \ - /tmp/${CANN_OPS_PKG} --install > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ + /tmp/${CANN_OPS_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ fi; \ rm -f /tmp/*.run From 6e00f931b9d8ba7bc28d697d0e4c3b8a9f909a8e Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 11:04:27 +0800 Subject: [PATCH 18/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 48 +++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 4f3234fdd65c..ba247204bce6 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -32,6 +32,7 @@ # 可选参数: # --build-arg KYLIN_REPO_URL=<麒麟 dnf 源 .repo 地址> 基础镜像已内置源,缺省即用镜像内配置 # --build-arg CANN_BASE_URL=<内网 CANN 包地址> 外网不可达时改为内网镜像 +# --build-arg CANN_PKG_ARCH=aarch64|x86_64 缺省按构建架构自动选择 # --build-arg ETCD_VERSION=v3.5.21 内置 etcd 版本 # --build-arg MAX_JOBS=32 # @@ -55,10 +56,11 @@ ARG MOONCAKE_TAG=v0.3.12.post1 ARG MAX_JOBS # CANN 9.1.0 官方包(内网可整体替换 CANN_BASE_URL) +# 包名中的架构段默认按构建架构自动选择(aarch64 / x86_64), +# CI 的 a3 矩阵同时跑 amd64 与 arm64 runner,写死会在另一架构上装不上。 ARG CANN_BASE_URL=https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.1.0 -ARG CANN_TOOLKIT_PKG=Ascend-cann-toolkit_9.1.0_linux-aarch64.run -ARG CANN_NNAL_PKG=Ascend-cann-nnal_9.1.0_linux-aarch64.run -ARG CANN_OPS_PKG=Ascend-cann-A3-ops_9.1.0_linux-aarch64.run +ARG CANN_VERSION=9.1.0 +ARG CANN_PKG_ARCH="" WORKDIR /workspace SHELL ["/bin/bash", "-c"] @@ -99,15 +101,26 @@ ENV PATH=/usr/local/bin:$PATH \ # 3) 下载并安装 CANN 9.1.0(toolkit 必装;nnal、A3-ops 存在则装;驱动由宿主机提供) RUN set -e; cd /tmp; \ + if [ -z "${CANN_PKG_ARCH}" ]; then \ + case "$(uname -m)" in \ + aarch64) CANN_PKG_ARCH=aarch64 ;; \ + x86_64) CANN_PKG_ARCH=x86_64 ;; \ + *) echo "ERROR: 不支持的架构 $(uname -m)"; exit 1 ;; \ + esac; \ + fi; \ + TOOLKIT_PKG="Ascend-cann-toolkit_${CANN_VERSION}_linux-${CANN_PKG_ARCH}.run"; \ + NNAL_PKG="Ascend-cann-nnal_${CANN_VERSION}_linux-${CANN_PKG_ARCH}.run"; \ + OPS_PKG="Ascend-cann-A3-ops_${CANN_VERSION}_linux-${CANN_PKG_ARCH}.run"; \ + echo "INFO: CANN 包架构 ${CANN_PKG_ARCH}"; \ fetch() { \ echo "INFO: downloading $1"; \ curl -fL --retry 3 --retry-delay 5 --connect-timeout 30 \ -H "Referer: https://www.hiascend.com/" \ -o "$(basename "$1")" "$1"; \ }; \ - fetch "${CANN_BASE_URL}/${CANN_TOOLKIT_PKG}"; \ - fetch "${CANN_BASE_URL}/${CANN_NNAL_PKG}"; \ - fetch "${CANN_BASE_URL}/${CANN_OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ + fetch "${CANN_BASE_URL}/${TOOLKIT_PKG}"; \ + fetch "${CANN_BASE_URL}/${NNAL_PKG}"; \ + fetch "${CANN_BASE_URL}/${OPS_PKG}" || echo "WARN: ops 包下载失败,跳过"; \ df -h /tmp; \ for t in awk sed grep tar gzip md5sum; do \ command -v "$t" >/dev/null || echo "WARN: 缺少命令 $t"; \ @@ -127,10 +140,10 @@ RUN set -e; cd /tmp; \ fi; \ exit $rc; \ }; \ - /tmp/${CANN_TOOLKIT_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ - /tmp/${CANN_NNAL_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? nnal; \ - if [ -f "/tmp/${CANN_OPS_PKG}" ]; then \ - /tmp/${CANN_OPS_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ + /tmp/${TOOLKIT_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ + /tmp/${NNAL_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? nnal; \ + if [ -f "/tmp/${OPS_PKG}" ]; then \ + /tmp/${OPS_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ fi; \ rm -f /tmp/*.run @@ -178,12 +191,25 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ python3 -m pip cache purge # 7) memfabric kernel + flash-linear-attention + flash_attn_npu +# FLA(a3) 在 Ascend 源上的所有版本都只提供 manylinux_2_34 轮子,而麒麟 V10 glibc 是 2.28, +# pip 会直接判 "not a supported wheel"。该包是 py3-none(纯 python + CANN 算子 .so), +# 所以按架构下载后把平台标签改写为 any 再本地安装,绕开 pip 的标签校验。 RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ TORCH_DEVICE_BACKEND_AUTOLOAD=0 mfcli kernel install --soc-version A3 --install-for-all && \ + case "$(uname -m)" in \ + aarch64) PKG_ARCH=aarch64 ;; \ + x86_64) PKG_ARCH=x86_64 ;; \ + *) echo "ERROR: 不支持的架构 $(uname -m)"; exit 1 ;; \ + esac && \ + FLA_WHL="flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-manylinux_2_34-${PKG_ARCH}.whl" && \ + curl -fL --retry 3 --retry-delay 5 -o /tmp/fla.whl \ + "${ASCEND_INDEX_URL}/flash-linear-attention-npu-a3/${FLA_WHL//+/%2B}" && \ + cp /tmp/fla.whl "/tmp/flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-any.whl" && \ python3 -m pip install --force-reinstall --no-deps \ - "flash-linear-attention-npu-a3===${FLA_VERSION}" && \ + "/tmp/flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-any.whl" && \ + rm -f /tmp/fla.whl "/tmp/flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-any.whl" && \ FLASH_ATTN_BUILD_NPU=910 python3 -m pip install --no-build-isolation \ "flash_attn_npu==${FLASH_ATTN_NPU_VERSION}" && \ python3 -m pip cache purge From 9bc30c78cc90be000fece1e2e5ff3aa894d5802c Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 11:23:47 +0800 Subject: [PATCH 19/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index ba247204bce6..51277b7db9f7 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -99,6 +99,12 @@ RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTH ENV PATH=/usr/local/bin:$PATH \ LD_LIBRARY_PATH=/usr/local/lib +# 2b) CANN 安装前需要的基础 Python 库(CANN 9.1 官方安装依赖清单; +# pathlib2 已不兼容 py3.12,故不安装) +RUN python3 -m pip install attrs cython numpy decorator sympy cffi pyyaml \ + psutil protobuf scipy requests absl-py && \ + python3 -m pip cache purge + # 3) 下载并安装 CANN 9.1.0(toolkit 必装;nnal、A3-ops 存在则装;驱动由宿主机提供) RUN set -e; cd /tmp; \ if [ -z "${CANN_PKG_ARCH}" ]; then \ @@ -127,23 +133,26 @@ RUN set -e; cd /tmp; \ done; \ ls -lh /tmp/*.run; \ chmod +x /tmp/*.run; \ - fail() { \ - rc=$1; name=$2; shift 2; \ - echo "ERROR: CANN ${name} 安装失败 (exit $rc)"; \ + report() { \ + rc=$1; name=$2; log=$3; \ + echo "===== CANN ${name} 安装失败 rc=${rc} ====="; \ df -h /tmp /usr/local || true; \ - ls -l /tmp/*.run || true; \ - echo "----- ${name} installer log (tail 80) -----"; \ - tail -n 80 /tmp/cann_install.log || true; \ + echo "----- ${log} 末尾 15 行 -----"; \ + tail -n 15 "$log" || true; \ + echo "----- ${log} 错误行 -----"; \ + grep -i -E "\[ERROR\]|ERR_NO|failed|No space|Permission denied" "$log" | tail -n 10 || true; \ if [ -f /var/log/ascend_seclog/ascend_install.log ]; then \ - echo "----- ascend_install.log (tail 80) -----"; \ - tail -n 80 /var/log/ascend_seclog/ascend_install.log; \ + echo "----- ascend_install.log 错误行 -----"; \ + grep -i -E "\[ERROR\]|ERR_NO|failed" /var/log/ascend_seclog/ascend_install.log | tail -n 10 || true; \ fi; \ + ls -l /var/log/ascend_seclog/ 2>/dev/null || true; \ + echo "CANN_FAIL ${name} rc=${rc} log=${log}"; \ exit $rc; \ }; \ - /tmp/${TOOLKIT_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? toolkit; \ - /tmp/${NNAL_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? nnal; \ + /tmp/${TOOLKIT_PKG} --install --quiet > /tmp/cann_toolkit.log 2>&1 || report $? toolkit /tmp/cann_toolkit.log; \ + /tmp/${NNAL_PKG} --install --quiet > /tmp/cann_nnal.log 2>&1 || report $? nnal /tmp/cann_nnal.log; \ if [ -f "/tmp/${OPS_PKG}" ]; then \ - /tmp/${OPS_PKG} --install --quiet > /tmp/cann_install.log 2>&1 || fail $? a3-ops; \ + /tmp/${OPS_PKG} --install --quiet > /tmp/cann_ops.log 2>&1 || report $? a3-ops /tmp/cann_ops.log; \ fi; \ rm -f /tmp/*.run @@ -184,7 +193,7 @@ ENV SOC_VERSION=$SOC_VERSION \ COPY . /vllm-workspace/vllm-ascend/ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ export VLLM_BATCH_INVARIANT=1 && \ - source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ + for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ python3 -m pip install -e /vllm-workspace/vllm-ascend/ \ --extra-index-url ${PYTORCH_INDEX_URL} && \ @@ -195,7 +204,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ # pip 会直接判 "not a supported wheel"。该包是 py3-none(纯 python + CANN 算子 .so), # 所以按架构下载后把平台标签改写为 any 再本地安装,绕开 pip 的标签校验。 RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ - source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ + for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ TORCH_DEVICE_BACKEND_AUTOLOAD=0 mfcli kernel install --soc-version A3 --install-for-all && \ case "$(uname -m)" in \ @@ -215,7 +224,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ python3 -m pip cache purge # 8) 从源码编译 mooncake 0.3.12.post1(与客户环境一致,不走 pip 二进制) -RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ +RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ git clone --depth 1 -b ${MOONCAKE_TAG} ${MOONCAKE_REPO} /tmp/Mooncake && \ cd /tmp/Mooncake && mkdir -p build && cd build && \ cmake .. -DCMAKE_BUILD_TYPE=Release \ @@ -223,7 +232,7 @@ RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig # 9) mooncake python 绑定 -RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ +RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ cd /tmp/Mooncake && python3 -m pip install . && \ rm -rf /tmp/Mooncake && python3 -m pip cache purge From a92cd38f044f17056b66fd50969f236d22c7cd5c Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 11:38:38 +0800 Subject: [PATCH 20/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 51277b7db9f7..44e9e6578c11 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -106,6 +106,8 @@ RUN python3 -m pip install attrs cython numpy decorator sympy cffi pyyaml \ python3 -m pip cache purge # 3) 下载并安装 CANN 9.1.0(toolkit 必装;nnal、A3-ops 存在则装;驱动由宿主机提供) +# 注意:NNAL 要求"已安装同版本 Toolkit 并配置环境变量",否则安装器直接退出(rc=4), +# 所以 toolkit 装完后先 source set_env.sh 再装 nnal / A3-ops。 RUN set -e; cd /tmp; \ if [ -z "${CANN_PKG_ARCH}" ]; then \ case "$(uname -m)" in \ @@ -150,6 +152,7 @@ RUN set -e; cd /tmp; \ exit $rc; \ }; \ /tmp/${TOOLKIT_PKG} --install --quiet > /tmp/cann_toolkit.log 2>&1 || report $? toolkit /tmp/cann_toolkit.log; \ + for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done; \ /tmp/${NNAL_PKG} --install --quiet > /tmp/cann_nnal.log 2>&1 || report $? nnal /tmp/cann_nnal.log; \ if [ -f "/tmp/${OPS_PKG}" ]; then \ /tmp/${OPS_PKG} --install --quiet > /tmp/cann_ops.log 2>&1 || report $? a3-ops /tmp/cann_ops.log; \ From c9b9badcb973fb9430d4144427bf2b665a3021fc Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 11:53:04 +0800 Subject: [PATCH 21/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 44e9e6578c11..02507a7c2987 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -161,8 +161,10 @@ RUN set -e; cd /tmp; \ # 4) modelscope / ray(多机) / protobuf;cmake>=3.26 与 ninja 由 pip 提供 # (麒麟源里的 cmake 版本低于 vllm-ascend 要求,且镜像初始无 cmake) +# 限定 cmake < 4:CMake 4 移除了对 cmake_minimum_required<3.5 的兼容, +# glog 0.6.0 / mooncake 0.3.12 这类旧工程会直接配置失败 RUN python3 -m pip install 'modelscope<1.38' 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' \ - 'cmake>=3.26' ninja && \ + 'cmake>=3.26,<4' ninja && \ python3 -m pip cache purge # 4b) glog:麒麟 V10 SP3 源里没有 glog/glog-devel,mooncake 依赖 libglog,源码编译 @@ -171,6 +173,7 @@ RUN git clone --depth 1 -b ${GLOG_TAG} https://github.com/google/glog.git /tmp/g cmake -S /tmp/glog -B /tmp/glog/build \ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DCMAKE_INSTALL_PREFIX=/usr/local && \ cmake --build /tmp/glog/build -j"${MAX_JOBS:-$(nproc)}" && \ cmake --install /tmp/glog/build && ldconfig && \ From 40727534dc4d9fbbc1cd98b05bd63d16fceb6020 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 14:22:58 +0800 Subject: [PATCH 22/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 75 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 02507a7c2987..7d1f49a6cc45 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -34,6 +34,7 @@ # --build-arg CANN_BASE_URL=<内网 CANN 包地址> 外网不可达时改为内网镜像 # --build-arg CANN_PKG_ARCH=aarch64|x86_64 缺省按构建架构自动选择 # --build-arg ETCD_VERSION=v3.5.21 内置 etcd 版本 +# --build-arg GCC_VERSION=12.3.0 软件源无 C++20 工具链时源码编译的 GCC 版本 # --build-arg MAX_JOBS=32 # # 本仓库源码必须是 releases/v0.23.0 分支(main 为 vLLM 0.33 世代,无法在此环境运行)。 @@ -77,27 +78,91 @@ RUN set -e; \ curl -fsSL "${KYLIN_REPO_URL}" -o /etc/yum.repos.d/kylin.repo; \ fi; \ $PM makecache || { echo "ERROR: dnf 无可用软件源,请配置 .repo 或传 KYLIN_REPO_URL"; exit 1; }; \ - $PM install -y git vim wget curl make patch tar gzip gawk sed grep findutils gcc gcc-c++ \ - openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + $PM install -y git vim wget curl make patch tar gzip gawk sed grep findutils gcc gcc-c++ m4 \ + openssl-devel bzip2-devel libffi-devel zlib-devel xz xz-devel \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ yaml-cpp-devel gflags-devel boost-devel \ jemalloc clang && \ rm -rf /var/cache/yum/* /var/cache/dnf/* +# 1b) C++20 工具链:vllm-ascend 的依赖 arctic-inference 用 nanobind 构建,要求 C++20, +# 麒麟自带 GCC 7.3 不支持。优先安装软件源里的新版工具链(gcc-toolset-*/gcc-NN), +# 源里没有则源码编译 GCC 到 /usr/local。最终统一软链到 /usr/local/bin,供后续所有编译使用。 +ARG GCC_VERSION=12.3.0 +RUN set -e; \ + PM="$(command -v dnf || command -v yum)"; \ + probe() { \ + printf 'int main(){return 0;}\n' > /tmp/probe.cpp; \ + "$1" -std=c++20 /tmp/probe.cpp -o /tmp/probe.out >/dev/null 2>&1; \ + }; \ + CXX_BIN=""; \ + if probe /usr/bin/g++; then \ + echo "INFO: 系统 g++ 已支持 C++20,无需升级"; \ + CXX_BIN=/usr/bin/g++; \ + else \ + for pkgset in "gcc-toolset-12-gcc gcc-toolset-12-gcc-c++" \ + "gcc-toolset-11-gcc gcc-toolset-11-gcc-c++" \ + "gcc-toolset-10-gcc gcc-toolset-10-gcc-c++" \ + "gcc-10 gcc-c++-10" \ + "gcc10 gcc10-c++"; do \ + echo "INFO: 尝试从软件源安装 ${pkgset}"; \ + $PM install -y ${pkgset} >/dev/null 2>&1 || continue; \ + for c in /opt/rh/gcc-toolset-12/root/usr/bin/g++ \ + /opt/rh/gcc-toolset-11/root/usr/bin/g++ \ + /opt/rh/gcc-toolset-10/root/usr/bin/g++ \ + /usr/bin/g++-10 /usr/bin/g++10; do \ + if [ -x "$c" ] && probe "$c"; then CXX_BIN="$c"; break; fi; \ + done; \ + [ -n "$CXX_BIN" ] && break; \ + done; \ + fi; \ + if [ -z "$CXX_BIN" ]; then \ + echo "INFO: 软件源无可用 C++20 编译器,源码编译 GCC ${GCC_VERSION}"; \ + curl -fsSL "https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz" -o /tmp/gcc.tar.gz; \ + mkdir -p /tmp/gccsrc && tar -xzf /tmp/gcc.tar.gz -C /tmp/gccsrc --strip-components=1; \ + cd /tmp/gccsrc && ./contrib/download_prerequisites; \ + mkdir -p /tmp/gccbuild && cd /tmp/gccbuild && \ + /tmp/gccsrc/configure --prefix=/usr/local --enable-languages=c,c++ \ + --disable-bootstrap --disable-multilib --with-system-zlib && \ + make -j"${MAX_JOBS:-$(nproc)}" && make install-strip; \ + cd / && rm -rf /tmp/gccsrc /tmp/gccbuild /tmp/gcc.tar.gz; \ + CXX_BIN=/usr/local/bin/g++; \ + fi; \ + probe "$CXX_BIN" || { echo "ERROR: $CXX_BIN 仍不支持 C++20"; exit 1; }; \ + CC_BIN="${CXX_BIN%g++}gcc"; \ + echo "INFO: 选用编译器 $CXX_BIN (版本 $("$CXX_BIN" -dumpversion))"; \ + mkdir -p /usr/local/bin /usr/local/lib64; \ + ln -sf "$CXX_BIN" /usr/local/bin/g++; \ + ln -sf "$CC_BIN" /usr/local/bin/gcc; \ + ln -sf "$CXX_BIN" /usr/local/bin/c++; \ + ln -sf "$CC_BIN" /usr/local/bin/cc; \ + STDCPP="$("$CXX_BIN" -print-file-name=libstdc++.so)"; \ + if [ -f "$STDCPP" ]; then \ + CXX_LIBDIR="$(dirname "$(readlink -f "$STDCPP")")"; \ + if [ "$CXX_LIBDIR" != "/usr/local/lib64" ]; then \ + for f in "$CXX_LIBDIR"/libstdc++.so.6*; do ln -sf "$f" /usr/local/lib64/; done; \ + fi; \ + fi; \ + ldconfig; \ + /usr/local/bin/g++ --version | head -1 + +ENV CC=/usr/local/bin/gcc \ + CXX=/usr/local/bin/g++ + # 2) 源码编译 Python 3.12(麒麟 V10 自带 3.7,不满足 torch 2.10 / vLLM 0.23 要求) RUN curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /tmp/Python.tgz && \ mkdir -p /tmp/pybuild && tar -xzf /tmp/Python.tgz -C /tmp/pybuild --strip-components=1 && \ cd /tmp/pybuild && \ ./configure --prefix=/usr/local --enable-shared --with-ensurepip=install && \ make -j"${MAX_JOBS:-$(nproc)}" && make install && \ - mkdir -p /etc/ld.so.conf.d && echo /usr/local/lib > /etc/ld.so.conf.d/usr-local.conf && ldconfig && \ + mkdir -p /etc/ld.so.conf.d && printf '/usr/local/lib\n/usr/local/lib64\n' > /etc/ld.so.conf.d/usr-local.conf && ldconfig && \ cd /tmp && rm -rf /tmp/pybuild /tmp/Python.tgz && \ LD_LIBRARY_PATH=/usr/local/lib python3 -V && \ LD_LIBRARY_PATH=/usr/local/lib python3 -m pip install -U pip setuptools wheel ENV PATH=/usr/local/bin:$PATH \ - LD_LIBRARY_PATH=/usr/local/lib + LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib # 2b) CANN 安装前需要的基础 Python 库(CANN 9.1 官方安装依赖清单; # pathlib2 已不兼容 py3.12,故不安装) @@ -243,7 +308,7 @@ RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/ rm -rf /tmp/Mooncake && python3 -m pip cache purge RUN echo 'export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD' >> ~/.bashrc && \ - echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc + echo 'export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc # 10) 内置 etcd(MindIE-Motor 服务发现;离线运行不再依赖外部 etcd) ARG ETCD_VERSION=v3.5.21 From b3f9b194c618cac0739a86a453298eb926792aab Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 14:58:22 +0800 Subject: [PATCH 23/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 7d1f49a6cc45..e86c113dece4 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -35,6 +35,7 @@ # --build-arg CANN_PKG_ARCH=aarch64|x86_64 缺省按构建架构自动选择 # --build-arg ETCD_VERSION=v3.5.21 内置 etcd 版本 # --build-arg GCC_VERSION=12.3.0 软件源无 C++20 工具链时源码编译的 GCC 版本 +# --build-arg GCC_TARBALL_URL=<内网 gcc 源码 tar 地址> 可选,优先于公网地址 # --build-arg MAX_JOBS=32 # # 本仓库源码必须是 releases/v0.23.0 分支(main 为 vLLM 0.33 世代,无法在此环境运行)。 @@ -90,6 +91,7 @@ RUN set -e; \ # 麒麟自带 GCC 7.3 不支持。优先安装软件源里的新版工具链(gcc-toolset-*/gcc-NN), # 源里没有则源码编译 GCC 到 /usr/local。最终统一软链到 /usr/local/bin,供后续所有编译使用。 ARG GCC_VERSION=12.3.0 +ARG GCC_TARBALL_URL="" RUN set -e; \ PM="$(command -v dnf || command -v yum)"; \ probe() { \ @@ -119,14 +121,31 @@ RUN set -e; \ fi; \ if [ -z "$CXX_BIN" ]; then \ echo "INFO: 软件源无可用 C++20 编译器,源码编译 GCC ${GCC_VERSION}"; \ - curl -fsSL "https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz" -o /tmp/gcc.tar.gz; \ - mkdir -p /tmp/gccsrc && tar -xzf /tmp/gcc.tar.gz -C /tmp/gccsrc --strip-components=1; \ + GCC_TAR=/tmp/gcc.tar; rm -f "$GCC_TAR"; \ + URLS="https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ +https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ +https://mirrors.aliyun.com/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ +https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz"; \ + if [ -n "${GCC_TARBALL_URL}" ]; then URLS="${GCC_TARBALL_URL} ${URLS}"; fi; \ + for url in $URLS; do \ + echo "INFO: 下载 GCC 源码 ${url}"; \ + if curl -fL --retry 10 --retry-all-errors --retry-delay 5 --connect-timeout 30 \ + -C - -o "$GCC_TAR" "$url" && tar -tf "$GCC_TAR" >/dev/null 2>&1; then \ + break; \ + fi; \ + rm -f "$GCC_TAR"; \ + done; \ + if ! tar -tf "$GCC_TAR" >/dev/null 2>&1; then \ + echo "ERROR: GCC 源码下载失败(网络不稳可直接用 --build-arg GCC_TARBALL_URL 指内网地址)"; \ + exit 1; \ + fi; \ + mkdir -p /tmp/gccsrc && tar -xf "$GCC_TAR" -C /tmp/gccsrc --strip-components=1; \ cd /tmp/gccsrc && ./contrib/download_prerequisites; \ mkdir -p /tmp/gccbuild && cd /tmp/gccbuild && \ /tmp/gccsrc/configure --prefix=/usr/local --enable-languages=c,c++ \ --disable-bootstrap --disable-multilib --with-system-zlib && \ make -j"${MAX_JOBS:-$(nproc)}" && make install-strip; \ - cd / && rm -rf /tmp/gccsrc /tmp/gccbuild /tmp/gcc.tar.gz; \ + cd / && rm -rf /tmp/gccsrc /tmp/gccbuild "$GCC_TAR"; \ CXX_BIN=/usr/local/bin/g++; \ fi; \ probe "$CXX_BIN" || { echo "ERROR: $CXX_BIN 仍不支持 C++20"; exit 1; }; \ From 79ae972eb0e7c5bb2fd4a9106ed57a3e8f75f1e5 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 15:32:00 +0800 Subject: [PATCH 24/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index e86c113dece4..5c3d82c63d19 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -122,17 +122,21 @@ RUN set -e; \ if [ -z "$CXX_BIN" ]; then \ echo "INFO: 软件源无可用 C++20 编译器,源码编译 GCC ${GCC_VERSION}"; \ GCC_TAR=/tmp/gcc.tar; rm -f "$GCC_TAR"; \ - URLS="https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ -https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ + URLS="https://mirrors.huaweicloud.com/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ +https://mirrors.huaweicloud.com/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \ +https://repo.huaweicloud.com/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \ https://mirrors.aliyun.com/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ -https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz"; \ +https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz \ +https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"; \ if [ -n "${GCC_TARBALL_URL}" ]; then URLS="${GCC_TARBALL_URL} ${URLS}"; fi; \ for url in $URLS; do \ echo "INFO: 下载 GCC 源码 ${url}"; \ - if curl -fL --retry 10 --retry-all-errors --retry-delay 5 --connect-timeout 30 \ - -C - -o "$GCC_TAR" "$url" && tar -tf "$GCC_TAR" >/dev/null 2>&1; then \ + if curl -fL --retry 3 --retry-delay 3 --connect-timeout 20 \ + --speed-limit 102400 --speed-time 30 --max-time 900 \ + -o "$GCC_TAR" "$url" && tar -tf "$GCC_TAR" >/dev/null 2>&1; then \ break; \ fi; \ + echo "INFO: 该地址失败或过慢,换下一个"; \ rm -f "$GCC_TAR"; \ done; \ if ! tar -tf "$GCC_TAR" >/dev/null 2>&1; then \ From c62f13e4d62399f44dc8524ada95ff64adffd84d Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 15:45:05 +0800 Subject: [PATCH 25/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 5c3d82c63d19..ffe5de9b7a09 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -144,7 +144,44 @@ https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"; \ exit 1; \ fi; \ mkdir -p /tmp/gccsrc && tar -xf "$GCC_TAR" -C /tmp/gccsrc --strip-components=1; \ - cd /tmp/gccsrc && ./contrib/download_prerequisites; \ + dep_fetch() { \ + local target="$1"; shift; \ + for url in "$@"; do \ + echo "INFO: 下载 GCC 依赖 ${url}"; \ + if curl -fL --retry 3 --retry-delay 3 --connect-timeout 20 \ + --speed-limit 51200 --speed-time 30 --max-time 600 \ + -o /tmp/dep.tar "$url" && tar -tf /tmp/dep.tar >/dev/null 2>&1; then \ + mkdir -p "/tmp/gccsrc/${target}" && \ + tar -xf /tmp/dep.tar -C "/tmp/gccsrc/${target}" --strip-components=1 && \ + rm -f /tmp/dep.tar && return 0; \ + fi; \ + rm -f /tmp/dep.tar; \ + done; \ + return 1; \ + }; \ + dep_fetch gmp gmp-6.2.1 \ + https://mirrors.huaweicloud.com/gnu/gmp/gmp-6.2.1.tar.xz \ + https://mirrors.aliyun.com/gnu/gmp/gmp-6.2.1.tar.xz \ + https://mirrors.tuna.tsinghua.edu.cn/gnu/gmp/gmp-6.2.1.tar.xz \ + https://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.2.1.tar.bz2 \ + || { echo "ERROR: GMP 源码下载失败"; exit 1; }; \ + dep_fetch mpfr mpfr-4.1.0 \ + https://mirrors.huaweicloud.com/gnu/mpfr/mpfr-4.1.0.tar.xz \ + https://mirrors.aliyun.com/gnu/mpfr/mpfr-4.1.0.tar.xz \ + https://mirrors.tuna.tsinghua.edu.cn/gnu/mpfr/mpfr-4.1.0.tar.xz \ + https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-4.1.0.tar.bz2 \ + || { echo "ERROR: MPFR 源码下载失败"; exit 1; }; \ + dep_fetch mpc mpc-1.2.1 \ + https://mirrors.huaweicloud.com/gnu/mpc/mpc-1.2.1.tar.gz \ + https://mirrors.aliyun.com/gnu/mpc/mpc-1.2.1.tar.gz \ + https://mirrors.tuna.tsinghua.edu.cn/gnu/mpc/mpc-1.2.1.tar.gz \ + https://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.2.1.tar.gz \ + || { echo "ERROR: MPC 源码下载失败"; exit 1; }; \ + if ! dep_fetch isl isl-0.24 \ + https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.24.tar.bz2 \ + https://libisl.sourceforge.io/isl-0.24.tar.bz2; then \ + echo "WARN: ISL 下载失败,构建时自动跳过 graphite(不影响 C/C++ 编译)"; \ + fi; \ mkdir -p /tmp/gccbuild && cd /tmp/gccbuild && \ /tmp/gccsrc/configure --prefix=/usr/local --enable-languages=c,c++ \ --disable-bootstrap --disable-multilib --with-system-zlib && \ From a9805c066b5fa7a6b5833cedf0f927e18b3f4747 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 18:02:11 +0800 Subject: [PATCH 26/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index ffe5de9b7a09..567b1fc6931a 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -193,15 +193,23 @@ https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz"; \ CC_BIN="${CXX_BIN%g++}gcc"; \ echo "INFO: 选用编译器 $CXX_BIN (版本 $("$CXX_BIN" -dumpversion))"; \ mkdir -p /usr/local/bin /usr/local/lib64; \ - ln -sf "$CXX_BIN" /usr/local/bin/g++; \ - ln -sf "$CC_BIN" /usr/local/bin/gcc; \ - ln -sf "$CXX_BIN" /usr/local/bin/c++; \ - ln -sf "$CC_BIN" /usr/local/bin/cc; \ + link_tool() { \ + src="$1"; dst="/usr/local/bin/$2"; \ + if [ "$(readlink -f "$src")" = "$(readlink -f "$dst")" ]; then return 0; fi; \ + ln -sf "$src" "$dst"; \ + }; \ + link_tool "$CXX_BIN" g++; \ + link_tool "$CC_BIN" gcc; \ + link_tool "$CXX_BIN" c++; \ + link_tool "$CC_BIN" cc; \ STDCPP="$("$CXX_BIN" -print-file-name=libstdc++.so)"; \ if [ -f "$STDCPP" ]; then \ CXX_LIBDIR="$(dirname "$(readlink -f "$STDCPP")")"; \ if [ "$CXX_LIBDIR" != "/usr/local/lib64" ]; then \ - for f in "$CXX_LIBDIR"/libstdc++.so.6*; do ln -sf "$f" /usr/local/lib64/; done; \ + for f in "$CXX_LIBDIR"/libstdc++.so.6*; do \ + [ -e "$f" ] || continue; \ + ln -sf "$f" /usr/local/lib64/; \ + done; \ fi; \ fi; \ ldconfig; \ From 269b4e5c506ea8b6493d29ce5df8c65456b15ae9 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Tue, 24 Nov 2026 20:29:16 +0800 Subject: [PATCH 27/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 567b1fc6931a..e9320eefe78b 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -351,9 +351,9 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ x86_64) PKG_ARCH=x86_64 ;; \ *) echo "ERROR: 不支持的架构 $(uname -m)"; exit 1 ;; \ esac && \ - FLA_WHL="flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-manylinux_2_34-${PKG_ARCH}.whl" && \ + FLA_WHL="flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-manylinux_2_34_${PKG_ARCH}.whl" && \ curl -fL --retry 3 --retry-delay 5 -o /tmp/fla.whl \ - "${ASCEND_INDEX_URL}/flash-linear-attention-npu-a3/${FLA_WHL//+/%2B}" && \ + "${ASCEND_INDEX_URL}/flash-linear-attention-npu-a3/${FLA_WHL}" && \ cp /tmp/fla.whl "/tmp/flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-any.whl" && \ python3 -m pip install --force-reinstall --no-deps \ "/tmp/flash_linear_attention_npu_a3-${FLA_VERSION}-py3-none-any.whl" && \ From d10dfb249fc9be413874268fe8e451f2ab67e8f0 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Wed, 25 Nov 2026 10:12:42 +0800 Subject: [PATCH 28/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index e9320eefe78b..36d78847ddb7 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -363,8 +363,17 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ python3 -m pip cache purge # 8) 从源码编译 mooncake 0.3.12.post1(与客户环境一致,不走 pip 二进制) +# mooncake 的 cmake 通过 find_package(yalantinglibs) 找 coro_rpc 依赖,该库以子模块 +# extern/yalantinglibs 形式提供,必须 --recurse-submodules 一起拉下来并先装好, +# 否则 configure 直接报 "Could not find a package configuration file provided by yalantinglibs"。 RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ - git clone --depth 1 -b ${MOONCAKE_TAG} ${MOONCAKE_REPO} /tmp/Mooncake && \ + git clone -b ${MOONCAKE_TAG} --recurse-submodules ${MOONCAKE_REPO} /tmp/Mooncake && \ + cmake -S /tmp/Mooncake/extern/yalantinglibs -B /tmp/ylt-build \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF && \ + cmake --build /tmp/ylt-build -j"${MAX_JOBS:-$(nproc)}" && \ + cmake --install /tmp/ylt-build && \ + rm -rf /tmp/ylt-build && ldconfig && \ cd /tmp/Mooncake && mkdir -p build && cd build && \ cmake .. -DCMAKE_BUILD_TYPE=Release \ -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON && \ From 80ffc6931293ec4f998687ef766d79fc99824e1e Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Wed, 25 Nov 2026 10:53:52 +0800 Subject: [PATCH 29/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 36d78847ddb7..7c8a3d76045b 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -84,7 +84,11 @@ RUN set -e; \ sqlite-devel readline-devel ncurses-devel \ numactl numactl-devel libibverbs-devel hiredis-devel libcurl-devel \ yaml-cpp-devel gflags-devel boost-devel \ + zstd libzstd-devel \ jemalloc clang && \ + for p in libaio-devel libunwind-devel jsoncpp-devel liburing-devel; do \ + $PM install -y "$p" || echo "WARN: 可选依赖 $p 不可用,稍后由源码编译环节兜底"; \ + done; \ rm -rf /var/cache/yum/* /var/cache/dnf/* # 1b) C++20 工具链:vllm-ascend 的依赖 arctic-inference 用 nanobind 构建,要求 C++20, From 29ee20d204c1c11e47e6332cc8553d59ac03c1fb Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Wed, 25 Nov 2026 11:48:24 +0800 Subject: [PATCH 30/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 7c8a3d76045b..fe9b6811854c 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -86,7 +86,7 @@ RUN set -e; \ yaml-cpp-devel gflags-devel boost-devel \ zstd libzstd-devel \ jemalloc clang && \ - for p in libaio-devel libunwind-devel jsoncpp-devel liburing-devel; do \ + for p in libaio-devel libunwind-devel jsoncpp-devel liburing-devel xxhash xxhash-devel; do \ $PM install -y "$p" || echo "WARN: 可选依赖 $p 不可用,稍后由源码编译环节兜底"; \ done; \ rm -rf /var/cache/yum/* /var/cache/dnf/* @@ -370,18 +370,31 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ # mooncake 的 cmake 通过 find_package(yalantinglibs) 找 coro_rpc 依赖,该库以子模块 # extern/yalantinglibs 形式提供,必须 --recurse-submodules 一起拉下来并先装好, # 否则 configure 直接报 "Could not find a package configuration file provided by yalantinglibs"。 -RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ - git clone -b ${MOONCAKE_TAG} --recurse-submodules ${MOONCAKE_REPO} /tmp/Mooncake && \ - cmake -S /tmp/Mooncake/extern/yalantinglibs -B /tmp/ylt-build \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF && \ - cmake --build /tmp/ylt-build -j"${MAX_JOBS:-$(nproc)}" && \ - cmake --install /tmp/ylt-build && \ - rm -rf /tmp/ylt-build && ldconfig && \ - cd /tmp/Mooncake && mkdir -p build && cd build && \ - cmake .. -DCMAKE_BUILD_TYPE=Release \ - -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON && \ - make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig +RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done; \ + LOG=/tmp/mooncake_build.log; : > "$LOG"; \ + set -o pipefail; \ + trap 'rc=$?; if [ $rc -ne 0 ]; then echo "ERROR: mooncake 构建失败,日志尾部:"; tail -n 40 "$LOG"; fi' EXIT; \ + { git clone -b ${MOONCAKE_TAG} --recurse-submodules ${MOONCAKE_REPO} /tmp/Mooncake && \ + cmake -S /tmp/Mooncake/extern/yalantinglibs -B /tmp/ylt-build \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF && \ + cmake --build /tmp/ylt-build -j"${MAX_JOBS:-$(nproc)}" && \ + cmake --install /tmp/ylt-build && \ + rm -rf /tmp/ylt-build && ldconfig && \ + if [ ! -e /usr/include/xxhash.h ] && [ ! -e /usr/local/include/xxhash.h ]; then \ + echo "INFO: 系统无 xxhash 开发头文件,源码编译 xxHash v0.8.3"; \ + git clone --depth 1 -b v0.8.3 https://github.com/Cyan4973/xxHash.git /tmp/xxHash && \ + cmake -S /tmp/xxHash/cmake_unofficial -B /tmp/xxHash/build \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DXXHASH_BUILD_XXHSUM=OFF && \ + cmake --build /tmp/xxHash/build -j"${MAX_JOBS:-$(nproc)}" && \ + cmake --install /tmp/xxHash/build && \ + rm -rf /tmp/xxHash && ldconfig; \ + fi; \ + cd /tmp/Mooncake && mkdir -p build && cd build && \ + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON && \ + make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig; } 2>&1 | tee -a "$LOG" # 9) mooncake python 绑定 RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done && \ From 59ee2bcdee9807a693d7ffb20f9b9390fd9b50f5 Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Wed, 25 Nov 2026 14:13:26 +0800 Subject: [PATCH 31/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index fe9b6811854c..0b6620545346 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -89,6 +89,11 @@ RUN set -e; \ for p in libaio-devel libunwind-devel jsoncpp-devel liburing-devel xxhash xxhash-devel; do \ $PM install -y "$p" || echo "WARN: 可选依赖 $p 不可用,稍后由源码编译环节兜底"; \ done; \ + if ! command -v mpicc >/dev/null 2>&1; then \ + $PM install -y mpich mpich-devel >/dev/null 2>&1 || \ + $PM install -y openmpi openmpi-devel >/dev/null 2>&1 || \ + echo "WARN: 软件源无 MPI 开发包,mooncake 的 USE_ASCEND 传输层将无法编译"; \ + fi; \ rm -rf /var/cache/yum/* /var/cache/dnf/* # 1b) C++20 工具链:vllm-ascend 的依赖 arctic-inference 用 nanobind 构建,要求 C++20, @@ -392,8 +397,17 @@ RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/ rm -rf /tmp/xxHash && ldconfig; \ fi; \ cd /tmp/Mooncake && mkdir -p build && cd build && \ + MPI_ARGS=""; \ + for d in /usr/lib64/mpich /usr/lib64/openmpi /usr/lib/x86_64-linux-gnu/openmpi \ + /usr/lib/aarch64-linux-gnu/openmpi; do \ + if [ -x "$d/bin/mpicc" ]; then \ + MPI_ARGS="-DMPI_C_COMPILER=$d/bin/mpicc -DMPI_CXX_COMPILER=$d/bin/mpicxx"; \ + export LD_LIBRARY_PATH="$d/lib:$d/lib64:$LD_LIBRARY_PATH"; \ + break; \ + fi; \ + done; \ cmake .. -DCMAKE_BUILD_TYPE=Release \ - -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON && \ + -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON ${MPI_ARGS} && \ make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig; } 2>&1 | tee -a "$LOG" # 9) mooncake python 绑定 From 5d42754820f8c3a2d381e0a91bdc9600cf0a19bd Mon Sep 17 00:00:00 2001 From: xqchen7 Date: Thu, 26 Nov 2026 11:03:55 +0800 Subject: [PATCH 32/32] Update Dockerfile.a3.openEuler Signed-off-by: xqchen7 --- Dockerfile.a3.openEuler | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 0b6620545346..162276a0ef55 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -378,7 +378,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \ RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/set_env.sh; do if [ -f "$f" ]; then . "$f"; fi; done; \ LOG=/tmp/mooncake_build.log; : > "$LOG"; \ set -o pipefail; \ - trap 'rc=$?; if [ $rc -ne 0 ]; then echo "ERROR: mooncake 构建失败,日志尾部:"; tail -n 40 "$LOG"; fi' EXIT; \ + trap 'rc=$?; if [ $rc -ne 0 ]; then echo "===== MOONCAKE ERROR SUMMARY ====="; grep -nE "error:|undefined reference|Error [0-9]+|No such file|not found" "$LOG" | tail -n 40; echo "===== END SUMMARY ====="; fi' EXIT; \ { git clone -b ${MOONCAKE_TAG} --recurse-submodules ${MOONCAKE_REPO} /tmp/Mooncake && \ cmake -S /tmp/Mooncake/extern/yalantinglibs -B /tmp/ylt-build \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ @@ -407,6 +407,7 @@ RUN for f in /usr/local/Ascend/cann/set_env.sh /usr/local/Ascend/ascend-toolkit/ fi; \ done; \ cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="-Wno-maybe-uninitialized -Wno-stringop-overflow" \ -DWITH_TE=ON -DUSE_CUDA=OFF -DUSE_ASCEND=ON ${MPI_ARGS} && \ make -j"${MAX_JOBS:-$(nproc)}" && make install && ldconfig; } 2>&1 | tee -a "$LOG"