Skip to content

feat(packaging): publish amdrocm-repo via workflow outputs - #7276

Open
lsudarsh-amd wants to merge 8 commits into
shared/amdrocm-repo-packagefrom
shared/amdrocm-repo-publish
Open

lsudarsh-amd wants to merge 8 commits into
shared/amdrocm-repo-packagefrom
shared/amdrocm-repo-publish

Conversation

@lsudarsh-amd

@lsudarsh-amd lsudarsh-amd commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The amdrocm-repo bootstrap package needs a published location before anyone can fetch and install it. This pull request adds the script that publishes it, the build parameters the packaging workflow reads, and an install-harness mode that installs the built package. The workflow job that runs them comes in the next pull request.

It also resolves two review comments on #6901, which this split supersedes. The publish helper imported boto3 inline and did not use WorkflowOutputRoot. It now resolves its destination through WorkflowOutputRoot and writes through StorageBackend, which takes boto3 out of this script entirely rather than hoisting the import to the top of the file. The dependency still exists behind S3StorageBackend, but the helper no longer touches it.

This is the third of four pull requests:

This builds on #7269's branch, because the build parameters and the harness read the package's names and stream rules from build_repo_package. The diff shows only this PR's files.

Contributes to #6986.

Technical Details

What this adds

A new output type. WorkflowOutputRoot.native_linux_repo_package(pkg_type, os_profile) returns {prefix}/packages/{pkg_type}/repo/{os_profile}/amdrocm-repo.{pkg_type}. It follows the process in docs/development/workflow_outputs.md, which is why this adds the method, its tests and the documentation together.

The package sits beside the package index rather than in it. Clients fetch the file directly by URL, so it does not belong in the index. The published name is fixed at amdrocm-repo.<ext> to keep that URL stable, so the per-profile directory is what stops one profile's package overwriting another's. It also keeps a client from resolving the package built for a different distro, since every profile uses the same package name.

Promotion already carries it. publish_rocm_to_release_buckets.py copies each run's packages/<type>/ tree to the release bucket, and the package sits inside that tree. New tests run the real promotion into a local backend and check that every profile's package arrives with the repository beside it. Two S3StorageBackend tests pin the recursive listing the copy depends on.

The publish helper derives its own destination. publish_repo_package.py takes --run-id and resolves the bucket and prefix through WorkflowOutputRoot, which is the single source of truth for CI path layout. The #6901 version took --bucket, --prefix and --endpoint-url. Two consequences:

  1. The release line raises. It isn't an artifact release type, so the bucket lookup rejects it. Release uploads happen outside CI, and every therock-release-* bucket has iam_role=None. The publishing job does not run for release, so the raise is a backstop.
  2. The script needs GITHUB_REPOSITORY, RELEASE_TYPE and the workflow event payload in its job environment.

Nothing on main calls this script yet. The workflow that does lands in the next pull request.

Build parameters. get_url_repo_params.py get-repo-params writes everything the build matrix needs in one $GITHUB_OUTPUT call: os_profiles and images (the matrix), then stream, repo_base_url, gpg_key_url and repo_sub_folder.

The build line and the stream are different vocabularies: release maps to stable, prerelease to rc and nightly to nightly. This script holds only that mapping and where each stream is served. Everything else about a stream comes from build_repo_package. So the key URL is emitted only for a signed stream, and the dated build folder only for a per-build stream. A line with no public stream (ci, dev) gets those four values empty and still gets the matrix. rc.repo.amd.com serves all four profiles, signed with the same key as stable. The fingerprint matches the builder's pin.

build_repo_package is imported inside the subcommand rather than at module level. The script's other subcommands run on the runner's system Python in test_native_linux_packages_install.yml, in a job that installs no Python packages.

Install harness. native_linux_package_install_test.py --repo-package-dir <dir> configures the repository by installing the built package instead of writing repository files directly. It then refreshes that repository, checks the repo file and signing key are in place, and installs ROCm from it. --repo-config-only stops before the ROCm install. Nothing in CI uses this mode yet.

The repo id, repo file name and key paths come from build_repo_package (repo_id(), is_signed(), DEB_KEYRING_PATH, RPM_GPG_KEY_PATH), so only the distro's repo directories stay in the harness. Argument parsing rejects --repo-package-dir unless --release-type names a line with a public stream. packaging/linux/tests/requirements.txt gains jinja2>=3.0.0, the pin used elsewhere, because this mode imports build_repo_package. The harness's other modes still load without it.

