Skip to content

[CI] Upload test run reports to S3 - #199838

Draft
georgehong wants to merge 2 commits into
gh/georgehong/7/basefrom
gh/georgehong/7/head
Draft

georgehong wants to merge 2 commits into
gh/georgehong/7/basefrom
gh/georgehong/7/head

Conversation

@georgehong

@georgehong georgehong commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Zips test/test-run-reports into its own test-run-reports-.zip at job
end and uploads it to gha-artifacts, falling back to a GitHub artifact (copied
to S3 afterwards) when S3 is skipped or fails. It's kept apart from the junit
zips, so their readers and layouts are unchanged, and it does nothing when the
folder is missing. XPU jobs copy the folder out of their container with
test/test-reports.

Test Plan:

python -c "import yaml; yaml.safe_load(open('.github/actions/upload-test-artifacts/action.yml'))"
spin lint

The action's ZIP_CMD on a sample tree gives
test/test-run-reports//-.jsonl and leaves out
test/junit_xml_testdata. Not run on CI yet; _linux-test.yml uses this action
from @main.

Authored with the help of an AI assistant (Claude).

[ghstack-poisoned]
@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 5, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199838

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 84a39ec with merge base 4f0d8e2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
georgehong added a commit that referenced this pull request Oct 5, 2026
Zips test/test-run-reports into its own test-run-reports-<suffix>.zip at job
end and uploads it to gha-artifacts, falling back to a GitHub artifact (copied
to S3 afterwards) when S3 is skipped or fails. It's kept apart from the junit
zips, so their readers and layouts are unchanged, and it does nothing when the
folder is missing. XPU jobs copy the folder out of their container with
test/test-reports.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/actions/upload-test-artifacts/action.yml'))"
spin lint
```

The action's ZIP_CMD on a sample tree gives
test/test-run-reports/<file>/<file>-<id>.jsonl and leaves out
test/junit_xml_testdata. Not run on CI yet; _linux-test.yml uses this action
from main.

Authored with the help of an AI assistant (Claude).

ghstack-source-id: ffa1f00
Pull-Request: #199838
@georgehong georgehong added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 5, 2026
georgehong added a commit that referenced this pull request Oct 5, 2026
Only for checking #199838 on Linux: _linux-test.yml takes upload-test-artifacts
from main (a full path, since local actions fail in its container jobs), so a
PR's Linux jobs never run that PR's copy of the action. Pointing it at
#199838's ghstack branch makes this PR's Linux jobs zip and upload
test-run-reports-<suffix>.zip to S3. Close this PR after checking; it is not
meant to land.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/workflows/_linux-test.yml'))"
spin lint
```

Authored with the help of an AI assistant (Claude).

ghstack-source-id: e0258dc
Pull-Request: #199844
georgehong added a commit that referenced this pull request Oct 6, 2026
Zips test/test-run-reports into its own test-run-reports-<suffix>.zip at job
end and uploads it to gha-artifacts, falling back to a GitHub artifact (copied
to S3 afterwards) when S3 is skipped or fails. It's kept apart from the junit
zips, so their readers and layouts are unchanged, and it does nothing when the
folder is missing. XPU jobs copy the folder out of their container with
test/test-reports.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/actions/upload-test-artifacts/action.yml'))"
spin lint
```

The action's ZIP_CMD on a sample tree gives
test/test-run-reports/<file>/<file>-<id>.jsonl and leaves out
test/junit_xml_testdata. Not run on CI yet; _linux-test.yml uses this action
from main.

Authored with the help of an AI assistant (Claude).

ghstack-source-id: ffa1f00
Pull-Request: #199838
georgehong added a commit that referenced this pull request Oct 6, 2026
Only for checking #199838 on Linux: _linux-test.yml takes upload-test-artifacts
from main (a full path, since local actions fail in its container jobs), so a
PR's Linux jobs never run that PR's copy of the action. Pointing it at
#199838's ghstack branch makes this PR's Linux jobs zip and upload
test-run-reports-<suffix>.zip to S3. Close this PR after checking; it is not
meant to land.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/workflows/_linux-test.yml'))"
spin lint
```

Authored with the help of an AI assistant (Claude).

ghstack-source-id: 470b906
Pull-Request: #199844
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables.

