Skip to content

Commit 82990b0

Browse files
new ci weekly + new, refactored amdgpu matrix generator + base representation
1 parent 88105c0 commit 82990b0

File tree

6 files changed

+999
-1
lines changed

6 files changed

+999
-1
lines changed

.github/workflows/build_portable_linux_artifacts.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
package_version:
77
type: string
88
default: ADHOCBUILD
9+
# TODO TODO should this not be singular? just a single build target?
910
amdgpu_families:
1011
type: string
1112
default: gfx94X-dcgpu
@@ -14,6 +15,11 @@ on:
1415
default: false
1516
extra_cmake_options:
1617
type: string
18+
# TODO remove late the default when switchting to using the new_setup.yml
19+
container_image:
20+
type: string
21+
required: false
22+
default: 'ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b'
1723

1824
workflow_call:
1925
inputs:
@@ -26,6 +32,11 @@ on:
2632
type: boolean
2733
extra_cmake_options:
2834
type: string
35+
# TODO remove late the default when switchting to using the new_setup.yml
36+
container_image:
37+
type: string
38+
required: false
39+
default: 'ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b'
2940

3041
# See the details regarding permissions from the link:
3142
# https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#oidc
@@ -40,7 +51,7 @@ jobs:
4051
permissions:
4152
id-token: write
4253
container:
43-
image: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b
54+
image: ${{ inputs.container_image }}
4455
options: -v /runner/config:/home/awsconfig/
4556
env:
4657
AWS_SHARED_CREDENTIALS_FILE: /home/awsconfig/credentials.ini