Smaller changes

Input validation. --run-id must be numeric and --os-profile must be a single safe path segment. Both become path segments of the object key, and a value like ../.. would escape a local staging directory. get-repo-params checks the run id too, because it goes into $GITHUB_OUTPUT, where gha_set_output writes multi-line values with a heredoc whose delimiter it does not check. Both inputs come from CI, so this is defence in depth.

One fixture. RunTestsTestTypeTest._base_args gains repo_package_dir and repo_config_only with their argparse defaults, both of which run_tests() reads. Without them those tests fail, since #7004 made that directory collectable.

Test Plan

  • Unit tests for the output type, promotion, the publish helper, get-repo-params and the harness package mode. The publish and promotion tests drive a real LocalStorageBackend and assert the bytes on disk instead of mocking an S3 client. Two tests guard against the harness drifting from the package. One renders the package's own install manifest for every profile and stream and checks it contains every file the harness looks for. The other checks every stream the builder knows is reachable from exactly one build line.
  • End to end, in containers. Build the package for stable, rc and nightly on ubuntu2404, rhel8, rhel10 and sles16. Then run the harness in package mode against the live repositories, from a venv built only from packaging/linux/tests/requirements.txt. Also replay the stage job feat(ci): wire the amdrocm-repo package into native package CI #7280 will run (get-repo-params, build, publish) on each distro.
  • Full suite. CI unit tests on Linux and Windows, compared by test ID against the base branch's run.
  • Negative controls. Break each thing a new test guards, confirm the test fails, restore.
  • Lint. pre-commit.

Test Result

Check Result
Unit tests Pass. 408 tests across the six changed test modules (Windows skips 4 existing ELF tests).
End to end Harness: 12/12 pass. An earlier revision hardcoded the repo id amdrocm and failed 9/9 on ubuntu2404, rhel10 and sles16: dnf Unknown repo: 'amdrocm', zypper Repository 'amdrocm' not found, and on deb no amdrocm.sources. With the new jinja2 line removed, package mode fails with No module named 'jinja2'. Stage-job replay: 8/8, including the rc key fetch and a check of the live index. Both re-run after #7269's signing-key change.
Full suite Pass. 2758 passed and 9 skipped on Linux, 2696 passed and 71 skipped on Windows. Compared with the base branch, no test was removed, newly skipped or failing.
Negative controls Pass. A hardcoded repo id, a missing prerelease mapping, a module-level builder import in either script, a build folder chosen by stream name, and a key check that ignores signing each fail their tests.
Lint Pass.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@ScottTodd

Copy link
Copy Markdown
Member

No concerns for the build_tools/_therock_utils/workflow_outputs.py and related changes in this PR from me. Will let others more directly working on native linux packages review.

@ScottTodd
ScottTodd removed their request for review August 11, 2026 23:07
@nunnikri

Copy link
Copy Markdown
Contributor

Its a big change. need some time to review it.
on a quick look i think might need a change in build_tools/github_actions/publish_rocm_to_release_buckets.py to actually publish the package to release area

@arvindcheru

Copy link
Copy Markdown
Contributor

Hi @lsudarsh-amd, reviewers,
I Propose pulling the setup_gpg_key() rewrite (shell=True → list-form subprocess calls) and the APT_KEYRING_FILE path fix (hardcoded /etc/apt/keyrings/rocm.gpg → /etc/apt/keyrings/{REPO_NAME}.gpg) out of #7276 into their own PR. It's a pure sec/collision fix to existing stable code with zero functional coupling to the new amdrocm-repo feature — nothing in #7269 or #7280 references those two pieces.

Learnings:

To me, This PR bundles two independent changes:

  1. GPG/keyring fix (existing code) — setup_gpg_key() rewritten from a shell=True pipeline to list-form subprocess.run calls, plus APT_KEYRING_FILE's default path changed from /etc/apt/keyrings/rocm.gpg to /etc/apt/keyrings/{REPO_NAME}.gpg. This fixe looks to be helpful for analysis/fix different issue and a latent collision with the AMDGPU driver installer's keyring — both affect the harness's default, already-running code path.
  2. New amdrocm-repo bootstrap package feature — new storage layout, publish_repo_package.py, install-via-package mode, and supporting subcommands, all gated behind new opt-in flags (--repo-package-dir, --repo-config-only) that no existing caller sets.
    Why split:
    • No dependency between them — traced the call graph and confirmed the new feature's install_repo_package()/assert_repo_configured() never call setup_gpg_key() or reference APT_KEYRING_FILE; they use a separate, independently-named keyring constant (AMDROCM_DEB_KEYRING). Splitting introduces no functional risk.
    • Different risk/urgency profiles - The new feature is larger, and warrants its own focused review cycle.
    • Cleaner review and rollback — bundling them makes it harder to isolate a regression to one or the other if something breaks post-merge, and forces reviewers to context-switch between a security fix and a feature design.
    Proposed split: PR A = GPG/keyring rewrite + its dedicated tests (ConfiguredPathsTest, GPG-import test cases). PR B = everything else (new storage layout, publish_repo_package.py, package-mode install/verify, new get_url_repo_params.py subcommands, associated tests/docs).

