11name : Release Triton Ascend Images
22
3- # TEMPORARILY DISABLED — all triggers commented out so this workflow never
4- # starts and never occupies a runner. Uncomment to re-enable.
53on :
64 workflow_dispatch :
7- # push:
8- # branches: [main]
9- # paths:
10- # - 'docker/Dockerfile'
11- # - 'Makefile'
12- # - 'requirements.txt'
13- # - 'requirements_dev.txt'
14- # - '.github/workflows/build-docker-image.yml'
15- # pull_request:
16- # branches: [main]
17- # paths:
18- # - 'docker/Dockerfile'
19- # - 'Makefile'
20- # - 'requirements.txt'
21- # - 'requirements_dev.txt'
22- # - '.github/workflows/build-docker-image.yml'
5+ push :
6+ branches : [main]
7+ paths :
8+ - ' docker/Dockerfile'
9+ - ' requirements.txt'
10+ - ' requirements_dev.txt'
11+ - ' .github/workflows/build-docker-image.yml'
12+ pull_request :
13+ branches : [main]
14+ paths :
15+ - ' docker/Dockerfile'
16+ - ' requirements.txt'
17+ - ' requirements_dev.txt'
18+ - ' .github/workflows/build-docker-image.yml'
19+
20+ concurrency :
21+ group : build-docker-${{ github.ref }}
22+ cancel-in-progress : true
2323
2424permissions :
2525 contents : read
2626 actions : write
2727
2828jobs :
2929 build-images :
30- name : Build ${{ matrix.cann_version }}-${{ matrix.chip_type }}-${{ matrix.os }}-py${{ matrix.python_version }}
31- runs-on : ubuntu-22.04
30+ name : Build ${{ matrix.cann_version }}-${{ matrix.chip_type }}-${{ matrix.os }}-py${{ matrix.python_version }}-${{ matrix.platforms }}
31+ # Use buildkit runner matching the target platform.
32+ runs-on : ${{ matrix.platforms == 'amd64' && 'linux-amd64-cpu-4' || 'linux-aarch64-cpu-4' }}
33+ container :
34+ image : swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.0-a3-ubuntu22.04-py3.12
35+ timeout-minutes : 360
3236
3337 strategy :
3438 fail-fast : false
39+ # Limit parallelism: too many concurrent builds overwhelm the shared
40+ # buildkitd workers and SWR (auth timeouts / connection resets).
41+ max-parallel : 6
3542 matrix :
3643 cann_version : [8.5.0, 9.0.0-beta.2]
3744 chip_type : [910b, a3]
3845 os : [ubuntu22.04]
3946 python_version : ["3.10", "3.11"]
47+ platforms : [amd64, arm64]
4048
4149 steps :
4250 - name : Checkout code
4351 uses : actions/checkout@v4
44-
45- - name : Set up QEMU
46- uses : docker/setup-qemu-action@v3
47-
48- - name : Set up Docker Buildx
49- uses : docker/setup-buildx-action@v3
52+ with :
53+ symlinks : true
5054
5155 - name : Login to Quay.io
5256 if : github.event_name == 'push'
5963 - name : Generate tags
6064 id : tags
6165 run : |
66+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
6267 CANN_TAG="${{ matrix.cann_version }}-${{ matrix.chip_type }}-${{ matrix.os }}-py${{ matrix.python_version }}"
6368 GIT_COMMIT_SHORT="$(git rev-parse --short HEAD)"
6469 TAG_COMMIT="${CANN_TAG}-${GIT_COMMIT_SHORT}"
@@ -68,16 +73,19 @@ jobs:
6873 echo "tag_latest=${TAG_LATEST}" >> $GITHUB_OUTPUT
6974
7075 - name : Build and push
71- uses : docker/build-push-action@v6
76+ uses : docker/build-push-action@v7
7277 with :
7378 context : .
7479 file : docker/Dockerfile
75- platforms : linux/amd64,linux/arm64
7680 push : ${{ github.event_name == 'push' }}
7781 tags : |
78- quay.io/ascend/triton:${{ steps.tags.outputs.tag_commit }}
79- quay.io/ascend/triton:${{ steps.tags.outputs.tag_latest }}
82+ quay.io/ascend/triton:${{ steps.tags.outputs.tag_commit }}-${{ matrix.platforms }}
83+ quay.io/ascend/triton:${{ steps.tags.outputs.tag_latest }}-${{ matrix.platforms }}
8084 build-args : |
81- CANN_BASE_IMAGE=quay.io/ascend/cann:${{ steps.tags.outputs.cann_tag }}
82- cache-from : type=gha
83- cache-to : type=gha,mode=max
85+ CANN_BASE_IMAGE=swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:${{ steps.tags.outputs.cann_tag }}
86+ APTMIRROR=http://cache-service.nginx-pypi-cache.svc.cluster.local:8081
87+ PIP_INDEX_URL=http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple
88+ PIP_TRUSTED_HOST=cache-service.nginx-pypi-cache.svc.cluster.local
89+ TORCH_INDEX_URL=http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu
90+ cache-from : type=registry,ref=swr.cn-southwest-2.myhuaweicloud.com/modelfoundry/triton-buildcache:${{ matrix.cann_version }}-${{ matrix.platforms }}
91+ cache-to : type=registry,ref=swr.cn-southwest-2.myhuaweicloud.com/modelfoundry/triton-buildcache:${{ matrix.cann_version }}-${{ matrix.platforms }},mode=max
0 commit comments