Skip to content

Commit 349eaf5

Browse files
Merge pull request #63 from DSFans2014/feat/ci
feat: build latest image on main branch
2 parents e9581d9 + 8d3c26a commit 349eaf5

4 files changed

Lines changed: 31 additions & 91 deletions

File tree

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
name: CI
55

66
on:
7+
push:
8+
branches: [ "main" ]
9+
tags:
10+
- v[0-9]+.[0-9]+.[0-9]+.[0-9]+
11+
- v[0-9]+.[0-9]+.[0-9]+
12+
- v[0-9]+.[0-9]+
713
pull_request:
814
branches: [ "main" ]
915

@@ -60,20 +66,38 @@ jobs:
6066
name: build-artifacts
6167
path: ./lib/hami-vnpu-core/
6268

69+
- name: Docker Login
70+
if: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') }}
71+
uses: docker/login-action@v3.6.0
72+
with:
73+
username: ${{ secrets.DOCKERHUB_TOKEN }}
74+
password: ${{ secrets.DOCKERHUB_PASSWD }}
75+
6376
- name: Set up QEMU
6477
uses: docker/setup-qemu-action@v3
6578

6679
- name: Set up Docker Buildx
6780
uses: docker/setup-buildx-action@v3
6881

82+
- name: Extract tag name
83+
id: tag
84+
run: |
85+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
86+
TAG_NAME="${GITHUB_REF#refs/tags/}"
87+
echo "VERSION=${TAG_NAME#v}" >> $GITHUB_OUTPUT
88+
echo "Extracted version: ${VERSION}"
89+
else
90+
echo "VERSION=latest" >> $GITHUB_OUTPUT
91+
fi
92+
6993
- name: Build and push
7094
uses: docker/build-push-action@v6
7195
with:
7296
context: .
73-
platforms: linux/amd64
74-
push: false
97+
platforms: linux/amd64,linux/arm64
98+
push: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') }}
7599
build-args: |
76100
BASE_IMAGE=ubuntu:20.04
77101
GO_VERSION=${{ env.GO_VERSION }}
78102
VERSION=${{ steps.branch-names.outputs.current_branch || steps.branch-names.outputs.tag }}-${{ github.sha }}
79-
tags: ${{ env.IMAGE_NAME }}:dev
103+
tags: ${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.VERSION }}

.github/workflows/release.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Memory slicing is supported based on virtualization template, lease available te
1414

1515
This project implements a soft slicing mechanism based on `libvnpu.so` interception and `limiter` token scheduling, enabling fine-grained resource sharing. For detailed information, check [hami-vnpu-core](https://github.com/Project-HAMi/hami-vnpu-core)
1616

17+
**Note:** `hami-vnpu-core` currently only supports ARM platforms.
18+
1719
## Prerequisites
1820

1921
[ascend-docker-runtime](https://gitcode.com/Ascend/mind-cluster/tree/master/component/ascend-docker-runtime)

README_cn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Ascend device plugin 是用来支持在 [HAMi](https://github.com/Project-HAMi/H
1212

1313
实现了基于 `libvnpu.so` 拦截和limiter令牌调度的软切分机制,能够实现精细化的资源共享。详细信息请参阅 [hami-vnpu-core](https://www.google.com/search?q=链接)
1414

15+
**注意:** `hami-vnpu-core`目前只支持ARM平台。
16+
1517
## 环境要求
1618

1719
部署 [ascend-docker-runtime](https://gitcode.com/Ascend/mind-cluster/tree/master/component/ascend-docker-runtime)

0 commit comments

Comments
 (0)