Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b503af0
feat(packaging): publish amdrocm-repo via workflow outputs
lsudarsh-amd Aug 11, 2026
58a3688
test(packaging): add test coverage for amdrocm-repo promotion to rele…
lsudarsh-amd Aug 12, 2026
f03e791
feat(packaging): add amdrocm-repo package for ROCm repository setup
lsudarsh-amd Aug 11, 2026
2d60e4e
docs(packaging): correct why per-profile repo packages collide
lsudarsh-amd Aug 13, 2026
de7e7b4
feat(packaging): target the RFC0012 stream repositories
lsudarsh-amd Aug 28, 2026
e112b77
feat(packaging): resolve stream parameters from the build line
lsudarsh-amd Aug 28, 2026
3d18eee
fix(packaging): enable jinja2 select_autoescape for the repo templates
lsudarsh-amd Aug 28, 2026
02cc544
Merge origin/main into shared/amdrocm-repo-publish
lsudarsh-amd Sep 15, 2026
88c8f04
Merge branch 'main' into shared/amdrocm-repo-package
nunnikri Sep 19, 2026
6ec918a
feat(packaging): name repo packages per distro and add the rc stream
lsudarsh-amd Sep 22, 2026
314da96
feat(ci): wire the amdrocm-repo package into native package CI
lsudarsh-amd Aug 11, 2026
4b5e805
feat(ci): build amdrocm-repo against the RFC0012 streams
lsudarsh-amd Aug 28, 2026
c5b094c
fix(packaging): align the repo package harness with per-stream naming
lsudarsh-amd Sep 28, 2026
b838e56
fix(packaging): only embed the pinned signing key; fix docs
lsudarsh-amd Sep 30, 2026
ba940f0
fix(ci): address review on the amdrocm-repo workflow
lsudarsh-amd Sep 30, 2026
dce4f4f
Merge remote-tracking branch 'origin/main' into shared/amdrocm-repo-p…
lsudarsh-amd Sep 30, 2026
459dcbb
Merge branch 'shared/amdrocm-repo-package' into shared/amdrocm-repo-p…
lsudarsh-amd Sep 30, 2026
a0bfec8
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Sep 30, 2026
f693784
fix(ci): suppress zizmor finding and grant id-token to amdrocm-repo s…
lsudarsh-amd Oct 6, 2026
80a0040
Merge remote-tracking branch 'origin/main' into shared/amdrocm-repo-p…
lsudarsh-amd Oct 7, 2026
79ad88f
Merge remote-tracking branch 'origin/shared/amdrocm-repo-package' int…
lsudarsh-amd Oct 7, 2026
f11c8d9
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 7, 2026
c7500eb
fix(packaging): use --rocm-version as given for every stream
lsudarsh-amd Oct 13, 2026
a4189da
Merge remote-tracking branch 'origin/shared/amdrocm-repo-package' int…
lsudarsh-amd Oct 13, 2026
834c3c6
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 13, 2026
ae70235
Merge remote-tracking branch 'origin/main' into shared/amdrocm-repo-p…
lsudarsh-amd Oct 13, 2026
65d5fe9
Merge remote-tracking branch 'origin/shared/amdrocm-repo-package' int…
lsudarsh-amd Oct 13, 2026
2d4ca70
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 13, 2026
5700c95
Upload the repo package to amdrepos/
lsudarsh-amd Oct 14, 2026
bca691b
Skip TSAN builds and upload the repo package with the new script
lsudarsh-amd Oct 14, 2026
49fc1a4
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 14, 2026
5a6c168
Rename the repo package folder to amd-repo-setup
lsudarsh-amd Oct 15, 2026
19bd8b3
Call the renamed upload_repo_setup_package.py
lsudarsh-amd Oct 15, 2026
1b0af2e
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 15, 2026
3892158
Publish the repo package to v5/amd-repo-setup/
lsudarsh-amd Oct 16, 2026
c97cfd8
Build the repo package once and inspect it before upload
lsudarsh-amd Oct 16, 2026
97aff39
Merge remote-tracking branch 'origin/shared/amdrocm-repo-publish' int…
lsudarsh-amd Oct 16, 2026
e4aea6a
Move the shared workflow-output and promotion changes to a new PR
lsudarsh-amd Oct 19, 2026
6dfa00e
Drop the promotion note from the stage job comment
lsudarsh-amd Oct 19, 2026
2aed73e
Merge branch 'shared/amdrocm-repo-publish' into shared/amdrocm-repo-ci
lsudarsh-amd Oct 19, 2026
6cab81e
refactor(packaging): rename the repo package to amd-repo-setup
lsudarsh-amd Oct 19, 2026
07d9b27
Merge branch 'shared/amdrocm-repo-package' into shared/amdrocm-repo-p…
lsudarsh-amd Oct 19, 2026
56fb52e
Rename the repo package to amd-repo-setup
lsudarsh-amd Oct 19, 2026
acd3cf6
Merge branch 'shared/amdrocm-repo-publish' into shared/amdrocm-repo-ci
lsudarsh-amd Oct 19, 2026
d7ccb2a
Rename the repo package to amd-repo-setup in the workflow
lsudarsh-amd Oct 19, 2026
119adea
fix(packaging): fail fast on a missing signing key and show gpg errors
lsudarsh-amd Oct 20, 2026
605c41a
Merge branch 'shared/amdrocm-repo-package' into shared/amdrocm-repo-p…
lsudarsh-amd Oct 20, 2026
f709e51
Merge branch 'shared/amdrocm-repo-publish' into shared/amdrocm-repo-ci
lsudarsh-amd Oct 20, 2026
dc016b4
Write the uploaded package's URL to GITHUB_OUTPUT
lsudarsh-amd Oct 22, 2026
e4e5433
Merge branch 'shared/amdrocm-repo-publish' into shared/amdrocm-repo-ci
lsudarsh-amd Oct 22, 2026
98e65cc
Run the amd-repo-setup jobs on ubuntu-26.04
lsudarsh-amd Oct 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 171 additions & 0 deletions .github/workflows/multi_arch_build_native_linux_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
type: string
required: false
default: "aws-linux-scale-rocm-prod"
enable_repo_package:
description: "Build, verify and publish the amdrocm-repo package"
type: boolean
required: false
default: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the buckets are not ready we needs to keep it default false. And once every thing is ready can enable and test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do. Default is updated to false.

