-
Notifications
You must be signed in to change notification settings - Fork 236
Add release prebuilt artifact reuse mode #5095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marbre
wants to merge
10
commits into
main
Choose a base branch
from
users/marbre/release-prebuilt-artifact-reuse
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5555d48
Add release prebuilt artifact reuse mode
marbre 8ee9b65
Derive prebuilt copy families from package_targets matrix
marbre c742888
Honor --require-matches when copy yields zero artifacts
marbre ff1d7da
Align copy --stage=all with fetch --stage=all semantics
marbre fbcb162
Drop owner gate on prebuilt fetch and tarball steps
marbre cbb586d
Skip Windows PyTorch dispatch in prebuilt mode
marbre d3ae4bd
Mirror dest output_root in source-prefix copy mode
marbre 1da0896
Annotate single-family release run-names with prebuilt_prefix
marbre 49ab4d4
Add run-name to reusable copy_prebuilt_artifacts workflow
marbre d65ceb8
Fix doc drift around prebuilt-copy semantics
marbre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # Copyright Advanced Micro Devices, Inc. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # Reusable workflow that materializes a release run's artifact prefix from a | ||
| # fixed "prebuilt" prefix in the active artifact namespace. | ||
| # | ||
| # Behavior: | ||
| # - If `prebuilt_prefix` is empty, the job runs but is a successful no-op. | ||
| # Downstream jobs can keep `needs:` on this workflow without conditional | ||
| # plumbing for normal source-build runs. | ||
| # - If `prebuilt_prefix` is non-empty, the job copies all stage artifacts | ||
| # from that prefix into the active run's prefix using | ||
| # `artifact_manager.py copy --source-prefix-only --stage=all | ||
| # --require-matches`. | ||
| # | ||
| # This workflow is also exposed as `workflow_dispatch` for manual reruns, | ||
| # e.g. when re-staging a patched prebuilt prefix. | ||
|
|
||
| name: Copy Prebuilt Artifacts | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| prebuilt_prefix: | ||
| description: >- | ||
| Source prefix component (the part before "-linux"/"-windows") to | ||
| copy artifacts from. Empty means no-op (source-build mode). | ||
| type: string | ||
| default: "" | ||
| platform: | ||
| description: 'Platform: "linux" or "windows".' | ||
| type: string | ||
| required: true | ||
| amdgpu_families: | ||
| description: "Semicolon-separated GPU families to copy." | ||
| type: string | ||
| required: true | ||
| expand_family_to_targets: | ||
| description: >- | ||
| Pass --expand-family-to-targets to artifact_manager copy. Required | ||
| for kpack-split (multi-arch) prefixes; should be false for | ||
| single-family release builds. | ||
| type: boolean | ||
| default: false | ||
| release_type: | ||
| description: 'Release type: "dev", "nightly", or "prerelease".' | ||
| type: string | ||
| required: true | ||
| 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: "" | ||
| workflow_dispatch: | ||
| inputs: | ||
| prebuilt_prefix: | ||
| description: 'Source prefix (e.g. "rerun-2026-04-30").' | ||
| type: string | ||
| required: true | ||
| platform: | ||
| description: 'Platform: "linux" or "windows".' | ||
| type: choice | ||
| options: | ||
| - linux | ||
| - windows | ||
| default: linux | ||
| amdgpu_families: | ||
| description: "Semicolon-separated GPU families to copy." | ||
| type: string | ||
| required: true | ||
| expand_family_to_targets: | ||
| description: "Pass --expand-family-to-targets to artifact_manager copy." | ||
| type: boolean | ||
| default: false | ||
| release_type: | ||
| description: 'Release type: "dev", "nightly", or "prerelease".' | ||
| type: choice | ||
| options: | ||
| - dev | ||
| - nightly | ||
| - prerelease | ||
| default: dev | ||
| ref: | ||
| description: "Branch, tag, or SHA to checkout." | ||
| type: string | ||
| default: "" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| run-name: >- | ||
| Copy Prebuilt Artifacts | ||
| (${{ inputs.platform }}, ${{ inputs.release_type }}) | prebuilt: ${{ inputs.prebuilt_prefix }} | ||
|
|
||
| jobs: | ||
| copy: | ||
| name: Copy Prebuilt Artifacts | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: No-op when prebuilt_prefix is empty | ||
| if: ${{ inputs.prebuilt_prefix == '' }} | ||
| run: echo "prebuilt_prefix is empty; skipping copy (source-build mode)." | ||
|
|
||
| - name: Checkout | ||
| if: ${{ inputs.prebuilt_prefix != '' }} | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| repository: ${{ inputs.repository || github.repository }} | ||
| ref: ${{ inputs.ref }} | ||
|
|
||
| - name: Setup Python | ||
| if: ${{ inputs.prebuilt_prefix != '' }} | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install artifact manager dependencies | ||
| if: ${{ inputs.prebuilt_prefix != '' }} | ||
| run: pip install boto3 | ||
|
|
||
| - name: Configure AWS credentials | ||
| if: ${{ inputs.prebuilt_prefix != '' }} | ||
| uses: ./.github/actions/configure_aws_artifacts_credentials | ||
| with: | ||
| release_type: ${{ inputs.release_type }} | ||
|
|
||
| - name: Copy prebuilt artifacts | ||
| if: ${{ inputs.prebuilt_prefix != '' }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| RELEASE_TYPE: ${{ inputs.release_type }} | ||
| run: | | ||
| python build_tools/artifact_manager.py copy \ | ||
| --source-run-id="${{ inputs.prebuilt_prefix }}" \ | ||
| --source-prefix-only \ | ||
| --stage=all \ | ||
| --platform="${{ inputs.platform }}" \ | ||
| --amdgpu-families="${{ inputs.amdgpu_families }}" \ | ||
| ${{ inputs.expand_family_to_targets && '--expand-family-to-targets' || '' }} \ | ||
| --require-matches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to watch for:
the
base_lib_generic.tar.zstcontainsdist_info.jsonwith contents like{ "dist_amdgpu_targets" : "gfx942;gfx1100;gfx1101;gfx1102;gfx1103;gfx1151;gfx1200;gfx1201;gfx950" }just repackaging a subset of existing artifacts (e.g. choosing to release a subset of the targets that were built in a nightly release for a stable release) with a changed version will include the original list there, resulting in tools like
rocm-sdk targetsreturning a list that may not match expectations (see also #4687)