Thanks

@arvindcheru arvindcheru left a comment •

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.

Request to Split the GPG Key Ring Changes (which modifies existing running workflow) from the new feature proposed. Refer the Comments in the PR for more details. Thanks.

@lsudarsh-amd

Copy link
Copy Markdown
Contributor Author

Its a big change. need some time to review it. on a quick look i think might need a change in build_tools/github_actions/publish_rocm_to_release_buckets.py to actually publish the package to release area

Thanks @nunnikri for starting to look at these changes. After your initial comment, I double checked the implementation, and no change should be needed in publish_rocm_to_release_buckets.py. I checked by running the copy, and the bootstrap package lands at v4/packages/deb/repo/ubuntu2404/amdrocm-repo.deb alongside pool/ and dists/.

It's carried because {run_id}-linux/packages/{pkg_type}/repo/{os_profile}/ sits inside the prefix that publish_native_linux_packages already copies at line 246. That copy is recursive on both backends, since S3 paginates with no Delimiter and the local backend uses rglob, and it preserves relative paths (storage_backend.py:126, :346, :494).

It stays out of the package index too, which is why it sits in repo/. The deb metadata is built from the locally uploaded files rather than by enumerating the prefix (upload_package_repo.py:355), and the rpm side lists only {prefix}/x86_64/repodata/. That matters because one amdrocm-repo is built per OS profile and they all share a package name.

I've added three tests to ensure proper coverage here. One drives the real promotion into a local backend, and two cover the S3 listing so a Delimiter or a dropped nested key fails instead of silently losing the package from every release.

@lsudarsh-amd

Copy link
Copy Markdown
Contributor Author

Request to Split the GPG Key Ring Changes (which modifies existing running workflow) from the new feature proposed. Refer the Comments in the PR for more details. Thanks.

Thanks for the review @arvindcheru. As requested, the keyring work is now #7332, which carries the setup_gpg_key() rewrite, the APT_KEYRING_FILE path change and their tests. This PR keeps the storage layout, the publish helper and the install-via-package mode. The keyring commits are out of it as of b4b4152, so its diff against main no longer touches any of that code.

Your call-graph trace was right. install_repo_package() and assert_repo_configured() never call setup_gpg_key() or read APT_KEYRING_FILE, and they use a separate constant (AMDROCM_DEB_KEYRING, native_linux_package_install_test.py:188). One case can't move with the rest. test_package_keyring_is_separate_from_the_harness_keyring asserts on AMDROCM_DEB_KEYRING, which doesn't exist on main, so it stays here, in a class renamed to PackageKeyringPathTest so it can't collide with the ConfiguredPathsTest that #7332 adds to the same module.

Isolating that code also turned up a bug, fixed and covered in #7332. The documented ROCM_APT_KEYRING_FILE override never worked, because only the signed-by= reference used it while the write target hardcoded rocm.gpg, so setting it makes apt update fail with "The repository is not signed". The fix also leaves APT_KEYRING_DIR with no reader, so #7332 removes it along with its docstring entry.

AMDROCM_DEB_KEYRING = "/usr/share/keyrings/amdrocm.gpg"
AMDROCM_RPM_REPO_BASENAME = "amdrocm.repo"
# Named -amdrocm, not -rocm, for the same collision reason as the deb
# keyring. Must match build_repo_package.RPM_GPG_KEY_PATH.

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.

Thank you for the updating the comments, Will review in detail.

Observation: native_linux_package_install_test.py hardcodes the GPG key paths as strings instead of importing them from build_repo_package.py, relying on a comment to keep them in sync. If the paths change there, this file won't notice.
Is it possible to import: Import DEB_KEYRING_PATH/RPM_GPG_KEY_PATH from build_repo_package.py instead — inspect_repo_package.py already does this, so it's a consistent, low-risk fix.

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.