outputs:
package_repository_url:
description: "Public repository URL for package installation"
Expand All @@ -67,6 +72,61 @@
run-name: Build ${{ inputs.native_package_type }} packages (${{ inputs.rocm_version }}, ${{ inputs.dist_amdgpu_families }}${{ inputs.release_type && format(', {0}', inputs.release_type) || '' }})

jobs:
# Resolve the parameters used to build and publish the amdrocm-repo package:
# the OS-profile build matrix for this package type, each profile's container
# image, and the repo.amd.com stream the build line configures, with its
# packages base URL, signing-key URL and build sub-folder.
#
# The build line and the stream are different vocabularies: prerelease
# configures rc. release_type stays the workflow input because it also selects
# the artifact bucket; the stream is derived from it.
setup_repo_params:
name: Resolve amdrocm-repo parameters
# nightly and prerelease are the lines that publish the package. release
# configures a stream too, but has no artifacts bucket to publish into.
# ASAN variants are promoted under packages-asan, which the resolved
# repository URL does not point at, so they skip.
if: inputs.enable_repo_package && contains(fromJSON('["nightly", "prerelease"]'), inputs.release_type) && !contains(inputs.build_variant, 'asan')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add tsan also here, as its coming soon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I've added TSAN here along with ASAN so both can be skipped.

runs-on: ubuntu-24.04

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to run on container like native linux workflow. Also need the github.repository_owner
runs-on: ${{ github.repository_owner == 'ROCm' && inputs.build_runs_on || 'ubuntu-24.04' }}
container:
image: ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:15241d0e87bf81fe0986006ab832a36ea53a2cda0f9a31b4a5dc7826bc2396b6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The setup job now uses the same runner and container as the build job.

# Resolves parameters only; it needs no cloud credentials.
permissions:
contents: read
env:
NATIVE_PACKAGE_TYPE: ${{ inputs.native_package_type }}
RELEASE_TYPE: ${{ inputs.release_type }}
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
outputs:
os_profiles: ${{ steps.derive.outputs.os_profiles }}
images: ${{ steps.derive.outputs.images }}
stream: ${{ steps.derive.outputs.stream }}
repo_base_url: ${{ steps.derive.outputs.repo_base_url }}
gpg_key_url: ${{ steps.derive.outputs.gpg_key_url }}
repo_sub_folder: ${{ steps.derive.outputs.repo_sub_folder }}
steps:
- name: Checking out repository
timeout-minutes: 15
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || '' }}

