Repository navigation
Expand file tree
/
Copy pathbuild_windows_python_packages.yml
More file actions
238 lines (224 loc) · 9.46 KB
/
Copy pathbuild_windows_python_packages.yml
File metadata and controls
238 lines (224 loc) · 9.46 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
name: Build Windows Python Packages
on:
workflow_dispatch:
inputs:
artifact_github_repo:
description: "GitHub repository for artifact_run_id"
type: string
default: ROCm/TheRock
artifact_run_id:
description: "artifact_run_id to download artifacts from"
type: string
default: "17865324892" # TODO: default to the most recent successful run (using a script)
artifact_group:
description: "artifact_group to build (e.g. 'gfx94X-dcgpu' for single family builds, 'multi-arch-release' for multi-arch builds with 'amdgpu_families' set)"
type: string
amdgpu_families:
description: "amdgpu_families for multi-arch builds as a semicolon-separated list (e.g. 'gfx94X-dcgpu;gfx120X-all'). Leave empty for single-family builds (those only use artifact_group)"
type: string
default: ""
linux_amdgpu_families:
description: "Linux side of the cross-platform family pair for multi-arch builds; used to advertise the union of device extras in the rocm sdist. Leave empty for single-platform builds."
type: string
default: ""
windows_amdgpu_families:
description: "Windows side of the cross-platform family pair. See linux_amdgpu_families."
type: string
default: ""
multiarch_index:
description: "Enable multi-arch indexing (generates per-family indexes)"
type: boolean
default: false
package_version:
description: "package_version to set on packages, e.g. '7.13.0.dev0+dbd7369489260265fc6ddfc9d0de1262a95fe974'"
type: string
release_type:
description: "Release type used for package publishing."
type: string
default: ""
repository:
description: "Repository to checkout. Defaults to github.repository."
type: string
default: ""
ref:
description: "Branch, tag, or SHA to checkout. Defaults to the triggering ref."
type: string
default: ""
quartz_tracking_id:
description: >-
Leave empty. Internal Quartz tracking id, set automatically by the
top-level orchestrator to link this run to its release lineage. Do not
set it manually.
type: string
default: ""
build_runs_on:
description: "Runner label for the build job"
type: string
default: "aws-windows-scale-rocm-prod-mix"
workflow_call:
inputs:
artifact_github_repo:
type: string
artifact_run_id:
type: string
default: ""
artifact_group:
type: string
amdgpu_families:
type: string
default: ""
linux_amdgpu_families:
type: string
default: ""
windows_amdgpu_families:
type: string
default: ""
multiarch_index:
type: boolean
default: false
package_version:
type: string
release_type:
type: string
default: ci
repository:
description: "Repository to checkout. Defaults to github.repository."
type: string
default: ""
ref:
description: "Branch, tag, or SHA to checkout. Defaults to the triggering ref."
type: string
default: ""
quartz_tracking_id:
type: string
default: ""
build_runs_on:
description: "Runner label for the build job"
type: string
default: "aws-windows-scale-rocm-prod-mix"
outputs:
package_find_links_url:
description: URL for pip --find-links to install built packages
value: ${{ jobs.build_rocm_wheels.outputs.package_find_links_url }}
kpack_split:
description: "true if this is a kpack-split flat build, false for legacy per-family"
value: ${{ jobs.build_rocm_wheels.outputs.kpack_split }}
permissions:
contents: read
run-name: Build Windows Python Packages (${{ inputs.artifact_group }}, ${{ inputs.package_version }})
jobs:
build_rocm_wheels:
name: Build Python | ${{ inputs.artifact_group }}
runs-on: ${{ github.repository_owner == 'ROCm' && inputs.build_runs_on || 'windows-2022' }}
permissions:
contents: read
id-token: write
outputs:
package_find_links_url: ${{ steps.upload.outputs.package_find_links_url }}
kpack_split: ${{ steps.upload.outputs.kpack_split }}
summary: ${{ steps.summary.outputs.summary }}
env:
QUARTZ_REPORTING_WORKFLOW: build_windows_python_packages.yml
QUARTZ_WORKFLOW_POSTFIX: "- build ROCm Python packages"
ARTIFACT_GITHUB_REPO: ${{ inputs.artifact_github_repo }}
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
ARTIFACT_GROUP: ${{ inputs.artifact_group }}
AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }}
LINUX_AMDGPU_FAMILIES: ${{ inputs.linux_amdgpu_families }}
WINDOWS_AMDGPU_FAMILIES: ${{ inputs.windows_amdgpu_families }}
PACKAGE_VERSION: ${{ inputs.package_version }}
RELEASE_TYPE: ${{ inputs.release_type }}
OUTPUT_ROOT: "${{ github.workspace }}"
ARTIFACTS_DIR: "${{ github.workspace }}/artifacts"
PACKAGES_DIR: "${{ github.workspace }}/packages"
defaults:
run:
shell: bash
steps:
- name: "Quartz - started ${{ env.QUARTZ_WORKFLOW_POSTFIX }}"
continue-on-error: true
if: ${{ vars.NOTIFY_QUARTZ_ENABLED == 'true' }}
uses: ROCm/Quartz/.github/actions/notify_quartz@f386a9756620938616af0b4d5d04b24ae6e0353f # notify_quartz/v1.1.1
with:
run_phase: started
reporting_workflow: ${{ env.QUARTZ_REPORTING_WORKFLOW }}
workflow_inputs: ${{ toJSON(inputs) }}
gh_app_client_id: ${{ secrets.GH_APP_HAULY_CID }}
gh_app_private_key: ${{ secrets.GH_APP_HAULY_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
timeout-minutes: 5
with:
persist-credentials: false
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install Python requirements
run: pip install -r requirements.txt
- name: Fetch artifacts
run: |
if [ -n "${AMDGPU_FAMILIES}" ]; then
# Multi-arch mode: use artifact_manager.py to fetch all families
echo "Fetching artifacts for multiple families: ${AMDGPU_FAMILIES}"
python ./build_tools/artifact_manager.py fetch \
--run-id="${ARTIFACT_RUN_ID}" \
--run-github-repo="${ARTIFACT_GITHUB_REPO}" \
--stage=all \
--amdgpu-families="${AMDGPU_FAMILIES}" \
--expand-family-to-targets \
--output-dir="${OUTPUT_ROOT}"
# NOTE: artifact_manager.py appends /artifacts to --output-dir
# in non-flatten mode, so pass OUTPUT_ROOT here so that
# artifacts land in ARTIFACTS_DIR ($OUTPUT_ROOT/artifacts).
else
# Single-family mode: use fetch_artifacts.py (backward compatible)
echo "Fetching artifacts for single family: ${ARTIFACT_GROUP}"
python ./build_tools/fetch_artifacts.py \
--run-github-repo="${ARTIFACT_GITHUB_REPO}" \
--run-id="${ARTIFACT_RUN_ID}" \
--artifact-group="${ARTIFACT_GROUP}" \
--output-dir="${ARTIFACTS_DIR}"
fi
- name: Build Python packages
run: |
python ./build_tools/build_python_packages.py \
--artifact-dir="${ARTIFACTS_DIR}" \
--dest-dir="${PACKAGES_DIR}" \
--version="${PACKAGE_VERSION}" \
--linux-amdgpu-families="${LINUX_AMDGPU_FAMILIES}" \
--windows-amdgpu-families="${WINDOWS_AMDGPU_FAMILIES}"
- name: Configure AWS Credentials
uses: ./.github/actions/configure_aws_artifacts_credentials
with:
release_type: ${{ inputs.release_type }}
# NOTE: we use `github.run_id` and NOT `env.ARTIFACT_RUN_ID` here!
# This ensures that if they are different we _download_ artifacts from the
# input run's subdirectory and _upload_ to our current run's subdirectory.
- name: Upload Python packages
id: upload
run: |
python build_tools/github_actions/upload_python_packages.py \
--input-packages-dir="${PACKAGES_DIR}" \
--artifact-group="${ARTIFACT_GROUP}" \
--run-id="${{ github.run_id }}" \
${{ inputs.multiarch_index && '--multiarch' || '' }}
- name: Capture job summary
id: summary
if: always()
run: python build_tools/github_actions/capture_job_summary.py
- name: "Quartz - completed ${{ env.QUARTZ_WORKFLOW_POSTFIX }}"
continue-on-error: true
if: ${{ always() && vars.NOTIFY_QUARTZ_ENABLED == 'true' }}
uses: ROCm/Quartz/.github/actions/notify_quartz@f386a9756620938616af0b4d5d04b24ae6e0353f # notify_quartz/v1.1.1
with:
run_phase: completed
run_conclusion: ${{ job.status }}
reporting_workflow: ${{ env.QUARTZ_REPORTING_WORKFLOW }}
workflow_inputs: ${{ toJSON(inputs) }}
workflow_step_outputs: ${{ toJSON(steps) }}
gh_app_client_id: ${{ secrets.GH_APP_HAULY_CID }}
gh_app_private_key: ${{ secrets.GH_APP_HAULY_PRIVATE_KEY }}