.github/workflows/new_ci_linux.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI - Linux (New)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
amdgpu_family_config:
7+
type: string
8+
artifact_run_id:
9+
type: string
10+
linux_use_prebuilt_artifacts:
11+
type: string
12+
container_image:
13+
type: string
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build_linux_packages:
20+
name: Build
21+
if: ${{ inputs.linux_use_prebuilt_artifacts == 'false' }}
22+
uses: ./.github/workflows/build_linux_packages.yml
23+
secrets: inherit
24+
with:
25+
amdgpu_families: ${{ inputs.amdgpu_family_config.amdgpu_family }}
26+
expect_failure: ${{ inputs.amdgpu_family_config.build.expect_failure }}
27+
container_image: ${{ inputs.container_image }}
28+
permissions:
29+
contents: read
30+
id-token: write
31+
32+
test_linux_packages:
33+
needs: [build_linux_packages]
34+
name: Test
35+
# If the dependent job failed/cancelled, this job will not be run
36+
# The linux_use_prebuilt_artifacts "or" statement ensures that tests will run if previous build step is run or skipped.concurrency.
37+
if: >-
38+
${{
39+
!failure() &&
40+
!cancelled() &&
41+
(
42+
inputs.linux_use_prebuilt_artifacts == 'false' ||
43+
inputs.linux_use_prebuilt_artifacts == 'true'
44+
)
45+
}}
46+
strategy:
47+
fail-fast: false
48+
uses: ./.github/workflows/test_packages.yml
49+
with:
50+
amdgpu_families: ${{ inputs.amdgpu_family_config.amdgpu_family }}
51+
test_runs_on: ${{ inputs.amdgpu_family_config.test.runs_on }}
52+
artifact_run_id: ${{ inputs.artifact_run_id }}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# This CI workflow is triggered by:
2+
# - scheduled run
3+
#
4+
# In the scheduled run, we run all targets from amdgpu_family_matrix.py and amdgpu_family_matrix_xfail.py
5+
# As some of these builds are xfail, we allow errors to occur with `continue-on-error`, where the job will fail but the workflow is green
6+
7+
name: CI Weekly (New)
8+
9+
on:
10+
# For AMD GPU families that expect_failure, we run builds and tests from this scheduled trigger
11+
schedule:
12+
- cron: "0 2 * * 0" # Runs weekly at 2 AM UTC every Sunday
13+
workflow_dispatch:
14+
inputs:
15+
linux_amdgpu_families:
16+
type: string
17+
description: "Insert comma-separated list of Linux GPU families to build and test. ex: gfx94X, gfx1201X"
18+
default: ""
19+
linux_amdgpu_families_predefined_groups:
20+
type: string
21+
description: "Insert comma-separated list of predefined group(s) of Linux GPU families found in build_tools/github_actions/new_amdgpu_family_matrix.py (e.g. amdgpu_presubmit)"
22+
default: ""
23+
linux_use_prebuilt_artifacts:
24+
type: boolean
25+
description: "If enabled, the CI will pull Linux artifacts using artifact_run_id and only run tests"
26+
windows_amdgpu_families:
27+
type: string
28+
description: "Insert comma-separated list of Windows GPU families to build and test. ex: gfx94X, gfx1201X"
29+
default: ""
30+
windows_amdgpu_families_predefined_groups:
31+
type: string
32+
description: "Insert comma-separated list of predefined group(s) of Windows GPU families found in build_tools/github_actions/new_amdgpu_family_matrix.py (e.g. amdgpu_presubmit)"
33+
default: ""
34+
windows_use_prebuilt_artifacts:
35+
type: boolean
36+
description: "If enabled, the CI will pull Windows artifacts using artifact_run_id and only run tests"
37+
artifact_run_id:
38+
type: string
39+
description: "If provided, the tests will run on this artifact ID"
40+
default: ""
41+
42+
permissions:
43+
contents: read
44+
45+
concurrency:
46+
# A PR number if a pull request and otherwise the commit hash. This cancels
47+
# queued and in-progress runs for the same PR (presubmit) or commit
48+
# (postsubmit). The workflow name is prepended to avoid conflicts between
49+
# different workflows.
50+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
51+
cancel-in-progress: true
52+
53+
jobs:
54+
setup:
55+
uses: ./.github/workflows/new_setup.yml
56+
with:
57+
# ci triggered via cron do not accept input values so we have to set them here
58+
linux_amdgpu_families: ${{ github.event_name == 'schedule' && 'gfx1151' || github.event.inputs.linux_amdgpu_families }}
59+
linux_amdgpu_families_predefined_groups: ${{ github.event_name == 'schedule' && '' || github.event.inputs.linux_amdgpu_families_predefined_groups }}
60+
linux_use_prebuilt_artifacts: ${{ github.event_name == 'schedule' && '' || github.event.inputs.linux_use_prebuilt_artifacts }}
61+
windows_amdgpu_families: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_amdgpu_families }}
62+
windows_amdgpu_families_predefined_groups: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_amdgpu_families_predefined_groups }}
63+
windows_use_prebuilt_artifacts: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_use_prebuilt_artifacts }}
64+
artifact_run_id: ${{ github.event_name == 'schedule' && '' || github.event.inputs.artifact_run_id }}
65+
66+
setup_cmake4:
67+
uses: ./.github/workflows/new_setup.yml
68+
with:
69+
# ci triggered via cron do not accept input values so we have to set them here
70+
linux_amdgpu_families: ${{ github.event_name == 'schedule' && 'gfx1151' || github.event.inputs.linux_amdgpu_families }}
71+
linux_amdgpu_families_predefined_groups: ${{ github.event_name == 'schedule' && '' || github.event.inputs.linux_amdgpu_families_predefined_groups }}
72+
linux_use_prebuilt_artifacts: ${{ github.event_name == 'schedule' && '' || github.event.inputs.linux_use_prebuilt_artifacts }}
73+
windows_amdgpu_families: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_amdgpu_families }}
74+
windows_amdgpu_families_predefined_groups: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_amdgpu_families_predefined_groups }}
75+
windows_use_prebuilt_artifacts: ${{ github.event_name == 'schedule' && '' || github.event.inputs.windows_use_prebuilt_artifacts }}
76+
artifact_run_id: ${{ github.event_name == 'schedule' && '' || github.event.inputs.artifact_run_id }}
77+
# ghcr.io/rocm/therock_build_manylinux_x86_64:users-lpromber-DockerCmake4
78+
container_image_linux: "ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:60d4208c75dfe3025d0744c336729088774758fa06eea5cc622787ba86416425"
79+
# we always want to build and not use artifacts
80+
force_build: "true"
81+
82+
weekly_linux_cmake4_build_and_test:
83+
name: 'Weekly: Linux CMake 4'
84+
needs: setup_cmake4
85+
if: >-
86+
${{ needs.setup_cmake4.outputs.amdgpu_family_matrix.linux != '[]' }}
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
linux_config: ${{ fromJSON(needs.setup_cmake4.outputs.amdgpu_family_matrix.linux) }}
91+
uses: ./.github/workflows/new_ci_linux.yml
92+
secrets: inherit
93+
with:
94+
amdgpu_families_config: ${{ matrix.linux_config }}
95+
artifact_run_id: ${{ inputs.artifact_run_id }}
96+
linux_use_prebuilt_artifacts: ${{ inputs.linux_use_prebuilt_artifacts == true && 'true' || 'false' }}
97+
container_image: ${{ fromJSON(needs.setup_cmake4.outputs.container_image_linux) }}
98+
permissions:
99+
contents: read
100+
id-token: write
101+
102+
# windows_build_and_test:
103+
# name: Windows
104+
# needs: setup
105+
# if: >-
106+
# ${{
107+
# needs.setup.outputs.windows_amdgpu_families != '[]' &&
108+
# needs.setup.outputs.enable_build_jobs == 'true'
109+
# }}
110+
# strategy:
111+
# fail-fast: false
112+
# matrix:
113+
# families: ${{ fromJSON(needs.setup.outputs.windows_amdgpu_families) }}
114+
# uses: ./.github/workflows/ci_windows.yml
115+
# with:
116+
# amdgpu_families: ${{ matrix.families.family }}
117+
# test_runs_on: ${{ matrix.families.test-runs-on }}
118+
# artifact_run_id: ${{ inputs.artifact_run_id }}
119+
# extra_cmake_options: ${{ matrix.extra_cmake_options }}
120+
# expect_failure: ${{ matrix.families.expect_failure == true }}
121+
# windows_use_prebuilt_artifacts: ${{ inputs.windows_use_prebuilt_artifacts == true && 'true' || 'false' }}
122+
# permissions:
123+
# contents: read
124+
# id-token: write
125+
126+
# build_python_packages:
127+
# name: Build Python Packages
128+
# uses: ./.github/workflows/build_python_packages.yml