- name: Set up Python
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'

- name: Install Python requirements
run: pip install jinja2

- name: Derive amdrocm-repo parameters
id: derive
run: |
python ./build_tools/packaging/linux/get_url_repo_params.py get-repo-params \
--pkg-type "${NATIVE_PACKAGE_TYPE}" \
--release-type "${RELEASE_TYPE}" \
--run-id "${ARTIFACT_RUN_ID}"

build_native_packages:
name: Build ${{ inputs.native_package_type }} packages
runs-on: ${{ github.repository_owner == 'ROCm' && inputs.build_runs_on || 'ubuntu-24.04' }}
Expand Down Expand Up @@ -170,6 +230,25 @@
--package-dir "${{ env.PACKAGE_DIST_DIR }}" \
--release-type "${RELEASE_TYPE}"

# Build the amdrocm-repo package for every OS profile of this package type
# and check that its payload is the expected files, at the expected paths,
# owned by root. This container can build both package types but has
# neither dnf nor zypper, so the packages are inspected rather than
# installed.
#
# Runs on every line, so this check is the same code on a pull request and
# on a release build. The repository URL is a placeholder and is never
# contacted: the build needs no key it has to fetch and no repository it
# has to reach. See the script's docstring for how that is guaranteed.
- name: Build and inspect amdrocm-repo packages

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like 2 duplicate jobs to build repo package. This and stage repo belwo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. Thanks. I've removed it. The package is now built once in the stage job.

if: inputs.enable_repo_package

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No dependency to the setup repo params steps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that step used placeholder values. It's gone and the only build now uses the setup job's parameters.

run: |
python ./build_tools/packaging/linux/inspect_repo_package.py \
--pkg-type "${NATIVE_PACKAGE_TYPE}" \
--rocm-version "${ROCM_VERSION}" \
--repo-base-url https://example.com/rocm/core/packages \
--repo-sub-folder 20000101-inspect

- name: Configure AWS credentials for artifact uploads
uses: ./.github/actions/configure_aws_artifacts_credentials
with:
Expand Down Expand Up @@ -200,3 +279,95 @@
workflow_step_outputs: ${{ toJSON(steps) }}
gh_app_client_id: ${{ secrets.GH_APP_HAULY_CID }}
gh_app_private_key: ${{ secrets.GH_APP_HAULY_PRIVATE_KEY }}

