ci: prerelease release builds use local ccache only (no remote reads) (#7249) - #7531
Merged
Merged
Conversation
…#7249) Cherry-picks commit 9273e0c into the ROCm 10.0 release branch. --- ## Motivation Stable releases are a repackage of the **prerelease** release-candidate build, so the prerelease compile is what actually ships. Those objects should never come from a **remote** cache hit to eliminate cache poisoning risks. * Background: #7248 * Design discussion: #7259 ## Technical Details Prerelease builds use the **local cache only** (remote disabled): zero remote hits, but the local cache still works normally (reads + writes). - `build_tools/setup_ccache.py`: now maps `nightly-bkc` and `prerelease` values of `--release-type` to `--config-preset=local` ### Why local-only (not recache or full-disable) - **Keep the local cache**: local hits are fine, and some builds (notably Windows) need at least a local cache for performance and runner stability - without one we have seen runners exhaust resources and fail. - `recache` was rejected: it forces *local* misses too, defeating the local cache Windows needs. - Full-disable was rejected: it removes the local cache and changes build-config parity with nightly/CI. ## Test Plan - `build_tools/tests/setup_ccache_test.py` (new): pins which release types read the shared remote cache and which are local-only, plus both failure modes above. - Local: run the tool as each workflow does for `ci` / `dev` / `nightly` / `prerelease` and compare the emitted config. - Owner dispatch: a `prerelease` run shows zero remote hits (local hits fine) in each stage's "Report" step and still builds artifacts; a `dev` / `nightly` run is unchanged. ## Test Result CI on this branch, all 9 new tests passing on both platforms: | Check | Result | | --- | --- | | [Unit Tests :: ubuntu-24.04](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731944) | pass - 9/9 `setup_ccache_test.py` | | [Unit Tests :: windows-2022](https://github.com/ROCm/TheRock/actions/runs/32395965820/job/96512731634) | pass - 9/9 `setup_ccache_test.py` | | [pre-commit](https://github.com/ROCm/TheRock/actions/runs/32395965889/job/96512732019) | pass (black, mdformat, actionlint) | Windows coverage matters here, not just for parity: `IS_WINDOWS` selects a different `compiler_check` mode, and Windows is the platform whose local-cache requirement is the reason this is local-only rather than a full disable. `Cache mode` output from running the tool exactly as each workflow invokes it - only `prerelease` loses the remote, and it keeps its local cache: ```text [setup_ccache] Cache mode: release_type=ci preset=github-oss-dev remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50 local=/tmp/ccache/ci/cache [setup_ccache] Cache mode: release_type=dev preset=github-oss-dev remote=http://bazelremote-svc.bazelremote-ns...:8080|layout=bazel|connect-timeout=50 local=/tmp/ccache/dev/cache [setup_ccache] Cache mode: release_type=nightly preset=github-oss-release remote=http://bazelremote-svc-rel.bazelremote-ns...:8080|layout=bazel|connect-timeout=50 local=/tmp/ccache/nightly/cache [setup_ccache] Cache mode: release_type=prerelease preset=github-oss-release remote=disabled (--no-remote-cache) local=/tmp/ccache/prerelease/cache ``` ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md. --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Scott Todd <Scott.Todd@amd.com>
ScottTodd
approved these changes
Aug 20, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-picks commit 9273e0c into the ROCm 10.0 release branch.
Motivation
Stable releases are a repackage of the prerelease release-candidate build, so the prerelease compile is what actually ships. Those objects should never come from a remote cache hit to eliminate cache poisoning risks.
Technical Details
Prerelease builds use the local cache only (remote disabled): zero remote hits, but the local cache still works normally (reads + writes).
build_tools/setup_ccache.py: now mapsnightly-bkcandprereleasevalues of--release-typeto--config-preset=localWhy local-only (not recache or full-disable)
recachewas rejected: it forces local misses too, defeating the local cache Windows needs.Test Plan
build_tools/tests/setup_ccache_test.py(new): pins which release types read the shared remote cache and which are local-only, plus both failure modes above.ci/dev/nightly/prereleaseand compare the emitted config.prereleaserun shows zero remote hits (local hits fine) in each stage's "Report" step and still builds artifacts; adev/nightlyrun is unchanged.Test Result
CI on this branch, all 9 new tests passing on both platforms:
setup_ccache_test.pysetup_ccache_test.py|
pre-commit | pass (black, mdformat, actionlint) |
Windows coverage matters here, not just for parity:
IS_WINDOWSselects a differentcompiler_checkmode, and Windows is the platform whose local-cache requirement is the reason this is local-only rather than a full disable.Cache modeoutput from running the tool exactly as each workflow invokes it - onlyprereleaseloses the remote, and it keeps its local cache:Submission Checklist