Update openeuler-cann.yaml #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build CANN Docker images (openEuler) | |
permissions: | |
packages: write | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/openeuler-cann.yaml' | |
- 'cann/Dockerfile.openeuler' | |
branches: | |
- main | |
push: | |
paths: | |
- '.github/workflows/openeuler-cann.yaml' | |
- 'cann/Dockerfile.openeuler' | |
branches: | |
- main | |
issue_comment: | |
types: [created] | |
jobs: | |
build-cann: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
version: [ | |
"7.1|https://ascend-cann.obs.cn-north-4.myhuaweicloud.com|CANN/20231213_newest/Ascend-cann-toolkit_CANN-7.1_linux-aarch64.run|CANN/20231213_newest/Ascend-cann-kernels-910b_CANN-7.1_linux.run", | |
"7.0.0.alpha003|https://ascend-repo.obs.cn-east-2.myhuaweicloud.com|Milan-ASL/Milan-ASL%20V100R001C15SPC703/Ascend-cann-toolkit_7.0.0.alpha003_linux-aarch64.run|Milan-ASL/Milan-ASL%20V100R001C15SPC703/Ascend-cann-kernels-910b_7.0.0.alpha003_linux.run", | |
"7.0.RC1.alpha005|https://ascend-repo.obs.cn-east-2.myhuaweicloud.com|CANN/CANN%207.0.RC1/Ascend-cann-toolkit_7.0.RC1_linux-aarch64.run|CANN/CANN%207.0.RC1/Ascend-cann-kernels-910b_7.0.RC1_linux.run" | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
id: build | |
env: | |
VERSION: ${{ matrix.version }} | |
run: | | |
OS_VERSION="openeuler2203sp2" | |
CANN_VERSION=$(echo ${VERSION} | awk -F "|" '{print $1}') | |
PREFIX=$(echo ${VERSION} | awk -F "|" '{print $2}') | |
CANN_NAME=$(echo ${VERSION} | awk -F "|" '{print $3}') | |
KERNEL_NAME=$(echo ${VERSION} | awk -F "|" '{print $4}') | |
IMAGE_TAG=${CANN_VERSION}-${OS_VERSION} | |
CANN_TOOLKIT_URL=${PREFIX}/${CANN_NAME} | |
CANN_KERNELS_URL=${PREFIX}/${KERNEL_NAME} | |
echo "IMAGE_TAG=${IMAGE_TAG}" >> "$GITHUB_OUTPUT" | |
docker build -t ascendai/cann:${IMAGE_TAG} -f ./cann/Dockerfile.openeuler . --build-arg CANN_TOOLKIT_URL=${CANN_TOOLKIT_URL} --build-arg CANN_KERNELS_URL=${CANN_KERNELS_URL} | |
- name: Push | |
if: github.event_name == 'push' | |
env: | |
IMAGE_TAG: ${{ steps.build.outputs.IMAGE_TAG }} | |
run: | | |
docker push ascendai/cann:${IMAGE_TAG} |