Skip to content

Commit 010d8f0

Browse files
feat: add buildkit fuse-overlayfs test for 910b and 310p Dockerfiles
Add workflow buildkit-dockerfile-test-group1 and sync Dockerfiles from nv-action/vllm-benchmarks#279 Signed-off-by: JavaPythonAIForBAT <wuhejun@h-partners.com>
1 parent b2f683c commit 010d8f0

4 files changed

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

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

18-
FROM quay.io/ascend/cann:9.0.1-910b-ubuntu22.04-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-910b-ubuntu22.04-py3.12
1919

20-
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
2127

2228
WORKDIR /workspace
2329

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

@@ -46,10 +55,11 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
4655
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4756
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
4857
else \
58+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
4959
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5060
fi
5161
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
52-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
62+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
5363
python3 -m pip uninstall -y triton && \
5464
python3 -m pip cache purge
5565

@@ -62,13 +72,13 @@ ENV SOC_VERSION=$SOC_VERSION \
6272
OMP_NUM_THREADS=1
6373
COPY . /vllm-workspace/vllm-ascend/
6474

65-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
75+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
6676
export VLLM_BATCH_INVARIANT=1 && \
6777
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6878
source /usr/local/Ascend/nnal/atb/set_env.sh && \
69-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
79+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7080
python3 -m pip uninstall -y triton triton-ascend && \
71-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
81+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7282
python3 -m pip cache purge
7383

7484
# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH

Dockerfile.310p

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

18-
FROM quay.io/ascend/cann:9.1.0-beta.1-310p-ubuntu22.04-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.1.0-beta.1-310p-ubuntu22.04-py3.12
1919

20-
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 ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
22+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23+
ARG PIP_TRUSTED_HOST=""
24+
ARG GIT_PROXY=""
25+
ARG APTMIRROR
2126

2227
WORKDIR /workspace
2328

24-
RUN apt-get update -y && \
29+
RUN if [ -n "$APTMIRROR" ]; then \
30+
sed -Ei "s@(ports|archive).ubuntu.com@${APTMIRROR#http://}@g" /etc/apt/sources.list; \
31+
fi && \
32+
apt-get update -y && \
2533
apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake numactl libnuma-dev libjemalloc2 pciutils && \
2634
rm -rf /var/cache/apt/* && \
2735
rm -rf /var/lib/apt/lists/*
@@ -40,10 +48,11 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
4048
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4149
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
4250
else \
51+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
4352
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
4453
fi
4554
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
46-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
55+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
4756
python3 -m pip uninstall -y triton && \
4857
python3 -m pip cache purge
4958

@@ -56,10 +65,10 @@ ENV SOC_VERSION=$SOC_VERSION \
5665
OMP_NUM_THREADS=1
5766
COPY . /vllm-workspace/vllm-ascend/
5867

59-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
68+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
6069
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6170
source /usr/local/Ascend/nnal/atb/set_env.sh && \
62-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
71+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
6372
python3 -m pip uninstall -y triton-ascend triton && \
6473
python3 -m pip cache purge
6574

Dockerfile.310p.openEuler

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

18-
FROM quay.io/ascend/cann:9.1.0-beta.1-310p-openeuler24.03-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.1.0-beta.1-310p-openeuler24.03-py3.12
1919

20-
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 ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
22+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23+
ARG PIP_TRUSTED_HOST=""
24+
ARG GIT_PROXY=""
2125

2226
WORKDIR /workspace
2327

@@ -39,10 +43,11 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
3943
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4044
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
4145
else \
46+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
4247
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
4348
fi
4449
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
45-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
50+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
4651
python3 -m pip uninstall -y triton && \
4752
python3 -m pip cache purge
4853

@@ -54,10 +59,10 @@ ENV SOC_VERSION=$SOC_VERSION \
5459
OMP_NUM_THREADS=1
5560
COPY . /vllm-workspace/vllm-ascend/
5661

57-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
62+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
5863
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
5964
source /usr/local/Ascend/nnal/atb/set_env.sh && \
60-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
65+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
6166
python3 -m pip uninstall -y triton-ascend triton && \
6267
python3 -m pip cache purge
6368

0 commit comments

Comments
 (0)