I agree with you on the risk you outlined. Two spellings of one path kept in sync by a comment is the same bug #7332 fixes.

I can't make the fix in this PR though. build_repo_package.py is added by #7269, so the import would fail at collection on this branch. inspect_repo_package.py gets away with it because it lands in #7280, after #7269.

I'd rather make this change in #7280, which anyway depends on #7269 and already imports both constants.

lsudarsh-amd added a commit that referenced this pull request Aug 20, 2026
## Motivation

`native_linux_package_install_test.py` is an existing install test that
CI runs today. It downloads a repository signing key and saves it to
disk so apt can check package signatures. Three things are wrong with
how it does that, and all of them predate the `amdrocm-repo` work.

**The import could fail and still report success.** The key was fetched
with a single `shell=True` pipeline. A pipeline reports the exit status
of its last command, so `check=True` was only ever checking `tee`. If
the download returned something that wasn't a key, `gpg --dearmor`
failed, `tee` wrote an empty keyring anyway, and the harness printed
`[PASS]` and returned `True`. The run then failed much later on a
signature error that gave no hint where it came from. This isn't a
corner case. `gpg --dearmor` exits 2 on an empty body or on an HTML
error page served with a 200, which is a normal thing for a server to
return.

**The documented `ROCM_APT_KEYRING_FILE` override didn't work.** Only
the `signed-by=` line used it. The code that writes the key built its
own path and hardcoded `rocm.gpg`, so setting the variable saved the key
in one place and told apt to look in another. `apt update` then failed
with "The repository is not signed".

**The default path clashes with AMD's install instructions.** Those
instructions put the ROCm signing key at `/etc/apt/keyrings/rocm.gpg`,
and the harness writes over it with `sudo tee`. This doesn't happen in
CI, which runs in throwaway containers, but it does on the VMs and
workstations the script is also meant to run on.

Split out of #7276 because it changes existing code and doesn't depend
on the new `amdrocm-repo` feature.

Contributes to #6986.

## Technical Details

**The shell pipeline is gone.** The import now runs as three
`subprocess.run` calls, one each for `wget`, `gpg --dearmor` and `sudo
tee`. Each takes its arguments as a list and sets `check=True`, so a
failure stops the import there instead of leaving an empty keyring
behind. The URL and the keyring path are no longer interpolated into a
shell string, so neither can be used for injection.

**The keyring path comes from one constant.** `setup_gpg_key()` takes
both the file and its parent directory from `APT_KEYRING_FILE`. That
fixes the override, and it lets the default move to
`/etc/apt/keyrings/{REPO_NAME}.gpg`, the way `APT_SOURCES_LIST` already
works. The rename only works because of that. On its own it would have
written to `rocm.gpg` while telling apt to check `rocm-test.gpg`.
`APT_KEYRING_DIR` goes too, along with its docstring entry, since
nothing reads it any more and nothing in the repo sets it.

**Paths are `PurePosixPath`.** These are paths on the target Linux
filesystem, handed to `mkdir`, `tee` and `chmod`. `Path` follows the
local flavour and renders `\etc\apt\keyrings` on Windows, which fails
the `windows-2022` job.

**A timeout now returns `False`.** `subprocess.TimeoutExpired` is a
`SubprocessError`, so neither the `CalledProcessError` nor the `OSError`
handler caught it and a timeout killed the run instead of reporting a
failed import. That was already true, but splitting the pipeline takes
the timed calls in that block from two to four. Each carries
`GPG_KEY_TIMEOUT_SEC` of 60, so fetch, dearmor and write together can
take up to 180 seconds.

**The file runs in CI, but these lines don't.** Every change sits behind
`if self.gpg_key_url:` (`:543`, `:551`, `:763`), which covers both
`setup_gpg_key()` call sites, and neither caller passes a key URL.
`test_native_linux_packages_install.yml:227` wires `GPG_KEY_URL` from an
input (`:17`, `:62`, `:151`) nobody sets, and
`multi_arch_build_native_linux_packages.yml:138` runs `--test-type
simulate`, which skips repository setup.

## Test Plan

