-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (80 loc) · 2.55 KB
/
rocm-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: ROCm base image build
on:
workflow_call:
inputs:
rocm_release:
type: string
description: ROCm release version
required: true
benchmark-utils_repo:
type: string
description: Repository for benchmark utils
required: true
base_image:
type: string
description: Base image for rocm Docker build
required: true
docker_image:
type: string
description: Docker image name for rocm Docker build
required: true
branch_name:
type: string
description: branch to use for building base ROCm image
required: true
build_navi:
type: string
description: Build navi number
required: true
overwrite:
type: boolean
description: Overwrite image if it already exists
required: true
secrets:
gh_token:
description: 'Github Access Token'
required: true
env:
UTILS_DIR: benchmark-utils
jobs:
check_image_version:
name: Check Image Version
runs-on: [self-hosted,performance]
outputs:
image: ${{ steps.check_image.outputs.image }}
steps:
- name: Check new image
id: check_image
run: |
if [ -z "$(docker images -q rocm-migraphx:${{ inputs.rocm_release }})" ]; then
echo "image=true" >> $GITHUB_OUTPUT
else
if [ "${{ inputs.overwrite }}" == "true" ]; then
docker rmi -f rocm-migraphx:${{ inputs.rocm_release }}
echo "image=true" >> $GITHUB_OUTPUT
fi
fi
build_image:
name: Build New Image
runs-on: [self-hosted,performance]
needs: check_image_version
if: ${{ needs.check_image_version.outputs.image == 'true' }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Checkout Utils
uses: actions/[email protected]
with:
repository: ${{ inputs.benchmark-utils_repo }}
path: ${{ env.UTILS_DIR }}
token: ${{ secrets.gh_token }}
- name: Docker build
env:
ROCM_RELEASE: ${{ inputs.rocm_release }}
ROCM_BASE: ${{ inputs.base_image }}:${{ inputs.rocm_release }}
DOCKERIMAGE: ${{ inputs.docker_image }}:${{ inputs.rocm_release }}
BUILD_NAVI: ${{ inputs.build_navi }}
TOKEN: ${{ secrets.gh_token }}
run: |
cd $GITHUB_WORKSPACE/${{ env.UTILS_DIR }}/scripts
./build_migraphx_docker.sh ${{ inputs.benchmark-utils_repo }} ${{ github.repository }} ${{ inputs.branch_name }}