[CI][Fix] Resolved the Ascend NPU test build image fail and add file dependencies (#50504)

Signed-off-by: yangzeyu <yangzeyu7@huawei.com> Co-authored-by: Yikun Jiang <yikunkero@gmail.com>

Zeyu Yang committed Sep 2, 2026 at 16:14 UTC c23e15be9fc55d800ee7979ed7027163f5d468a5
2 files changed +112 -15
.buildkite/hardware_tests/ascend_npu.yaml
+94 -1
@@ -4,8 +4,101 @@ steps:
4 - label: "Ascend NPU Test"
5 key: ascend-npu-test
6 soft_fail: true
7 - timeout_in_minutes: 20
7 no_plugin: true
8 device: ascend_npu
9 + source_file_dependencies:
10 + - vllm/
11 + - .buildkite/scripts/hardware_ci/run-npu-test.sh
12 + - "!vllm/platforms/cuda.py"
13 + - "!vllm/platforms/xpu.py"
14 + - "!vllm/platforms/tpu.py"
15 + - "!vllm/platforms/cpu.py"
16 + - "!vllm/platforms/zen_cpu.py"
17 + - "!vllm/cute_utils/"
18 + - "!vllm/tilelang_utils/"
19 + - "!vllm/device_allocator/"
20 + - "!vllm/vllm_flash_attn/"
21 + - "!vllm/kernels/"
22 + - "!vllm/model_executor/kernels/"
23 + - "!vllm/engine/"
24 + - "!vllm/entrypoints/"
25 + - "!vllm/ray/"
26 + - "!vllm/v1/attention/backends/flash_attn.py"
27 + - "!vllm/v1/attention/backends/flash_attn_diffkv.py"
28 + - "!vllm/v1/attention/backends/flashinfer.py"
29 + - "!vllm/v1/attention/backends/triton_attn.py"
30 + - "!vllm/v1/attention/backends/triton_attn_diffkv.py"
31 + - "!vllm/v1/attention/backends/rocm_attn.py"
32 + - "!vllm/v1/attention/backends/rocm_aiter_fa.py"
33 + - "!vllm/v1/attention/backends/rocm_aiter_unified_attn.py"
34 + - "!vllm/v1/attention/backends/flex_attention.py"
35 + - "!vllm/v1/attention/backends/hpc_attn.py"
36 + - "!vllm/v1/attention/backends/mamba1_attn.py"
37 + - "!vllm/v1/attention/backends/mamba2_attn.py"
38 + - "!vllm/v1/attention/backends/mamba_attn.py"
39 + - "!vllm/v1/attention/backends/short_conv_attn.py"
40 + - "!vllm/v1/attention/backends/turboquant_attn.py"
41 + - "!vllm/v1/attention/backends/cpu_attn.py"
42 + - "!vllm/v1/attention/backends/fa_utils.py"
43 + - "!vllm/distributed/device_communicators/pynccl.py"
44 + - "!vllm/distributed/device_communicators/pynccl_wrapper.py"
45 + - "!vllm/distributed/device_communicators/pynccl_allocator.py"
46 + - "!vllm/distributed/device_communicators/xpu_communicator.py"
47 + - "!vllm/distributed/device_communicators/cpu_communicator.py"
48 + - "!vllm/distributed/device_communicators/cuda_wrapper.py"
49 + - "!vllm/distributed/device_communicators/flashinfer_all_reduce.py"
50 + - "!vllm/distributed/device_communicators/aiter_custom_all_reduce.py"
51 + - "!vllm/distributed/device_communicators/custom_all_reduce.py"
52 + - "!vllm/distributed/device_communicators/quick_all_reduce.py"
53 + - "!vllm/distributed/device_communicators/all2all.py"
54 + - "!vllm/distributed/device_communicators/all_reduce_utils.py"
55 + - "!vllm/distributed/device_communicators/shm_object_storage.py"
56 + - "!vllm/distributed/device_communicators/symm_mem.py"
57 + - "!vllm/distributed/device_communicators/mnnvl_compat.py"
58 + - "!vllm/distributed/device_communicators/ray_communicator.py"
59 + - "!vllm/third_party/flashmla/"
60 + - "!vllm/third_party/pynvml.py"
61 + - "!vllm/_custom_ops.py"
62 + - "!vllm/_xpu_ops.py"
63 + - "!vllm/_aiter_ops"
64 + - "!vllm/collect_env.py"
65 + - "!vllm/connections.py"
66 + - "!vllm/env_override.py"
67 + - "!vllm/logits_process.py"
68 + - "!vllm/logprobs.py"
69 + - "!vllm/model_inspection.py"
70 + - "!vllm/outputs.py"
71 + - "!vllm/scalar_type.py"
72 + - "!vllm/scripts.py"
73 + - "!vllm/version.py"
74 + - "!vllm/assets/"
75 + - "!vllm/benchmarks/"
76 + - "!vllm/inputs/"
77 + - "!vllm/ir/"
78 + - "!vllm/parser/"
79 + - "!vllm/plugins/"
80 + - "!vllm/reasoning/"
81 + - "!vllm/renderers/"
82 + - "!vllm/tokenizers/"
83 + - "!vllm/tool_parsers/"
84 + - "!vllm/tracing/"
85 + - "!vllm/usage/"
86 + - "!tests/"
87 + - "!benchmarks/"
88 + - "!docs/"
89 + - "!examples/"
90 + - "!scripts/"
91 + - "!vllm/model_executor/layers/quantization/auto_awq.py"
92 + - "!vllm/model_executor/layers/quantization/auto_gptq.py"
93 + - "!vllm/model_executor/layers/quantization/inc/"
94 + - "!vllm/model_executor/layers/quantization/awq_triton.py"
95 + - "!vllm/model_executor/layers/quantization/experts_int8.py"
96 + - "!vllm/model_executor/layers/quantization/fbgemm_fp8.py"
97 + - "!vllm/model_executor/layers/quantization/fp_quant.py"
98 + - "!vllm/model_executor/layers/quantization/humming.py"
99 + - "!vllm/model_executor/layers/quantization/moe_wna16.py"
100 + - "!vllm/model_executor/layers/quantization/qutlass_utils.py"
101 + - "!vllm/model_executor/layers/quantization/quark/"
102 + - "!vllm/model_executor/layers/quantization/turboquant/"
103 commands:
104 - bash .buildkite/scripts/hardware_ci/run-npu-test.sh
.buildkite/scripts/hardware_ci/run-npu-test.sh
+18 -14
@@ -76,30 +76,35 @@ FROM ${BASE_IMAGE_NAME}
76 ENV DEBIAN_FRONTEND=noninteractive
77 ENV SOC_VERSION="ascend910b1"
78
79 -RUN pip config set global.index-url http://cache-service-vllm.nginx-pypi-cache.svc.cluster.local:${PYPI_CACHE_PORT}/pypi/simple && \
80 - pip config set global.trusted-host cache-service-vllm.nginx-pypi-cache.svc.cluster.local && \
81 - apt-get update -y && \
79 +# Install uv and configure uv to use internal PyPI mirror
80 +RUN curl -LsSf https://astral.sh/uv/install.sh | sh
81 +ENV PATH="/root/.local/bin:$PATH"
82 +ENV UV_SYSTEM_PYTHON=true
83 +ENV UV_INDEX_URL="http://cache-service-vllm.nginx-pypi-cache.svc.cluster.local:${PYPI_CACHE_PORT}/pypi/simple"
84 +ENV UV_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
85 +
86 +RUN apt-get update -y && \
87 apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev && \
88 rm -rf /var/cache/apt/* && \
89 rm -rf /var/lib/apt/lists/*
90
91 # Install for pytest to make the docker build cache layer always valid
87 -RUN --mount=type=cache,target=/root/.cache/pip \
88 - pip install pytest>=6.0 'modelscope<1.38'
92 +RUN --mount=type=cache,target=/root/.cache/uv \
93 + uv pip install pytest>=6.0 'modelscope<1.38' --quiet
94
95 WORKDIR /workspace/vllm
96
97 # Install vLLM dependencies in advance. Effect: As long as common.txt remains unchanged, the docker cache layer will be valid.
98 COPY requirements/common.txt /workspace/vllm/requirements/common.txt
99 RUN --mount=type=cache,target=/root/.cache/pip \
95 - pip install -r requirements/common.txt
100 + uv pip install -r requirements/common.txt --quiet
101
102 COPY . .
103
104 # Install vLLM
100 -RUN --mount=type=cache,target=/root/.cache/pip \
101 - VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/ && \
102 - python3 -m pip uninstall -y triton
105 +RUN --mount=type=cache,target=/root/.cache/uv \
106 + VLLM_TARGET_DEVICE="empty" uv pip install -e /workspace/vllm/ --extra-index-url https://download.pytorch.org/whl/cpu/ --quiet --index-strategy unsafe-best-match && \
107 + uv pip uninstall -y triton --quiet
108
109 # Install vllm-ascend
110 WORKDIR /workspace
@@ -109,15 +114,14 @@ RUN git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com
114 git clone --depth 1 \$VLLM_ASCEND_REPO --branch \$VLLM_ASCEND_TAG /workspace/vllm-ascend
115
116 # Install vllm dependencies in advance. Effect: As long as common.txt remains unchanged, the docker cache layer will be valid.
112 -RUN --mount=type=cache,target=/root/.cache/pip \
113 - pip install -r /workspace/vllm-ascend/requirements.txt
117 +RUN --mount=type=cache,target=/root/.cache/uv \
118 + uv pip install -r /workspace/vllm-ascend/requirements.txt --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi --quiet --index-strategy unsafe-best-match
119
115 -RUN --mount=type=cache,target=/root/.cache/pip \
116 - export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi && \
120 +RUN --mount=type=cache,target=/root/.cache/uv \
121 source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
122 source /usr/local/Ascend/nnal/atb/set_env.sh && \
123 export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/$(uname -i)-linux/devlib && \
120 - python3 -m pip install -v -e /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
124 + uv pip install -e /workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu/ --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi --quiet --index-strategy unsafe-best-match
125
126 ENV VLLM_WORKER_MULTIPROC_METHOD=spawn
127 ENV VLLM_USE_MODELSCOPE=True