Skip to content

Commit 6e2f9ec

Browse files
suopytorchmergebot
authored andcommitted
[ci/docs] add some documentation about the stats uploading process
This process is pretty confusing, so wrote it down. [skip ci] Pull Request resolved: pytorch#79504 Approved by: https://github.com/janeyx99
1 parent aff7eef commit 6e2f9ec

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tools/stats/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PyTorch CI Stats
2+
3+
We track various stats about each CI job.
4+
5+
1. Jobs upload their artifacts to an intermediate data store (either GitHub
6+
Actions artifacts or S3, depending on what permissions the job has). Example:
7+
https://github.com/pytorch/pytorch/blob/a9f6a35a33308f3be2413cc5c866baec5cfe3ba1/.github/workflows/_linux-build.yml#L144-L151
8+
2. When a workflow completes, a `workflow_run` event [triggers
9+
`upload-test-stats.yml`](https://github.com/pytorch/pytorch/blob/d9fca126fca7d7780ae44170d30bda901f4fe35e/.github/workflows/upload-test-stats.yml#L4).
10+
3. `upload-test-stats` downloads the raw stats from the intermediate data store
11+
and uploads them as JSON to Rockset, our metrics backend.
12+
13+
```mermaid
14+
graph LR
15+
J1[Job with AWS creds<br>e.g. linux, win] --raw stats--> S3[(AWS S3)]
16+
J2[Job w/o AWS creds<br>e.g. mac] --raw stats--> GHA[(GH artifacts)]
17+
18+
S3 --> uts[upload-test-stats.yml]
19+
GHA --> uts
20+
21+
uts --json--> R[(Rockset)]
22+
```
23+
24+
Why this weird indirection? Because writing to Rockset requires special
25+
permissions which, for security reasons, we do not want to give to pull request
26+
CI. Instead, we implemented GitHub's [recommended
27+
pattern](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)
28+
for cases like this.
29+
30+
For more details about what stats we export, check out
31+
[`upload-test-stats.yml`](https://github.com/pytorch/pytorch/blob/d9fca126fca7d7780ae44170d30bda901f4fe35e/.github/workflows/upload-test-stats.yml)

0 commit comments

Comments
 (0)