-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathbuild_linux_runfile_installer.yml
More file actions
191 lines (179 loc) · 8.76 KB
/
build_linux_runfile_installer.yml
File metadata and controls
191 lines (179 loc) · 8.76 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Build Linux Runfile Installer
on:
workflow_call:
inputs:
rocm_version:
description: ROCm version used to build runfile installer (7.12.0~20260218 for nightly, 7.11.0~rc2 for 7.11 prerelease RC2 or 7.12.0 if you're triggering the job manually)
required: true
type: string
release_type:
description: The type of release to build ("dev", "nightly", or "prerelease"). All developer-triggered jobs should use "dev"!
required: true
type: string
default: "dev"
gfx_archs:
description: gfx architectures to build (eg "gfx90x", "gfx94x", "gfx950", "gfx110x", "gfx1150", "gfx1151", "gfx1152", "gfx120x")
required: true
type: string
pull_type:
description: Specify where you want to pull packages from ("nightly" or "prereleases") which pull from rocm.nightlies.amd.com or rocm.prereleases.amd.com
required: true
type: string
default: "nightly"
pull_tag:
description: Set build date in the format (YYYYMMDD) to specify nightly build to build runfile installer off of if pull_type = nightly. Set to rc[BUILD_NUM] if pull_type = prerelease.
required: false
type: string
pull_run_id:
description: Workflow run id of deb and rpm packages used to build runfile installer off of. Only needed if release_type is nightly.
required: false
type: string
pull_pkg:
description: Set base package name with optional type prefix. Can set it to base:amdrocm-amdsmi to quickly test your code. Otherwise, leave empty. To see what values are valid, run command "bash build-runfile-installer.sh help"
required: false
type: string
default: "amdrocm-core-sdk"
workflow_dispatch:
inputs:
rocm_version:
description: ROCm version used to build runfile installer (7.12.0~20260218 for nightly, 7.11.0~rc2 for 7.11 prerelease RC2 or 7.12.0 if you're triggering the job manually).
required: true
type: string
release_type:
description: The type of release to build. All developer-triggered jobs should use "dev"!
type: choice
options:
- dev
- nightly
- prerelease
default: "dev"
gfx_archs:
description: gfx architectures to build (eg "gfx90x", "gfx94x", "gfx950", "gfx110x", "gfx1150", "gfx1151", "gfx1152", "gfx120x")
required: true
type: string
default: "gfx110x"
pull_type:
description: Specify where you want to pull packages from, which pull from rocm.nightlies.amd.com or rocm.prereleases.amd.com
type: choice
options:
- nightly
- prerelease
default: "nightly"
pull_tag:
description: Set build date in the format (YYYYMMDD) to specify nightly build to build runfile installer off of if pull_type = nightly. Set to rc[BUILD_NUM] if pull_type = prerelease.
required: false
type: string
pull_run_id:
description: Workflow run id of deb and rpm packages used to build runfile installer off of. Only needed if release_type is nightly.
required: false
type: string
pull_pkg:
description: Set base package name with optional type prefix. Can set it to base:amdrocm-amdsmi to quickly test your code. Otherwise, leave empty. To see what values are valid, run command "bash build-runfile-installer.sh help"
required: false
type: string
default: "amdrocm-core-sdk"
permissions:
id-token: write
contents: read
run-name: Build Linux Runfile Installer Test job (${{ inputs.rocm_version }}, ${{ inputs.release_type }}, ${{ inputs.pull_type }}, ${{ inputs.pull_tag }}, ${{ inputs.pull_run_id }})
jobs:
build_linux_runfile_installer:
name: Build and Release Linux Runfile Installer
strategy:
fail-fast: false
# runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
runs-on: ubuntu-24.04
container:
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:d6ae5712a9c7e8b88281d021e907b312cd8a26295b95690baef3e8dde4805858
defaults:
run:
working-directory: ${{ github.workspace}}/build_tools/packaging/runfile-installer
env:
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:d6ae5712a9c7e8b88281d021e907b312cd8a26295b95690baef3e8dde4805858
BUILD_RUNID: ${{ github.run_id }}
OUTPUT_DIR: ${{ github.workspace }}/build
RUNFILE_BUILD_DIR: ${{ github.workspace }}/build
RELEASE_TYPE: ${{ inputs.release_type }}
PULL_TAG: ${{ inputs.pull_tag }}
PULL_RUN_ID: ${{ inputs.pull_run_id }}
PULL_TYPE: ${{ inputs.pull_type }}
PULL_PKG: ${{ inputs.pull_pkg }}
BUILD_TAG: ${{ inputs.pull_tag }}
GFX_ARCHS: ${{ inputs.gfx_archs }}
S3_BUCKET_RUNFILE: therock-${{ inputs.release_type }}-runfile
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set ROCM_VERSION
run: |
ROCM_VERSION=$(echo "${{ inputs.rocm_version }}" | cut -d'~' -f1)
echo "Set value of ROCM_VERSION = '$ROCM_VERSION'"
echo "ROCM_VERSION=$ROCM_VERSION" >> $GITHUB_ENV
# Value of inputs.rocm_version for daily nightly job would be in the format 7.12.0~20260218.
# We need the 20260218 and set it to pull_tag
# Value of inputs.rocm_version for prerelease job would be in the format 7.12.0~rc2.
# We need the rc2 and set it to pull_tag.
- name: Set PULL_TAG
run: |
if [[ -z $PULL_TAG ]]; then
PULL_TAG=$(echo "${{ inputs.rocm_version }}" | cut -d'~' -f2)
echo "Set value of PULL_TAG = '$PULL_TAG'"
echo "PULL_TAG=$PULL_TAG" >> $GITHUB_ENV
fi
- name: Set MSCOMP
run: |
if [[ $RELEASE_TYPE == "dev" ]]; then
MSCOMP=dev
else
MSCOMP=prodmedium
fi
echo "Set value of MSCOMP = '$MSCOMP'"
echo "MSCOMP=$MSCOMP" >> $GITHUB_ENV
- name: Set BUILD_TAG for dev branch
if: ${{ env.RELEASE_TYPE == 'dev' }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
BUILD_TAG="dev-$(git rev-parse --short HEAD)"
echo "Set value of BUILD_TAG = '$BUILD_TAG'"
echo "BUILD_TAG=$BUILD_TAG" >> $GITHUB_ENV
- name: Run build-runfile-installer.sh
run: |
echo "### Runfile Build Options" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`bash build-runfile-installer.sh rocm amdgpu rocm-archs=$GFX_ARCHS pull=$PULL_TYPE pulltag=$PULL_TAG pullrunid=$PULL_RUN_ID pullrocmver=$ROCM_VERSION pullpkg=$PULL_PKG buildtag=$BUILD_TAG buildrunid=$BUILD_RUNID mscomp=$MSCOMP\`" >> $GITHUB_STEP_SUMMARY
bash build-runfile-installer.sh rocm amdgpu rocm-archs=$GFX_ARCHS pull=$PULL_TYPE pulltag=$PULL_TAG pullrunid=$PULL_RUN_ID pullrocmver=$ROCM_VERSION pullpkg=$PULL_PKG buildtag=$BUILD_TAG buildrunid=$BUILD_RUNID mscomp=$MSCOMP
- name: Show .run file
run: find . -name "*.run" -type f -exec ls -lctrh {} \;
- name: Install AWS CLI
working-directory: ${{ github.workspace }}
run: bash ./dockerfiles/install_awscli.sh
- name: Configure AWS Credentials
if: ${{ github.repository_owner == 'ROCm' }}
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::317668459450:role/therock-${{ env.RELEASE_TYPE }}-runfile-s3-oidc
- name: Upload runfile to S3
if: ${{ github.repository_owner == 'ROCm' }}
run: |
RUNFILE=$(find . -name "*.run" -type f | head -1)
if [ -z "$RUNFILE" ]; then
echo "ERROR: No .run file found"
exit 1
fi
RUNFILE_NAME=$(basename "$RUNFILE")
echo "Uploading $RUNFILE to s3://${{ env.S3_BUCKET_RUNFILE }}/"
aws s3 cp "$RUNFILE" "s3://${{ env.S3_BUCKET_RUNFILE }}/"
# Append to GitHub Actions summary
echo "### Runfile Uploaded to S3" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**File:** \`${RUNFILE_NAME}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**S3 Bucket:** \`${{ env.S3_BUCKET_RUNFILE }}\`" >> $GITHUB_STEP_SUMMARY
- name: Generate index.html needed to display runfile installers.
if: ${{ github.repository_owner == 'ROCm' }}
working-directory: ${{ github.workspace }}/build_tools
run: |
python -m venv .venv
source .venv/bin/activate
pip install boto3
python index_generation_s3_runfile.py --bucket ${{ env.S3_BUCKET_RUNFILE }} --upload