.github/workflows/new_setup.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Setup
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
container_image_linux:
7+
description: TheRock CI default container image for linux
8+
type: string
9+
required: false
10+
default: 'ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:2f3ebd0beb04c449fdb36933e54bdc69483b914fb9005594d3fc9444c206b54b'
11+
outputs:
12+
amdgpu_family_matrix:
13+
description: Linux and Windows families for build, test and release.
14+
value: ${{ jobs.setup.outputs.amdgpu_family_matrix }}
15+
container_image_linux:
16+
description: TheRock CI default container image for linux
17+
value: ${{ inputs.container_image_linux }}
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
setup:
24+
runs-on: ubuntu-24.04
25+
env:
26+
# The commit being checked out is the merge commit for a PR. Its first
27+
# parent will be the tip of the base branch.
28+
BASE_REF: HEAD^
29+
outputs:
30+
amdgpu_family_matrix: ${{ steps.configure.outputs.amdgpu_family_matrix }}
31+
steps:
32+
- name: "Checking out repository"
33+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
34+
with:
35+
# We need the parent commit to do a diff
36+
fetch-depth: 2
37+
38+
- name: Set PR_LABELS variable with labels assigned to pull request
39+
if: ${{ github.event.pull_request }} # only set PR labels var if this is a pull request
40+
env:
41+
GITHUB_TOKEN: ${{ github.token }}
42+
PR_NUMBER: ${{ github.event.number }}
43+
run: |
44+
echo "PR_LABELS=$(gh pr view ${PR_NUMBER} --json labels)" >> $GITHUB_ENV
45+
46+
- name: "Configuring CI options"
47+
id: configure
48+
env:
49+
INPUT_LINUX_AMDGPU_FAMILIES: ${{ github.event.inputs.linux_amdgpu_families }}
50+
INPUT_LINUX_AMDGPU_FAMILIES_PREDEFINED_GROUPS: ${{ github.event.inputs.linux_amdgpu_families_predefined_groups }}
51+
LINUX_USE_PREBUILT_ARTIFACTS: ${{ github.event.inputs.linux_use_prebuilt_artifacts }}
52+
INPUT_WINDOWS_AMDGPU_FAMILIES: ${{ github.event.inputs.windows_amdgpu_families }}
53+
INPUT_WINDOWS_AMDGPU_FAMILIES_PREDEFINED_GROUPS: ${{ github.event.inputs.windows_amdgpu_families_predefined_groups }}
54+
WINDOWS_USE_PREBUILT_ARTIFACTS: ${{ github.event.inputs.windows_use_prebuilt_artifacts }}
55+
INPUT_TASKS_FORCE_BUILD: ${{ github.event.inputs.force_build }}
56+
INPUT_TASKS_NO_TESTS: ${{ github.event.inputs.no_tests }}
57+
INPUT_TASKS_MAKE_RELEASE: ${{ github.event.inputs.make_release }}
58+
run: ./build_tools/github_actions/configure_amdgpu_matrix.py

0 commit comments

Comments
 (0)