Skip to content

Commit b012ca9

Browse files
committed
feat: enable asan build in quartz
1 parent 3860df0 commit b012ca9

9 files changed

Lines changed: 783 additions & 183 deletions

‎docs/status-json/README.md‎

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,17 @@ For example, to know if ROCm built successfully, check
4343
The tree uses a handful of terms that recur throughout this guide and map
4444
directly to keys in the document:
4545

46-
| Term | Meaning |
47-
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
48-
| **TheRock** | The build system that produces ROCm releases. Its CI is what Quartz reports on. |
49-
| **nightly** | An automatic build produced once a day. |
50-
| **nightly-bkc** | A nightly build, cut from a `release/bkc/...` branch |
51-
| **prerelease** (`rc`) | A release candidate build for an upcoming ROCm release. |
52-
| **architecture** | A GPU target, for example `gfx942` or `gfx1201` (the same identifiers ROCm uses). |
53-
| **pipeline** | One product built from a release: `rocm` (the ROCm stack itself), `pytorch`, `jax`, and `native_packages`. A release can produce several. |
54-
| **phase** | A stage of a pipeline: `build` and `test`. For `native_packages`, `rpm` or `deb` instead. |
55-
| **variant** | For PyTorch/JAX, one cell of the version matrix (for example Python 3.12 with a given Torch branch). Relevant only to consumers of PyTorch/JAX detail. |
46+
| Term | Meaning |
47+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48+
| **TheRock** | The build system that produces ROCm releases. Its CI is what Quartz reports on. |
49+
| **nightly** | An automatic build produced once a day. |
50+
| **nightly-bkc** | A nightly build, cut from a `release/bkc/...` branch |
51+
| **prerelease** (`rc`) | A release candidate build for an upcoming ROCm release. |
52+
| **architecture** | A GPU target, for example `gfx942` or `gfx1201` (the same identifiers ROCm uses). |
53+
| **pipeline** | One product built from a release: `rocm` (the ROCm stack itself), `pytorch`, `jax`, and `native_packages`. A release can produce several. |
54+
| **phase** | A stage of a pipeline: `build` and `test`. For `native_packages`, `rpm` or `deb` instead. |
55+
| **build variant** | The release flavor, such as `release`, `asan`, or `asan-debug`. It selects the document: `status.json` for `release`, `status-asan.json` for either ASAN flavor. |
56+
| **variant** | For PyTorch/JAX, one cell of the version matrix (for example Python 3.12 with a given Torch branch). Relevant only to consumers of PyTorch/JAX detail. |
5657

5758
Not every pipeline runs on every platform, and `native_packages` is a special
5859
case with no `build` / `test` phases:
@@ -70,36 +71,50 @@ below.
7071

7172
## Endpoints
7273

73-
Quartz publishes one `status.json` per release build (nightly/nightly-bkc/prerelease), plus stable pointers to the
74-
most recent builds.
75-
76-
| Endpoint | Points to |
77-
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
78-
| `nightly/<date>/status.json` | A specific nightly, for example `nightly/20260707/status.json` |
79-
| `nightly/latest.json` | The most recent nightly (any result, including still in progress) |
80-
| `nightly/latest_good.json` | The most recent fully-passing nightly |
81-
| `nightly-bkc/<nightly-version>/<bkc-date>/status.json` | A specific bkc nightly, for example `nightly-bkc/10.1.0a20260825/20260831/status.json` |
82-
| `nightly-bkc/<nightly-version>/latest.json` | The most recent bkc nightly for that nightly version (any result, including still in progress) |
83-
| `nightly-bkc/<nightly-version>/latest_good.json` | The most recent fully-passing bkc nightly for that nightly version |
84-
| `nightly-bkc/latest.json` | The most recent build of the highest bkc nightly version (by version number, not build date) |
85-
| `nightly-bkc/latest_good.json` | The highest-versioned fully-passing bkc build (may trail `latest.json` when the highest nightly version is not green) |
86-
| `prerelease/<major.minor>/<full>/status.json` | A specific prerelease, for example `prerelease/7.14/7.14.0rc1/status.json` |
87-
| `prerelease/latest.json` | The highest-versioned prerelease across all release lines (by version number, not build date) |
88-
| `prerelease/<major.minor>/latest.json` | The highest-versioned prerelease in one release line, e.g. `prerelease/7.14/latest.json` |
74+
Quartz publishes one document per build-variant family, all sharing the same
75+
schema. The normal release build gets the unsuffixed `status.json`; ASAN builds
76+
get `status-asan.json`. The suffix follows TheRock's own `build_variant_suffix`,
77+
which folds the debug flavor onto its base family, so both `asan` and
78+
`asan-debug` publish to `status-asan.json` and the document's `build_variant`
79+
field says which flavor produced it. Each family carries its own stable pointers,
80+
so consumers can follow one without a build of the other ever moving it.
81+
82+
Below, `<v>` stands for that suffix: empty for the release build, `-asan` for the
83+
ASAN family. So `status<v>.json` is either `status.json` or `status-asan.json`.
84+
85+
| Endpoint | Points to |
86+
| --------------------------------------------------------- | ------------------------------------------------------------------------------- |
87+
| `nightly/<date>/status<v>.json` | A specific nightly build of that variant |
88+
| `nightly/latest<v>.json` | The most recent build of that variant (including still in progress) |
89+
| `nightly/latest_good<v>.json` | The most recent fully-passing build of that variant |
90+
| `nightly-bkc/<nightly-version>/<bkc-date>/status<v>.json` | A specific BKC nightly build of that variant |
91+
| `nightly-bkc/<nightly-version>/latest<v>.json` | The most recent BKC build of that variant for the nightly version |
92+
| `nightly-bkc/<nightly-version>/latest_good<v>.json` | The most recent fully-passing BKC build of that variant for the nightly version |
93+
| `nightly-bkc/latest<v>.json` | The most recent build of that variant for the highest BKC nightly version |
94+
| `nightly-bkc/latest_good<v>.json` | The highest-versioned fully-passing BKC build of that variant |
95+
| `prerelease/<major.minor>/<full>/status<v>.json` | A specific prerelease build of that variant |
96+
| `prerelease/latest<v>.json` | The highest-versioned prerelease of that variant across all release lines |
97+
| `prerelease/<major.minor>/latest<v>.json` | The highest-versioned prerelease of that variant in one release line |
98+
99+
> **The sanitizer endpoints are not published yet.** TheRock's
100+
> `multi_arch_release_asan.yml` does not report to Quartz, so an `asan` or
101+
> `asan-debug` document written today could never be finalized. Quartz routes and
102+
> tests these files but withholds them until that orchestrator is instrumented;
103+
> expect them to be absent until then.
89104
90105
Each is served as raw content. The raw URL form is:
91106

