Skip to content

Commit 7fcce00

Browse files
feat: add buildkit fuse-overlayfs test for a5 Dockerfiles
Add workflow buildkit-dockerfile-test-group3 and sync Dockerfiles from nv-action/vllm-benchmarks#278 Signed-off-by: JavaPythonAIForBAT <wuhejun@h-partners.com>
1 parent b2f683c commit 7fcce00

3 files changed

Lines changed: 90 additions & 12 deletions

File tree

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

Dockerfile.a5

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
FROM quay.io/ascend/cann:9.0.1-950-ubuntu22.04-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21+
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23+
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24+
ARG PIP_TRUSTED_HOST=""
2125

2226
ENV DEBIAN_FRONTEND=noninteractive
2327

@@ -30,21 +34,24 @@ RUN apt-get update -y && \
3034
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3135
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3236
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
33-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
37+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3438
rm -rf /var/cache/apt/* && \
3539
rm -rf /var/lib/apt/lists/*
3640

3741
# Install modelscope (for fast download) and ray (for multinode)
3842
RUN pip config set global.index-url ${PIP_INDEX_URL} && \
43+
if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
3944
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4045
python3 -m pip cache purge
4146

4247
# Install vLLM
4348
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
4449
ARG VLLM_TAG=v0.25.1
45-
RUN git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
50+
ARG GIT_PROXY=""
51+
RUN if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
52+
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
4653
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
47-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
54+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
4855
python3 -m pip uninstall -y triton && \
4956
python3 -m pip cache purge
5057

@@ -57,12 +64,12 @@ ENV SOC_VERSION=$SOC_VERSION \
5764
OMP_NUM_THREADS=1
5865
COPY . /vllm-workspace/vllm-ascend/
5966

60-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
67+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
6168
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6269
source /usr/local/Ascend/nnal/atb/set_env.sh && \
63-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
70+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
6471
python3 -m pip uninstall -y triton triton-ascend && \
65-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
72+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
6673
python3 -m pip cache purge
6774

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

Dockerfile.a5.openEuler

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
FROM quay.io/ascend/cann:9.0.1-950-openeuler24.03-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21+
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23+
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24+
ARG PIP_TRUSTED_HOST=""
2125

2226
WORKDIR /workspace
2327

@@ -28,20 +32,23 @@ ARG MOONCAKE_TAG=0.3.11.post1
2832
RUN yum update -y && \
2933
yum install -y git vim wget net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel jemalloc hiredis-devel clang patch && \
3034
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 && \
35+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
3236
rm -rf /var/cache/yum/*
3337

3438
# Install modelscope (for fast download) and ray (for multinode)
3539
RUN pip config set global.index-url ${PIP_INDEX_URL} && \
40+
if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
3641
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
3742
python3 -m pip cache purge
3843

3944
# Install vLLM
4045
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
4146
ARG VLLM_TAG=v0.25.1
42-
RUN git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
47+
ARG GIT_PROXY=""
48+
RUN if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
49+
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
4350
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
44-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
51+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
4552
python3 -m pip uninstall -y triton && \
4653
python3 -m pip cache purge
4754

@@ -53,12 +60,12 @@ ENV SOC_VERSION=$SOC_VERSION \
5360
OMP_NUM_THREADS=1
5461
COPY . /vllm-workspace/vllm-ascend/
5562

56-
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
63+
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
5764
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
5865
source /usr/local/Ascend/nnal/atb/set_env.sh && \
59-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
66+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
6067
python3 -m pip uninstall -y triton triton-ascend && \
61-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
68+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
6269
python3 -m pip cache purge
6370

6471
RUN echo "export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc

0 commit comments

Comments
 (0)