Skip to content

Commit ce31f40

Browse files
feat(ci): add buildkit fuse-overlayfs test for a3 and openEuler Dockerfiles
Add workflow buildkit-dockerfile-test and sync Dockerfiles from nv-action/vllm-benchmarks#280 Signed-off-by: JavaPythonAIForBAT <wuhejun@h-partners.com>
1 parent dd13a7f commit ce31f40

4 files changed

Lines changed: 117 additions & 97 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: buildkit-dockerfile-test
2+
# Test Dockerfile builds via docker/build-push-action@v7 on self-hosted runners
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- '.github/workflows/buildkit-dockerfile-test.yaml'
8+
- 'Dockerfile.a3'
9+
- 'Dockerfile.a3.openEuler'
10+
- 'Dockerfile.openEuler'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-test:
15+
name: "${{ matrix.dockerfile }} (${{ matrix.runner_info.arch }})"
16+
runs-on: ${{ matrix.runner_info.runner }}
17+
container:
18+
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.0-a3-ubuntu22.04-py3.12
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
dockerfile:
24+
- Dockerfile.a3
25+
- Dockerfile.a3.openEuler
26+
- Dockerfile.openEuler
27+
runner_info:
28+
- {runner: linux-aarch64-cpu-4-buildkit, arch: arm64}
29+
- {runner: linux-amd64-cpu-4-buildkit, arch: amd64}
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v7
34+
with:
35+
fetch-depth: 0
36+
persist-credentials: false
37+
38+
- name: Determine SOC_VERSION
39+
id: vars
40+
run: |
41+
case "${{ matrix.dockerfile }}" in
42+
Dockerfile|Dockerfile.openEuler)
43+
echo "soc_version=ascend910b1" >> $GITHUB_OUTPUT
44+
;;
45+
Dockerfile.a3|Dockerfile.a3.openEuler)
46+
echo "soc_version=ascend910_9391" >> $GITHUB_OUTPUT
47+
;;
48+
esac
49+
50+
- name: Build and push
51+
uses: docker/build-push-action@v7
52+
with:
53+
context: .
54+
file: ${{ matrix.dockerfile }}
55+
push: true
56+
tags: |
57+
swr.cn-southwest-2.myhuaweicloud.com/modelfoundry/test-buildkit:${{ matrix.dockerfile }}-${{ matrix.runner_info.arch }}-${{ github.sha }}
58+
swr.cn-southwest-2.myhuaweicloud.com/modelfoundry/buildkit-cache:${{ matrix.dockerfile }}-${{ matrix.runner_info.arch }}
59+
build-args: |
60+
APTMIRROR=http://cache-service.nginx-pypi-cache.svc.cluster.local:8081
61+
PIP_INDEX_URL=http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple
62+
PIP_TRUSTED_HOST=cache-service.nginx-pypi-cache.svc.cluster.local
63+
PYTORCH_INDEX_URL=http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu
64+
ASCEND_INDEX_URL=http://cache-service.nginx-pypi-cache.svc.cluster.local/ascend/repos/pypi
65+
GIT_PROXY=https://gh-proxy.test.osinfra.cn/
66+
SOC_VERSION=${{ steps.vars.outputs.soc_version }}
67+
COMPILE_CUSTOM_KERNELS=0
68+
cache-from: type=registry,ref=swr.cn-southwest-2.myhuaweicloud.com/modelfoundry/buildkit-cache:${{ matrix.dockerfile }}-${{ matrix.runner_info.arch }}
69+
cache-to: type=inline
70+
provenance: false

Dockerfile.a3

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,31 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
ARG CANN_QUAY_URL="quay.io/ascend/cann"
19-
ARG CANN_VERSION="9.0.1"
20-
ARG BASE_OS="ubuntu22.04"
21-
FROM ${CANN_QUAY_URL}:${CANN_VERSION}-a3-${BASE_OS}-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-a3-ubuntu22.04-py3.12
2219

23-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
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
2427

2528
ENV DEBIAN_FRONTEND=noninteractive
2629

2730
WORKDIR /workspace
2831