- **Unit tests.** Five new cases in `ConfiguredPathsTest`: the default
doesn't collide with `/etc/apt/keyrings/rocm.gpg`, it derives from
`REPO_NAME`, `APT_KEYRING_DIR` is gone, the write target matches what
`signed-by=` pins, and no call uses a shell. Two new cases in
`SetupGpgKeyTest` for the bad body and the timeout, plus the existing
sequence check tightened to compare two argv tokens instead of one.
- **End to end against a signed repo.** Build a real GPG-signed apt
repository in a container, serve it over localhost, and drive the
genuine `setup_deb_repository()`, which runs a real `apt update`. Run
the same scenarios against `main` to confirm each one fails there.
- **Full suite.** `pytest build_tools/` in the CI container against a
freshly measured `origin/main` baseline, comparing failure names rather
than counts.
- **Negative controls.** For every new assertion, break the code it
covers, confirm the test fails, then restore.
- **Lint.** `pre-commit` over the changed files.

## Test Result

| Check | Result |
|---|---|
| Unit tests | Pass. 125 in the module, including the 7 new cases. |
| End to end against a signed repo | Pass, 12/12. The same suite scores
6/12 on `main`. |
| Full suite | **No new failures.** 9 failed / 1761 passed against 9
failed / 1754 on `main`. Identical failure names. |
| Negative controls | Pass. Six, each failing only the test it targets.
|
| Lint | Pass. |

The six checks `main` fails are exactly the ones this fixes. It
overwrites `/etc/apt/keyrings/rocm.gpg`, ignores the
`ROCM_APT_KEYRING_FILE` override, and reports success on a body that
isn't a key while leaving an empty keyring behind. The override case is
the sharpest. There, `apt update` exits 100 with "The repository is not
signed", so `main` doesn't just misplace the key, it breaks apt in a
plain container.

The nine pre-existing failures are in
`compute_rocm_package_version_test.py`, `jax_install_scripts_test.py`
and `stage_reuse_decision_test.py`, none of which this touches.

