Files
TheRock/.github/workflows/setup_multi_arch.yml
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

220 lines
9.7 KiB
YAML

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
name: Setup (Multi-Arch)
on:
workflow_call:
inputs:
build_variant:
type: string
default: "release"
release_type:
description: >-
Release type: "ci", "dev", "nightly", or "prerelease"; controls
artifact bucket selection, IAM role, and package versioning.
type: string
default: ci
prerelease_version:
description: Prerelease version number such as '2'. This gets appended to the computed version after 'rc', like '7.10.0rc2'
type: string
default: ""
linux_amdgpu_families:
description: 'Comma-separated Linux GPU families. "all" = all, "none" or empty = skip.'
type: string
default: ""
windows_amdgpu_families:
description: 'Comma-separated Windows GPU families. "all" = all, "none" or empty = skip.'
type: string
default: ""
linux_test_labels:
description: "Comma-separated list of test labels for Linux."
type: string
default: ""
windows_test_labels:
description: "Comma-separated list of test labels for Windows."
type: string
default: ""
prebuilt_stages:
description: "Comma-separated build stages to skip (artifacts copied from baseline_run_id instead)."
type: string
default: ""
baseline_run_id:
description: "Workflow run ID to copy prebuilt stage artifacts from."
type: string
default: ""
stage_reuse_mode:
description: >-
Automatic stage-reuse mode (separate from the manual prebuilt_stages
input): "dry-run" (default) only reports which unaffected stages could
be reused; "reuse-stage" actually reuses them.
type: string
default: "dry-run"
stage_reuse_max_age_hours:
description: >-
Automatic stage reuse: reject baseline runs older than this many hours. default: "72"
type: string
default: "72"
stage_reuse_commit_history:
description: >-
Automatic stage reuse: number of recent branch commits to fetch for ancestry. default: "50"
type: string
default: "50"
build_pytorch:
description: "Build PyTorch wheels."
type: boolean
default: true
build_jax:
description: "Build JAX wheels."
type: boolean
default: false
python_version:
description: "Single Python version for wheel builds; empty uses the default matrix."
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: ""
external_repo:
description: "JSON object with 'repository' (e.g., 'ROCm/rocm-libraries') and 'ref' fields for external repo builds."
type: string
default: ""
outputs:
enable_build_jobs:
description: Whether to enable build jobs.
value: ${{ jobs.setup.outputs.enable_build_jobs }}
linux_build_config:
description: JSON object with Linux build configuration, or empty string if skipped.
value: ${{ jobs.setup.outputs.linux_build_config }}
windows_build_config:
description: JSON object with Windows build configuration, or empty string if skipped.
value: ${{ jobs.setup.outputs.windows_build_config }}
test_type:
description: "The test type to run (quick, standard, comprehensive, full)."
value: ${{ jobs.setup.outputs.test_type }}
linux_test_labels:
description: ROCm projects to run Linux tests on. Optional filter.
value: ${{ jobs.setup.outputs.linux_test_labels }}
windows_test_labels:
description: ROCm projects to run Windows tests on. Optional filter.
value: ${{ jobs.setup.outputs.windows_test_labels }}
rocm_package_version:
description: ROCm package version (primarily for Python packages).
value: ${{ jobs.setup.outputs.rocm_package_version }}
rocm_deb_package_version:
description: ROCm DEB package version for native packages.
value: ${{ jobs.setup.outputs.rocm_deb_package_version }}
rocm_rpm_package_version:
description: ROCm RPM package version for native packages.
value: ${{ jobs.setup.outputs.rocm_rpm_package_version }}
ref:
description: >-
Resolved commit SHA from checkout. Use this instead of the input ref
to ensure all downstream jobs use the same commit, even if the branch
HEAD moves during the workflow run.
value: ${{ jobs.setup.outputs.ref }}
external_repo_config:
description: "JSON config for external repo checkout (generated from external_repo_name)"
value: ${{ jobs.setup.outputs.external_repo_config }}
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-24.04
outputs:
enable_build_jobs: ${{ steps.configure.outputs.enable_build_jobs }}
linux_build_config: ${{ steps.configure.outputs.linux_build_config }}
windows_build_config: ${{ steps.configure.outputs.windows_build_config }}
test_type: ${{ steps.configure.outputs.test_type }}
linux_test_labels: ${{ steps.configure.outputs.linux_test_labels }}
windows_test_labels: ${{ steps.configure.outputs.windows_test_labels }}
rocm_package_version: ${{ steps.rocm_package_version.outputs.rocm_package_version }}
rocm_deb_package_version: ${{ steps.rocm_package_version.outputs.rocm_deb_package_version }}
rocm_rpm_package_version: ${{ steps.rocm_package_version.outputs.rocm_rpm_package_version }}
ref: ${{ steps.checkout.outputs.commit }}
external_repo_config: ${{ steps.external_repo_config.outputs.config_json }}
steps:
- name: Checking out repository
id: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref }}
# We need the parent commit to do a diff
fetch-depth: 2
- name: Checkout CI config
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ROCm/therock-ci-config
ref: main
path: ci-config
continue-on-error: true
# Note: the script reads PR labels, the base ref, etc. from the event
# payload (GITHUB_EVENT_PATH). That is the original event that started
# the workflow run, which may not directly map to the "inputs" on
# the "workflow_call" trigger for this file.
- name: Configuring CI options
id: configure
env:
BUILD_VARIANT: ${{ inputs.build_variant }}
RELEASE_TYPE: ${{ inputs.release_type }}
BUILD_PYTORCH: ${{ inputs.build_pytorch }}
BUILD_JAX: ${{ inputs.build_jax }}
PYTHON_VERSION: ${{ inputs.python_version }}
LINUX_AMDGPU_FAMILIES: ${{ inputs.linux_amdgpu_families }}
WINDOWS_AMDGPU_FAMILIES: ${{ inputs.windows_amdgpu_families }}
LINUX_TEST_LABELS: ${{ inputs.linux_test_labels }}
WINDOWS_TEST_LABELS: ${{ inputs.windows_test_labels }}
PREBUILT_STAGES: ${{ inputs.prebuilt_stages }}
BASELINE_RUN_ID: ${{ inputs.baseline_run_id }}
STAGE_REUSE_MODE: ${{ inputs.stage_reuse_mode }}
STAGE_REUSE_CURRENT_SHA: ${{ steps.checkout.outputs.commit }}
STAGE_REUSE_MAX_AGE_HOURS: ${{ inputs.stage_reuse_max_age_hours }}
STAGE_REUSE_COMMIT_HISTORY: ${{ inputs.stage_reuse_commit_history }}
# For cross-repo artifact reuse, use repository input (defaults to GITHUB_REPOSITORY).
# External repos set repository to "ROCm/TheRock" to reuse TheRock's prebuilt artifacts.
THEROCK_REPOSITORY: ${{ inputs.repository }}
# Skip path filtering for external repos (git sha won't exist in TheRock)
SKIP_PATH_FILTERS: ${{ inputs.external_repo != '' && 'true' || '' }}
CI_CONFIG_PATH: ci-config
# External repo family overrides allow callers to add/modify GPU family configs
# (e.g., adding test runners for architectures not enabled in TheRock's default config)
EXTERNAL_FAMILY_OVERRIDES: ${{ inputs.external_repo != '' && toJSON(fromJSON(inputs.external_repo).family_overrides) || '' }}
run: python ./build_tools/github_actions/configure_multi_arch_ci.py
# Note: Other scripts treat "dev releases" and "CI builds" differently.
# Here we set to a "dev" package version even for CI builds:
#
# release_type | package version | version example
# ------------ | --------------- | ------------------
# ci | dev | 7.10.0.dev0+f689a8
# dev | dev | 7.10.0.dev0+f689a8
# nightly | nightly | 7.10.0a20251021
# prerelease | prerelease | 7.10.0rc2
#
# Other scripts upload "ci" and "dev release" packages to different
# buckets, use different ccache namespaces, etc.
- name: Compute package version
id: rocm_package_version
run: |
python ./build_tools/compute_rocm_package_version.py \
--release-type=${{ inputs.release_type }} \
--prerelease-version=${{ inputs.prerelease_version }} \
--override-git-sha=${{ steps.checkout.outputs.commit }}
- name: Detect external repo config
id: external_repo_config
if: ${{ inputs.external_repo != '' }}
run: |
python ./build_tools/github_actions/detect_external_repo_config.py \
--external-repo-json='${{ inputs.external_repo }}'