-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathbuild_native_linux_packages.yml
More file actions
153 lines (141 loc) · 6.04 KB
/
build_native_linux_packages.yml
File metadata and controls
153 lines (141 loc) · 6.04 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
name: Build Native Linux Packages
on:
workflow_call:
inputs:
artifact_group:
description: gfx arch group for the s3 server
type: string
default: gfx94X-dcgpu
artifact_run_id:
description: workflow run id to download the artifacts from.
required: true
type: string
rocm_version:
description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...).
required: true
type: string
native_package_type:
description: Specify whether debian or rpm packages are needed (deb or rpm).
required: true
type: string
package_suffix:
description: The suffix to be added to package name (asan, tsan, static or rpath).
required: false
type: string
release_type:
description: The type of release to build ("dev", "nightly", or "prerelease"). All developer-triggered jobs should use "dev"!
required: false
type: string
repository:
description: "Repository to checkout. Otherwise, defaults to `github.repository`."
type: string
ref:
description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow."
type: string
workflow_dispatch:
inputs:
artifact_group:
type: string
default: gfx94X-dcgpu
artifact_run_id:
description: workflow run id to download the artifacts from
type: string
rocm_version:
description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...).
type: string
default: "0.0.1"
native_package_type:
description: Specify whether debian or rpm packages are needed (deb or rpm).
required: true
type: choice
options:
- rpm
- deb
default: "rpm"
package_suffix:
description: The suffix to be added to package name (asan, tsan, static or rpath).
type: string
required: false
release_type:
description: The type of release to build ("dev", "nightly", or "prerelease"). All developer-triggered jobs should use "dev"!
type: string
default: "dev"
ref:
description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow."
type: string
permissions:
id-token: write
contents: read
run-name: Build native Linux packages (${{ inputs.artifact_group }}, ${{ inputs.rocm_version }}, ${{ inputs.native_package_type }}, ${{ inputs.package_suffix }}, ${{ inputs.release_type }})
jobs:
build_native_packages:
name: Build Linux native Packages
strategy:
fail-fast: false
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
env:
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:d6ae5712a9c7e8b88281d021e907b312cd8a26295b95690baef3e8dde4805858
ARTIFACT_RUN_ID: ${{ inputs.artifact_run_id || github.run_id }}
PACKAGE_SUFFIX: ${{ inputs.package_suffix != '' && inputs.package_suffix || '' }}
OUTPUT_DIR: ${{ github.workspace }}/output
ARTIFACTS_DIR: ${{ github.workspace }}/output/artifacts
PACKAGE_DIST_DIR: ${{ github.workspace }}/output/packages
RELEASE_TYPE: ${{ inputs.release_type || '' }}
S3_BUCKET_NATIVE: "therock-${{ inputs.release_type }}-packages"
steps:
- name: "Checking out repository"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || '' }}
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.12'
- name: Install Python requirements
run: |
pip install pyelftools boto3 jinja2
- name: Install System requirements
run: |
# Install the needed tools for creating rpm / deb packages
# Also install tools for creating repo files
sudo apt update
sudo apt install -y llvm
sudo apt install -y rpm debhelper-compat build-essential
sudo apt install -y dpkg-dev createrepo-c
- name: Fetch Artifacts
run: |
echo "Fetching artifacts for build ${{ inputs.artifact_run_id }}"
python ./build_tools/fetch_artifacts.py \
--run-id=${{ env.ARTIFACT_RUN_ID }} \
--run-github-repo=${{ github.repository }} \
--artifact-group=${{ inputs.artifact_group }} \
--output-dir=${{ env.ARTIFACTS_DIR }}
- name: Build Packages
id: build-packages
run: |
echo "Building ${{ inputs.native_package_type }} packages for ${{ inputs.artifact_group }} ${{ inputs.artifact_run_id }}"
python ./build_tools/packaging/linux/build_package.py \
--dest-dir ${{ env.PACKAGE_DIST_DIR }} \
--rocm-version ${{ inputs.rocm_version }} \
--target ${{ inputs.artifact_group }} \
--artifacts-dir ${{ env.ARTIFACTS_DIR }} \
--pkg-type ${{ inputs.native_package_type }} \
--version-suffix ${{ env.ARTIFACT_RUN_ID }}
- name: Install AWS CLI
run: bash ./dockerfiles/install_awscli.sh
- name: Configure AWS Credentials for non-forked repos
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::692859939525:role/therock-${{ inputs.release_type }}
- name: Upload Package repo to S3
id: upload-packages
run: |
echo "Uploading to s3 bucket : ${{ inputs.release_type }}"
python ./build_tools/packaging/linux/upload_package_repo.py \
--pkg-type ${{ inputs.native_package_type }} \
--s3-bucket ${{ env.S3_BUCKET_NATIVE }} \
--amdgpu-family ${{ inputs.artifact_group }} \
--artifact-id ${{ env.ARTIFACT_RUN_ID }} \
--job ${{ inputs.release_type }}