TEST_RUN_REPORTS_MODE gates it: off (the default), dry (count what each
statement would insert, write nothing), or on; the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO before switching it on: update the replicator's ClickHouse grants if
needed. It must be able to INSERT into the four tables and SELECT from tests,
environments and flags; check SHOW GRANTS for its user, and grant by hand
(or with the fortesting migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables.

TEST_RUN_REPORTS_MODE gates it: off (the default), dry (count what each
statement would insert, write nothing), or on; the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO before switching it on: update the replicator's ClickHouse grants if
needed. It must be able to INSERT into the four tables and SELECT from tests,
environments and flags; check SHOW GRANTS for its user, and grant by hand
(or with the fortesting migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables. Until the reports carry
their uuid, runs.report_uuid is taken from each report's file name.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables. Until the reports carry
their uuid, runs.report_uuid is taken from each report's file name.
runs' ids are the catalogs' own id DEFAULTs, read from system.columns at
ingest, so the lambda holds no id logic; language comes from each run line.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables. Until the reports carry
their uuid, runs.report_uuid is taken from each report's file name.
runs' ids are the catalogs' own id DEFAULTs, read from system.columns at
ingest, so the lambda holds no id logic; language comes from each run line.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 6, 2026
Each pytorch test job uploads one zip of JSONL test run reports when it ends,
as test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route those
keys to a new adapter that has ClickHouse read the zip and insert into the
fortesting.{tests,environments,flags,runs} tables. Until the reports carry
their uuid, runs.report_uuid is taken from each report's file name.
runs' ids are the catalogs' own id DEFAULTs, read from system.columns at
ingest, so the lambda holds no id logic; language comes from each run line.

TEST_RUN_REPORTS_MODE gates it: off, dry (count what each statement would
insert, write nothing), or on (the default, while only the DNM
pytorch/pytorch#199844 uploads these zips); the function's environment can
override it. The S3 notification for the zips is a separate pytorch-gha-infra
change.

TODO: update the replicator's ClickHouse grants if needed; until then its
inserts fail and are logged to errors.gen_errors. It must be able to INSERT
into the four tables and SELECT from tests, environments and flags; check
SHOW GRANTS for its user, and grant by hand (or with the fortesting
migrations) what is missing.

Authored with the help of an AI assistant (Claude).
georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 7, 2026
**Summary**
In our E2E test for new test report generation, each pytorch test job
uploads one zip of JSONL test run reports when it ends, as
test-run-reports-<suffix>.report.zip (pytorch/pytorch#199838). Route
those keys to a new adapter that has ClickHouse read the zip and insert
into the fortesting.{tests,environments,flags,runs} tables, completing
the loop of CI --> S3 --> ClickHouse.

`TEST_RUN_REPORTS_MODE` gates it: off (the default), dry (count what
each statement would insert, write nothing), or on; the function's
environment can override it. The S3 notification for the zips is a
separate pytorch-gha-infra change at
metainternal/pytorch-gha-infra#1567.

**Motivation**
This allows us to check the ClickHouse insert query performance and how
long lambdas will roughly take, which could affect proximity to the
concurrency limit.

Authored with the help of an AI assistant (Claude).
georgehong added a commit that referenced this pull request Oct 7, 2026
Zips test/test-run-reports into its own test-run-reports-<suffix>.zip at job
end and uploads it to gha-artifacts, falling back to a GitHub artifact (copied
to S3 afterwards) when S3 is skipped or fails. It's kept apart from the junit
zips, so their readers and layouts are unchanged, and it does nothing when the
folder is missing. XPU jobs copy the folder out of their container with
test/test-reports.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/actions/upload-test-artifacts/action.yml'))"
spin lint
```

The action's ZIP_CMD on a sample tree gives
test/test-run-reports/<file>/<file>-<id>.jsonl and leaves out
test/junit_xml_testdata. Not run on CI yet; _linux-test.yml uses this action
from main.

Authored with the help of an AI assistant (Claude).

ghstack-source-id: ffa1f00
Pull-Request: #199838
georgehong added a commit that referenced this pull request Oct 7, 2026
Only for checking #199838 on Linux: _linux-test.yml takes upload-test-artifacts
from main (a full path, since local actions fail in its container jobs), so a
PR's Linux jobs never run that PR's copy of the action. Pointing it at
#199838's ghstack branch makes this PR's Linux jobs zip and upload
test-run-reports-<suffix>.zip to S3. Close this PR after checking; it is not
meant to land.

Test Plan:

```
python -c "import yaml; yaml.safe_load(open('.github/workflows/_linux-test.yml'))"
spin lint
```

Authored with the help of an AI assistant (Claude).

ghstack-source-id: 3fb0f4f
Pull-Request: #199844

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

ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant