Skip to content

Commit 558b3e8

Browse files
committed
Update the architecture doc for the log upload path
## What Rewrites the "Logs and log classifications" section to describe the new path (bot handler -> gha-log-uploader -> S3 -> call-log-classifier -> log_classifier) and notes that the raw webhook payload archive goes away with `github-status-test`. ghstack-source-id: d15fe77 Pull-Request: #8597
1 parent 1fac07e commit 558b3e8

1 file changed

Lines changed: 23 additions & 11 deletions

File tree

torchci/docs/architecture.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,23 @@ These are uploaded to S3 directly by the GitHub workflows in `pytorch/pytorch`.
6363

6464
### Logs and log classifications
6565

66-
Logs are downloaded by the [`github-status-test`] AWS lambda, which receives
67-
webhooks through a manual connection with the `pytorch/pytorch` repo.
68-
`github-status-test` then pings another lambda, [`log-classifier`], which
69-
performs log classification (more detail in the [README]).
66+
The PyTorch bot's `workflow_job` handler (`lib/bot/logUploader.ts`) asynchronously
67+
invokes the [`gha-log-uploader`] lambda when a job completes. That lambda
68+
downloads the log from GitHub, puts it in the [`ossci-raw-job-status`] bucket
69+
under `log/`, and then asynchronously invokes [`log-classifier`] to do the
70+
classification (more detail in the [README]).
7071

7172
[readme]: https://github.com/pytorch/test-infra/blob/main/aws/lambda/log-classifier/README.md
7273

73-
The logic in `github-status-test` could be moved to the `hud.pytorch.org`
74-
webhooks endpoint, and modified so that all repos that `torchci` is installed
75-
on benefits from log downloads and classifications, but this is not currently
76-
implemented. Add @suo as a reviewer on a PR if you want to add it!
74+
Because this hangs off the App webhook rather than a per-repo one, every repo the
75+
bot is installed on gets log downloads and classifications without an admin
76+
configuring anything. Which repos are enabled is controlled by the
77+
`LOG_UPLOADER_REPOS` env var while the cutover from [`github-status-test`] is in
78+
progress; see https://github.com/pytorch/test-infra/issues/7549.
79+
80+
Missing logs are re-requested through `backfillMissingLog` in `lib/jobUtils.ts`,
81+
which Dr.CI calls when it finds a failed job with no log. Callers outside HUD use
82+
the authenticated `POST /api/log-uploader/backfill` route.
7783

7884
### Test statistics
7985

@@ -91,11 +97,17 @@ an example.
9197

9298
### Raw webhook payloads
9399

94-
For archival purposes, we save all raw webhook payloads to S3. This is done
95-
through the [`github-status-test`] lambda (the same one that downloads logs).
96-
The raw webhook payloads are uploaded to the [`ossci-raw-job-status`] S3 bucket.
100+
The [`github-status-test`] lambda archives raw webhook payloads to the
101+
[`ossci-raw-job-status`] S3 bucket, under a prefix per event type. Nothing reads
102+
them: `clickhouse-replicator-s3` has no `SUPPORTED_PATHS` entry for
103+
`workflow_job/`, `workflow_run/`, or `full_workflow_*/`, and ClickHouse gets jobs
104+
from DynamoDB through `clickhouse-replicator-dynamo`.
105+
106+
This archive goes away with the lambda. It is not reproduced in
107+
[`gha-log-uploader`].
97108

98109
[`github-status-test`]: https://us-east-1.console.aws.amazon.com/lambda/home?region=us-east-1#/functions/github-status-test?tab=code
110+
[`gha-log-uploader`]: https://github.com/pytorch/test-infra/blob/main/aws/lambda/gha-log-uploader/README.md
99111
[`ossci-raw-job-status`]: https://s3.console.aws.amazon.com/s3/buckets/ossci-raw-job-status?region=us-east-1&tab=overview
100112

101113
## Adding a new repo to `torchci`

0 commit comments

Comments
 (0)