**Not covered.** `PurePosixPath` can't be exercised on Linux. `Unit
Tests :: windows-2022` covers it and passed on #7276 with this same
code. The timeout is covered by unit test rather than end to end, since
`GPG_KEY_TIMEOUT_SEC` is 60 and isn't overridable.

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
Derives the publish destination from WorkflowOutputRoot and writes
through StorageBackend rather than taking a bucket and prefix and
driving boto3 directly. The new output type sits beside the content
repository rather than inside it: one package is built per OS profile
and several share a filename, so indexing them together would collide.

Also adds the URL helpers the workflow invokes and an install-harness
mode that configures the repository by installing the built package.
@lsudarsh-amd
lsudarsh-amd force-pushed the shared/amdrocm-repo-publish branch from b4b4152 to 2d60e4e Compare August 28, 2026 16:26
The workflow needs three values to build amdrocm-repo: which stream a
build line configures, that stream's packages base, and its signing key
URL. Add a single table carrying all three, replacing the base-URL-only
map that pointed at the retired packages-multi-arch hosts.

The mapping is deliberately not s3_buckets.get_release_stream(). That
answers which product bucket a build publishes into, and its answers do
not transfer here: it maps prerelease to rc, which serves no content on
any distro, and it raises on release, because stable is promoted
manually and has no artifacts bucket -- yet stable is the stream users
install from. release_type stays the workflow input because it also
selects bucket credentials; the stream is derived from it.

The key URL is emitted whole rather than as a root for the builder to
append to, so where the key lives stays a fact recorded here.

Also fix three promotion tests that pinned v4/packages/ as the
destination. That prefix moved to v5/rocm/core/packages/, which turned
them red without the code under test changing. They now discover the
destination from what the promotion actually wrote and assert only the
tail, since what they exist to prove is that the copy is recursive
enough to carry repo/<profile>/ -- not where the release lands.
@dbieleck

Copy link
Copy Markdown

Please review.

@arvindcheru arvindcheru left a comment

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.

LGTM,

Please resolve the Merge conflicts, and wait for CI tests
Approve #7276: Based on GPG split is done (#7332), promotion is covered by tests, scope is publish helper + workflow outputs + URL helpers + opt-in install mode — LGTM to merge after #7269 (and before #7280.)

Since there are multiple PR dependency Kindly wait for other review input also before proceeding to merge.

@ScottTodd
ScottTodd removed their request for review September 15, 2026 17:02
The install harness looked for a repo called "amdrocm", but the package
registers amdrocm-<stream>, so rpm refreshes and deb checks failed on
every stream. It now reads the repo id, file names and key paths from
build_repo_package instead of hardcoding them.

Also:
- map the prerelease line to the rc stream
- replace the three repo-param subcommands with one get-repo-params
- add jinja2 to the harness test requirements
- tidy comments and docstrings
@lsudarsh-amd
lsudarsh-amd changed the base branch from main to shared/amdrocm-repo-package September 30, 2026 19:10
@lsudarsh-amd
lsudarsh-amd added this pull request to stack #8646 September 30, 2026 19:12
…ublish

# Conflicts:
#	docs/development/workflow_outputs.md
@lsudarsh-amd

Copy link
Copy Markdown
Contributor Author

LGTM,

Please resolve the Merge conflicts, and wait for CI tests Approve #7276: Based on GPG split is done (#7332), promotion is covered by tests, scope is publish helper + workflow outputs + URL helpers + opt-in install mode — LGTM to merge after #7269 (and before #7280.)

Since there are multiple PR dependency Kindly wait for other review input also before proceeding to merge.

@arvindcheru Thanks for the earlier approval. I've made some changes since then, could you please take another look?

@nunnikri Could you please review this too?

Changes since last review:

  • Fixed the install harness, which was looking for the wrong repo name. It now reads the names and key paths from build_repo_package.
  • prerelease now maps to the rc stream.
  • Replaced the three repo-param subcommands with a single get-repo-params call.
  • Added jinja2 to the harness test requirements.
  • This PR now builds on feat(packaging): add amdrocm-repo package for ROCm repository setup #7269's branch.

The remaining red checks on CI aren't from this PR.

@arvindcheru arvindcheru left a comment

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.

PR #7276 re-review (tip 459dcbb)
LGTM,

Please Confirm REPO_PACKAGE_DIR / REPO_CONFIG_ONLY stays out of install CI.

@lsudarsh-amd

lsudarsh-amd commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

PR #7276 re-review (tip 459dcbb) LGTM,

Please Confirm REPO_PACKAGE_DIR / REPO_CONFIG_ONLY stays out of install CI.

@arvindcheru Thanks for checking.

No workflow sets REPO_PACKAGE_DIR or REPO_CONFIG_ONLY, and the install jobs on 459dcbb used the normal repo setup. If one were ever set on a PR job, the harness would exit with an error.

About the error you hit. Those variables are only read under pytest, which is how CI runs the harness. Running the script directly needs --repo-package-dir instead.

With package mode on (stable, rc and nightly on all four distros), repo setup, ROCm install and the basic checks pass. The uninstall test after that fails, because it counts the amdrocm-repo package as leftover ROCm. I've noted it for the follow-up that turns this mode on in CI.

Here are the steps to test on your end if you'd like:

docker run --rm -it -v "$PWD:/src:ro" -w /src ghcr.io/rocm/no_rocm_image_ubuntu24_04:latest bash

Then inside the container, run these steps

bash build_tools/packaging/linux/setup_repo_build_deps.sh --os-profile ubuntu2404

eval "$(bash build_tools/packaging/linux/setup_python_cmd.sh --os-profile ubuntu2404 --install-runtime --output-format env)"

$PYTHON_CMD -m venv /tmp/venv && . /tmp/venv/bin/activate

pip install -r build_tools/packaging/linux/tests/requirements.txt

# Build the rc repo package
python build_tools/packaging/linux/build_repo_package.py --os-profile ubuntu2404 --stream rc --rocm-version 10.0.0 \
    --repo-base-url https://rc.repo.amd.com/rocm/core/packages \
    --gpg-key-url https://rc.repo.amd.com/rocm/gpg/packages.gpg --dest-dir /tmp/pkg

# Package mode, run directly...
python build_tools/packaging/linux/native_linux_package_install_test.py \
    --os-profile ubuntu2404 --release-type prerelease --repo-package-dir /tmp/pkg --repo-config-only

# ...or the way CI runs it
OS_PROFILE=ubuntu2404 RELEASE_TYPE=prerelease REPO_PACKAGE_DIR=/tmp/pkg REPO_CONFIG_ONLY=1 \
    python -m pytest build_tools/packaging/linux/native_linux_package_install_test.py -s

To install ROCm as well (a few GB), swap --repo-config-only for --test-type install. For rhel8, rhel10 or sles16, swap --os-profile and the image: registry.access.redhat.com/ubi8/ubi:8.10, registry.access.redhat.com/ubi10/ubi:10.1 or registry.suse.com/bci/bci-base:16.0.

Here are the logs from my test run:
7276-package-mode-logs.zip

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

5 participants