92107
```text
93108
https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json
94109
```
95110

96-
> **Note on the pointer files:** Every `latest.json` and `latest_good.json` pointer
97-
> is a git symlink to the dated `status.json` it currently points at. Raw GitHub
98-
> serves a symlink as its target path (a one-line body like `20260707/status.json`),
99-
> not the file it points to, so a plain fetch returns that path rather than JSON. The
100-
> Python helper `load_status` follows this pointer for you transparently; if you
101-
> fetch it yourself, resolve the returned path against the pointer URL and fetch
102-
> again.
111+
> **Note on the pointer files:** Every `latest*.json` and `latest_good*.json`
112+
> pointer is a git symlink to the concrete `status*.json` it currently points
113+
> at. Raw GitHub serves a symlink as its target path (a one-line body like
114+
> `20260707/status-asan.json`), not the file it points to, so a plain fetch
115+
> returns that path rather than JSON. The Python helper `load_status` follows
116+
> this pointer for you transparently; if you fetch it yourself, resolve the
117+
> returned path against the pointer URL and fetch again.
103118
104119
> **Note on `latest_good.json`:** "Fully passing" means the build's
105120
> `summary.overall_status` is `success` (a worst-of rollup, so this implies the
@@ -108,9 +123,10 @@ https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json
108123
> regresses to an in-progress or failed build. Because it points at the live
109124
> document rather than a copy of it, a build can stop being green after the
110125
> pointer was written (a re-run re-opens it, or a late leaf fails it); the pointer
111-
> is then withdrawn until some build is green again, so treat a missing
112-
> `latest_good.json` as "nothing good to offer right now". Prerelease has no
113-
> `latest_good.json` pointer yet.
126+
> then falls back to the newest build of that variant still passing, and is
127+
> dropped entirely when none is left, so treat a missing pointer as "nothing good
128+
> to offer right now". Prerelease has no `latest_good.json` pointer yet, for
129+
> either build flavor.
114130
115131
> These endpoints go live as TheRock release workflows are instrumented to report
116132
> to Quartz. Until a given release type is instrumented, its files may be absent.

‎docs/status-json/status_json_reference.jsonc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Reference layout for status.json v2.
1+
// Reference layout for status.json and status-asan.json v2.
22
// NOTE: This file is a human-readable spec and contains `//` comments. The
33
// real status.json emitted by Quartz is strict JSON with comments stripped.
44
//
@@ -23,7 +23,7 @@
2323
"release_type": "nightly", // "nightly" | "rc" | "dev"
2424
"rocm_version": "7.13.0a20260408",
2525
"build_date": "20260408", // the date this build is filed under; for nightly-bkc it is the bkc run date from the version's `+bkc.<date>` suffix, not the nightly date the build was cut from
26-
"build_variant": "release", // (schema 2.1) build flavor: "release" | "asan" | ... ; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents
26+
"build_variant": "release", // (schema 2.1) build flavor: "release" | "asan" | "asan-debug" | ... ; in status-asan.json this is the one field distinguishing the ASAN flavors; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents
2727
"therock_commit": "db2fd412ed7fcadf306cdcf19f09cdd998544197", // (schema 2.1) 40-hex TheRock commit the release was built from; "" until the setup run resolves it; key absent entirely in pre-2.1 documents
2828
"trigger_workflow_run_id": 12340000, // run_id of the orchestrator (multi_arch_ci)
2929
"trigger_run_attempt": 1, // attempt of the owning orchestrator run; ownership is the (trigger_workflow_run_id, trigger_run_attempt) pair, so a GitHub re-run (same run id, higher attempt) supersedes the run before it

‎scripts/receive_therock/tests/therock_classify_test.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from therock_classify import (
1515
classify,
1616
derive_architectures,
17+
derive_build_variant,
1718
derive_deb_urls,
1819
derive_effective_owner_run_id,
1920
derive_platform_and_pipeline,
@@ -763,6 +764,11 @@ def test_top_level_orchestrator_is_self(self):
763764
run.workflow_run_id = 29079513704
764765
self.assertEqual(derive_effective_owner_run_id(run), 29079513704)
765766

767+
def test_top_level_asan_orchestrator_is_self(self):
768+
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
769+
run.workflow_run_id = 29079513705
770+
self.assertEqual(derive_effective_owner_run_id(run), 29079513705)
771+
766772
def test_descendant_uses_quartz_tracking_id(self):
767773
# Every triggered workflow carries the top-level owner in the propagated
768774
# id, regardless of its immediate GitHub parent.
@@ -799,6 +805,29 @@ def test_empty_quartz_tracking_id_returns_none(self):
799805
self.assertIsNone(derive_effective_owner_run_id(run))
800806

801807

808+
class DeriveBuildVariantTest(unittest.TestCase):
809+
def test_direct_input_wins_over_tracking_id(self):
810+
run = _leaf_run()
811+
run.inputs = {
812+
"build_variant": "asan-debug",
813+
"quartz_tracking_id": "123;nightly;asan",
814+
}
815+
self.assertEqual(derive_build_variant(run), "asan-debug")
816+
817+
def test_tracking_id_supplies_descendant_variant(self):
818+
run = _leaf_run()
819+
run.inputs = {"quartz_tracking_id": "123;nightly;asan"}
820+
self.assertEqual(derive_build_variant(run), "asan")
821+
822+
def test_asan_orchestrator_carries_no_variant_of_its_own(self):
823+
# multi_arch_release_asan.yml takes no `build_variant` input and does not
824+
# carry the tracking id it generates. Guessing a flavor here would stamp
825+
# the document wrong (it dispatches "asan-debug", not "asan"), so the
826+
# variant stays empty and the setup run supplies it.
827+
run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml")
828+
self.assertEqual(derive_build_variant(run), "")
829+
830+
802831
class ClassifyOwnerNormalizationOrderingTest(unittest.TestCase):
803832
"""`classify()` must normalize the owner AFTER deriving source_run_id.
804833

‎scripts/receive_therock/tests/therock_types_test.py‎

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,43 @@ def test_run_from_dict_release_type_resolution(raw: dict, expected: str | None)
249249
@pytest.mark.parametrize(
250250
"value,expected",
251251
[
252-
({}, (None, None)),
253-
({"quartz_tracking_id": ""}, (None, None)),
254-
({"quartz_tracking_id": "123;nightly"}, (123, "nightly")),
255-
({"quartz_tracking_id": "123"}, (123, None)),
256-
({"quartz_tracking_id": "123;"}, (123, None)),
252+
({}, (None, None, None)),
253+
({"quartz_tracking_id": ""}, (None, None, None)),
254+
({"quartz_tracking_id": "123;nightly"}, (123, "nightly", None)),
255+
(
256+
{"quartz_tracking_id": "123;nightly;asan"},
257+
(123, "nightly", "asan"),
258+
),
259+
({"quartz_tracking_id": "123"}, (123, None, None)),
260+
({"quartz_tracking_id": "123;"}, (123, None, None)),
257261
],
258262
)
259263
def test_parse_quartz_tracking_id(value: dict, expected: tuple) -> None:
260264
assert parse_quartz_tracking_id(value) == expected
261265

262266

263267
@pytest.mark.parametrize("value", ["123abc;nightly", ";nightly"])
264-
def test_parse_quartz_tracking_id_malformed_run_id_raises(value: str) -> None:
268+
def test_parse_quartz_tracking_id_non_numeric_run_id_raises(value: str) -> None:
265269
with pytest.raises(ValueError):
266270
parse_quartz_tracking_id({"quartz_tracking_id": value})
267271

268272

273+
def test_parse_quartz_tracking_id_surplus_fields_warn_instead_of_raising(
274+
caplog: pytest.LogCaptureFixture,
275+
) -> None:
276+
# A producer emitting more than three fields is a format bug, but it must not
277+
# take down the ingest: warn, and leave the surplus on the build variant so it
278+
# stays unrecognized and the run is skipped rather than misrouted.
279+
with caplog.at_level(logging.WARNING):
280+
parsed = parse_quartz_tracking_id(
281+
{"quartz_tracking_id": "123;nightly;asan;surplus"}
282+
)
283+
assert parsed == (123, "nightly", "asan;surplus")
284+
assert any(
285+
"more than the expected three fields" in r.message for r in caplog.records
286+
)
287+
288+
269289
def test_run_from_dict_rocm_version_precedence() -> None:
270290
# inputs.rocm_version wins over rocm_package_version.
271291
wr = WorkflowRunRecord.from_dict(

0 commit comments

Comments
 (0)