# Build the amdrocm-repo package for each OS profile of this package type and
# publish it to this run's artifacts bucket, from which release promotion
# copies it with the rest of the packages.
stage_repo_package:
name: Stage amdrocm-repo (${{ matrix.os_profile }})
needs: [setup_repo_params]
if: inputs.enable_repo_package && needs.setup_repo_params.outputs.repo_base_url != ''
strategy:
fail-fast: false
matrix:
# setup_repo_params does not run on the lines that do not publish, and a
# skipped job's outputs are empty strings, which fromJSON cannot parse.
# Fall back to an empty matrix so this job skips cleanly.
os_profile: ${{ fromJSON(needs.setup_repo_params.outputs.os_profiles || '[]') }}
runs-on: ${{ github.repository_owner == 'ROCm' && 'aws-linux-scale-rocm-prod' || 'ubuntu-24.04' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since repo package is a small package wont need aws-linux-scale-rocm-prod instance. A normal Ubuntu-2404 runner should be good enough. scale prod is meant for heavy jobs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I've switched it to now use ubuntu-24.04.

container:
image: ${{ fromJSON(needs.setup_repo_params.outputs.images || '{}')[matrix.os_profile] }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please suppress the zizmor unpinned-images audit finding here: https://github.com/ROCm/TheRock/actions/runs/36768360954/job/110068432039?pr=7280#step:6:95

error[unpinned-images]: unpinned image references
   --> .scan-target/.github/workflows/multi_arch_build_native_linux_packages.yml:299:7
    |
299 |       image: ${{ fromJSON(needs.setup_repo_params.outputs.images || '{}')[matrix.os_profile] }}
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ container image may be unpinned
    |
    = note: audit confidence → Low
    = help: audit documentation → https://docs.zizmor.sh/audits/#unpinned-images

See #8684 for example:

    container:
-      image: ${{ needs.prepare_install_context.outputs.container_image }}
+      # get_url_repo_params.py manages image references for each OS profile.
+      # zizmor cannot inspect the dynamically selected image.
+      image: ${{ needs.prepare_install_context.outputs.container_image }} # zizmor: ignore[unpinned-images]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I've suppressed it the same way as #8684. While in this part of the code, I noticed that #8637 moved id-token: write from the workflow level to the jobs that need it, so I also gave this job its own contents: read / id-token: write. Otherwise it would lose the id-token permission it needs for AWS now that the stack includes main.

env:
ROCM_VERSION: ${{ inputs.rocm_version }}
NATIVE_PACKAGE_TYPE: ${{ inputs.native_package_type }}
RELEASE_TYPE: ${{ inputs.release_type }}
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
OS_PROFILE: ${{ matrix.os_profile }}
STREAM: ${{ needs.setup_repo_params.outputs.stream }}
REPO_BASE_URL: ${{ needs.setup_repo_params.outputs.repo_base_url }}
GPG_KEY_URL: ${{ needs.setup_repo_params.outputs.gpg_key_url }}
REPO_SUB_FOLDER: ${{ needs.setup_repo_params.outputs.repo_sub_folder }}
steps:
- name: Checkout
timeout-minutes: 15
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || '' }}

- name: Install system prerequisites
run: |
bash build_tools/packaging/linux/setup_repo_build_deps.sh \
--os-profile "${OS_PROFILE}"

- name: Setup Python
run: |
bash build_tools/packaging/linux/setup_python_cmd.sh \
--os-profile "${OS_PROFILE}" \
--install-runtime \
--output-format github

- name: Install Python dependencies
run: |
$PYTHON_CMD -m venv /tmp/repo-venv
/tmp/repo-venv/bin/python -m pip install --upgrade pip
/tmp/repo-venv/bin/python -m pip install jinja2 boto3
echo "PYTHON_CMD=/tmp/repo-venv/bin/python" >> "$GITHUB_ENV"
# configure_aws_artifacts_credentials runs bare `python`, which these
# per-distro images do not provide. A venv always does, so putting its
# bin/ on PATH lets the credentials action run here and the package
# publish from the job that built it.
echo "/tmp/repo-venv/bin" >> "$GITHUB_PATH"

- name: Build amdrocm-repo
run: |
# The build sub-folder is empty except on a per-build stream, which is
# the only kind the builder accepts one for. The key URL is empty on an
# unsigned stream, where the builder needs none.
$PYTHON_CMD build_tools/packaging/linux/build_repo_package.py \
--os-profile "${OS_PROFILE}" \
--stream "${STREAM}" \
--repo-base-url "${REPO_BASE_URL}" \
--gpg-key-url "${GPG_KEY_URL}" \
--repo-sub-folder "${REPO_SUB_FOLDER}" \
--rocm-version "${ROCM_VERSION}" \
--dest-dir repo-package-out \
--verify-repo-url

# Configured after the build so the key fetch, the repository check and
# the package build run without artifacts-bucket credentials.
- name: Configure AWS credentials for artifact uploads
uses: ./.github/actions/configure_aws_artifacts_credentials
with:
release_type: ${{ inputs.release_type }}

- name: Publish amdrocm-repo
run: |
pkg="$($PYTHON_CMD build_tools/packaging/linux/inspect_repo_package.py locate \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to keep Inspect as a separate step?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inspect is already its own step ("Build and inspect amdrocm-repo packages"). The upload step only called it to find the built file. The upload script now finds the file itself, so the upload step just uploads.

--dest-dir repo-package-out --pkg-type "${NATIVE_PACKAGE_TYPE}")"
$PYTHON_CMD build_tools/packaging/linux/publish_repo_package.py \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nomenclature used in Rock is upload to artifact bucket and publish to final bucket. It might be good to make this script as upload script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done. It's now upload_repo_setup_package.py (renamed in #7276), and the step is "Upload amdrocm-repo". It also uploads to a new folder now: <run_id>-linux/amd-repo-setup/<distro>/ in the artifacts bucket.

--file "$pkg" \
--run-id "${ARTIFACT_RUN_ID}" \
--os-profile "${OS_PROFILE}" \
--pkg-type "${NATIVE_PACKAGE_TYPE}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No quartz integration for repo package creation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I've added Quartz integration. The setup job reports the start, and a new job reports completion, the same way test_native_linux_packages_install.yml does. These reports land on the same Quartz record as that of the build job, since Quartz keys on the run and the workflow file.

Loading
Loading