2932
# Install clang-15 (for triton-ascend) and Mooncake
3033
ARG MOONCAKE_TAG=0.3.11.post1
31-
RUN apt-get update -y && \
34+
RUN if [ -n "$APTMIRROR" ]; then \
35+
sed -Ei "s@(ports|archive).ubuntu.com@${APTMIRROR#http://}@g" /etc/apt/sources.list; \
36+
fi && \
37+
apt-get update -y && \
3238
apt-get install -y git vim wget net-tools gcc g++ cmake numactl libnuma-dev libibverbs-dev libjemalloc2 libhiredis-dev clang-15 && \
3339
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3440
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3541
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
36-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
42+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3743
rm -rf /var/cache/apt/* && \
3844
rm -rf /var/lib/apt/lists/*
3945

@@ -44,17 +50,18 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} && \
4450

4551
# Install vLLM
4652
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
47-
ARG VLLM_TAG=v0.26.0
53+
ARG VLLM_TAG=v0.25.1
4854
ARG VLLM_COMMIT=""
4955
RUN if [ -n "$VLLM_COMMIT" ]; then \
5056
git init /vllm-workspace/vllm && \
5157
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5258
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5359
else \
60+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5461
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5562
fi
5663
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
57-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index-url https://download.pytorch.org/whl/cpu/ && \
64+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5865
python3 -m pip uninstall -y triton && \
5966
python3 -m pip cache purge
6067

@@ -67,38 +74,17 @@ ENV SOC_VERSION=$SOC_VERSION \
6774
OMP_NUM_THREADS=1
6875
COPY . /vllm-workspace/vllm-ascend/
6976

70-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
77+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
7178
export VLLM_BATCH_INVARIANT=1 && \
7279
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7380
source /usr/local/Ascend/nnal/atb/set_env.sh && \
74-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu/ && \
81+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7582
python3 -m pip uninstall -y triton triton-ascend && \
76-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
83+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7784
python3 -m pip cache purge
7885

7986
# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH
8087
RUN echo "export LD_PRELOAD=/usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc
8188
RUN echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc
8289

83-
# ===== Conditional installation based on BUILD_TYPE =====
84-
# All ARG definitions are in the same stage for better maintainability
85-
ARG BUILD_TYPE="release"
86-
ARG MEMCACHE_VERSION
87-
ARG MEMCACHE_DATE
88-
ARG MEMFABRIC_VERSION
89-
ARG MEMFABRIC_DATE
90-
ARG TORCH_NPU_VERSION
91-
ARG TORCH_NPU_DATE
92-
ARG TRITON_ASCEND_VERSION
93-
ARG TRITON_ASCEND_PACKAGE_VERSION
94-
ARG DAILY_DEPS_MODE="full"
95-
96-
# Install daily packages via shared script
97-
COPY .github/workflows/scripts/install_daily_deps.sh /tmp/
98-
RUN if [ "$BUILD_TYPE" = "daily" ]; then \
99-
bash /tmp/install_daily_deps.sh; \
100-
else \
101-
echo "Building release version without daily packages"; \
102-
fi && rm -f /tmp/install_daily_deps.sh
103-
10490
CMD ["/bin/bash"]

Dockerfile.a3.openEuler

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
ARG CANN_QUAY_URL="quay.io/ascend/cann"
19-
ARG CANN_VERSION="9.0.1"
20-
ARG BASE_OS="openeuler24.03"
21-
FROM ${CANN_QUAY_URL}:${CANN_VERSION}-a3-${BASE_OS}-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-a3-openeuler24.03-py3.12
2219

23-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
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=""
2426

2527
WORKDIR /workspace
2628

@@ -31,7 +33,7 @@ ARG MOONCAKE_TAG=0.3.11.post1
3133
RUN yum update -y && \
3234
yum install -y git vim wget net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel jemalloc hiredis-devel clang patch && \
3335
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
34-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
36+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3537
rm -rf /var/cache/yum/*
3638

3739
# Install modelscope (for fast download) and ray (for multinode)
@@ -41,17 +43,18 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} && \
4143

4244
# Install vLLM
4345
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
44-
ARG VLLM_TAG=v0.26.0
46+
ARG VLLM_TAG=v0.25.1
4547
ARG VLLM_COMMIT=""
4648
RUN if [ -n "$VLLM_COMMIT" ]; then \
4749
git init /vllm-workspace/vllm && \
4850
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4951
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5052
else \
53+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5154
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5255
fi
5356
# 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/ && \
57+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5558
python3 -m pip uninstall -y triton && \
5659
python3 -m pip cache purge
5760

@@ -63,37 +66,16 @@ ENV SOC_VERSION=$SOC_VERSION \
6366
OMP_NUM_THREADS=1
6467
COPY . /vllm-workspace/vllm-ascend/
6568

66-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
69+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
6770
export VLLM_BATCH_INVARIANT=1 && \
6871
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6972
source /usr/local/Ascend/nnal/atb/set_env.sh && \
70-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu/ && \
73+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7174
python3 -m pip uninstall -y triton triton-ascend && \
72-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
75+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7376
python3 -m pip cache purge
7477

7578
RUN echo "export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc
7679
RUN echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc
7780

78-
# ===== Conditional installation based on BUILD_TYPE =====
79-
# All ARG definitions are in the same stage for better maintainability
80-
ARG BUILD_TYPE="release"
81-
ARG MEMCACHE_VERSION
82-
ARG MEMCACHE_DATE
83-
ARG MEMFABRIC_VERSION
84-
ARG MEMFABRIC_DATE
85-
ARG TORCH_NPU_VERSION
86-
ARG TORCH_NPU_DATE
87-
ARG TRITON_ASCEND_VERSION
88-
ARG TRITON_ASCEND_PACKAGE_VERSION
89-
ARG DAILY_DEPS_MODE="full"
90-
91-
# Install daily packages via shared script
92-
COPY .github/workflows/scripts/install_daily_deps.sh /tmp/
93-
RUN if [ "$BUILD_TYPE" = "daily" ]; then \
94-
bash /tmp/install_daily_deps.sh; \
95-
else \
96-
echo "Building release version without daily packages"; \
97-
fi && rm -f /tmp/install_daily_deps.sh
98-
9981
CMD ["/bin/bash"]

Dockerfile.openEuler

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
ARG CANN_QUAY_URL="quay.io/ascend/cann"
19-
ARG CANN_VERSION="9.0.1"
20-
ARG BASE_OS="openeuler24.03"
21-
FROM ${CANN_QUAY_URL}:${CANN_VERSION}-910b-${BASE_OS}-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-910b-openeuler24.03-py3.12
2219

23-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
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=""
2426

2527
WORKDIR /workspace
2628

@@ -31,7 +33,7 @@ ARG MOONCAKE_TAG=0.3.11.post1
3133
RUN yum update -y && \
3234
yum install -y git vim wget net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel jemalloc hiredis-devel clang patch && \
3335
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
34-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
36+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3537
rm -rf /var/cache/yum/*
3638

3739
# Install modelscope (for fast download) and ray (for multinode)
@@ -41,17 +43,18 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} && \
4143

4244
# Install vLLM
4345
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
44-
ARG VLLM_TAG=v0.26.0
46+
ARG VLLM_TAG=v0.25.1
4547
ARG VLLM_COMMIT=""
4648
RUN if [ -n "$VLLM_COMMIT" ]; then \
4749
git init /vllm-workspace/vllm && \
4850
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4951
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5052
else \
53+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5154
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5255
fi
5356
# 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/ && \
57+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5558
python3 -m pip uninstall -y triton && \
5659
python3 -m pip cache purge
5760

@@ -63,37 +66,16 @@ ENV SOC_VERSION=$SOC_VERSION \
6366
OMP_NUM_THREADS=1
6467
COPY . /vllm-workspace/vllm-ascend/
6568

66-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
69+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
6770
export VLLM_BATCH_INVARIANT=1 && \
6871
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6972
source /usr/local/Ascend/nnal/atb/set_env.sh && \
70-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu/ && \
73+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7174
python3 -m pip uninstall -y triton triton-ascend && \
72-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
75+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7376
python3 -m pip cache purge
7477

7578
RUN echo "export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc
7679
RUN echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc
7780

78-
# ===== Conditional installation based on BUILD_TYPE =====
79-
# All ARG definitions are in the same stage for better maintainability
80-
ARG BUILD_TYPE="release"
81-
ARG MEMCACHE_VERSION
82-
ARG MEMCACHE_DATE
83-
ARG MEMFABRIC_VERSION
84-
ARG MEMFABRIC_DATE
85-
ARG TORCH_NPU_VERSION
86-
ARG TORCH_NPU_DATE
87-
ARG TRITON_ASCEND_VERSION
88-
ARG TRITON_ASCEND_PACKAGE_VERSION
89-
ARG DAILY_DEPS_MODE="full"
90-
91-
# Install daily packages via shared script
92-
COPY .github/workflows/scripts/install_daily_deps.sh /tmp/
93-
RUN if [ "$BUILD_TYPE" = "daily" ]; then \
94-
bash /tmp/install_daily_deps.sh; \
95-
else \
96-
echo "Building release version without daily packages"; \
97-
fi && rm -f /tmp/install_daily_deps.sh
98-
9981
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)