Skip to content

Commit 4e43bd8

Browse files
authored
[HUD] Keep going display on HUD: change queries to use temp conclusion + log result (#6845)
Change various queries to use some aliases that automatically handle keep going. Not every query needs to use this, only really things that need live data (ex commit page, HUD page, Dr. CI). There are probably some missing and this changes probably too many but I think it's ok for now I added an explanation of the table schema in #6848 Testing: `python tools/torchci/clickhouse_query_perf.py --base origin/main --results --strict-results --query hud_query` for each query Also added some tests for those that didn't have any. Changes: * log classifier count but it was because it takes different example lines that have slight differences (ex log lines include test time and test time changes) * recent_pr_workflows_query - I added a new logUrl result. There were some other differences but I think its just because timing I made a PR put keep-going on and purposely failed a job. While it continued to run, I checked that: * job shows up as failing * raw log link goes to temp log * log viewer shows temp log * dr ci showed it failed
1 parent 3584b64 commit 4e43bd8

File tree

14 files changed

+99
-80
lines changed

14 files changed

+99
-80
lines changed

torchci/clickhouse_queries/commit_failed_jobs/query.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ SELECT
1616
CONCAT(j.workflow_name, ' / ', j.name) AS name,
1717
j.runner_name AS runnerName,
1818
w.authorEmail as authorEmail,
19-
j.conclusion as conclusion,
19+
j.conclusion_kg as conclusion,
2020
j.completed_at as completed_at,
2121
j.html_url as html_url,
2222
j.head_sha as head_sha,
2323
w.head_sha_timestamp AS head_sha_timestamp,
2424
j.head_branch as head_branch,
25-
j.torchci_classification.'captures' AS failure_captures,
26-
IF(j.torchci_classification.'line' = '', [], [j.torchci_classification.'line']) AS failure_lines,
27-
j.torchci_classification.'context' AS failure_context,
25+
j.torchci_classification_kg.'captures' AS failure_captures,
26+
IF(j.torchci_classification_kg.'line' = '', [], [j.torchci_classification_kg.'line']) AS failure_lines,
27+
j.torchci_classification_kg.'context' AS failure_context,
2828
j.created_at AS time
2929
FROM
3030
default.workflow_job j final
3131
JOIN runs w on w.id = j.run_id
3232
WHERE
3333
j.id in (select id from materialized_views.workflow_job_by_head_sha where head_sha in {shas: Array(String)})
34-
AND j.conclusion IN ('failure', 'cancelled')
34+
AND j.conclusion_kg IN ('failure', 'cancelled')

torchci/clickhouse_queries/commit_jobs_batch_query/params.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,30 @@
22
"params": {
33
"shas": "Array(String)"
44
},
5-
"tests": []
6-
}
5+
"tests": [
6+
{
7+
"shas": [
8+
"c808af514d59e25ea4a880c1e1e07d3232984e5d",
9+
"2f94f69b7c83370ef0cc65e3ab96bb5bf11a7b1a",
10+
"197c1869f5467b4cfa1e197bbe394be82ba40554",
11+
"2d39a48d524021995269411bd49fe792e59d9f94",
12+
"53e0b9c3936176521ed8d71c00abd5b7499057c2",
13+
"de45c5f673ce261e9a82c54280beeda36cff640e",
14+
"18b01afa9ed1dbc696a06de1b69bf5c021c18c10",
15+
"bbf1a6feac0e88772be103a1b159b871b5c00b4a",
16+
"455dfd258980294f0745bd90aee12a323e37224d",
17+
"50b2069b61942e923528c94ccbbc8ab5e92c381e",
18+
"dfc31b3345d78b0a49d446dcc1957404606a3aa2",
19+
"0d01bafc34fc99a0b3e46cbf1ecfd8f97563efa6",
20+
"127695eb5c973f9fdba24c47b465e30a19292582",
21+
"0a16818d5b3fdf0fb8148dd6b849687251a56376",
22+
"98e594b565471c2dbf9f50fe624259741efbad61",
23+
"a730c65fe3d4dd6141f69720a70440cd4debc6d2",
24+
"4585c33e74079af8e9067bf39970b93c3f13629f",
25+
"7521cd91118c1c1a55b8f7146d7e22bf60fe06bf",
26+
"68e023cbbb39b46ecc607329bb062db5c48ac196",
27+
"df9e5a276b47086aaddb04885606bdcdbf87b593"
28+
]
29+
}
30+
]
31+
}

torchci/clickhouse_queries/commit_jobs_batch_query/query.sql

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@ WITH job AS (
1010
job.id as id,
1111
workflow.id AS workflow_id,
1212
workflow.artifacts_url AS github_artifact_url,
13-
job.conclusion as conclusion,
13+
job.conclusion_kg as conclusion,
1414
job.html_url as html_url,
15-
CONCAT(
16-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
17-
job.id
18-
) AS log_url,
15+
job.log_url as log_url,
1916
DATE_DIFF(
2017
'SECOND',
2118
job.started_at,
2219
job.completed_at
2320
) AS duration_s,
24-
IF(job.torchci_classification.'line' = '', [], [job.torchci_classification.'line']) AS failure_line,
25-
job.torchci_classification.'context' AS failure_context,
26-
job.torchci_classification.'captures' AS failure_captures,
27-
job.torchci_classification.'line_num' AS failure_line_number
21+
IF(job.torchci_classification_kg.'line' = '', [], [job.torchci_classification_kg.'line']) AS failure_line,
22+
job.torchci_classification_kg.'context' AS failure_context,
23+
job.torchci_classification_kg.'captures' AS failure_captures,
24+
job.torchci_classification_kg.'line_num' AS failure_line_number
2825
FROM
2926
default.workflow_job job final
3027
INNER JOIN default.workflow_run workflow final ON workflow.id = job.run_id

torchci/clickhouse_queries/commit_jobs_query/params.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"repo": "String",
44
"sha": "String"
55
},
6-
"tests": []
7-
}
6+
"tests": [
7+
{
8+
"repo": "pytorch/pytorch",
9+
"sha": "85df746892d9b0e87e7a5dfa78ef81a84aec6de0"
10+
}
11+
]
12+
}

torchci/clickhouse_queries/commit_jobs_query/query.sql

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,15 @@ WITH job AS (
1212
workflow.id AS workflow_id,
1313
workflow.artifacts_url AS github_artifact_url,
1414
multiIf(
15-
job.conclusion = ''
15+
job.conclusion_kg = ''
1616
and status = 'queued' ,
1717
'queued',
18-
job.conclusion = '',
18+
job.conclusion_kg = '',
1919
'pending',
20-
job.conclusion
20+
job.conclusion_kg
2121
) as conclusion,
2222
job.html_url,
23-
IF(
24-
{repo: String } = 'pytorch/pytorch',
25-
CONCAT(
26-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
27-
job.id:: String
28-
),
29-
CONCAT(
30-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
31-
{repo: String },
32-
'/',
33-
job.id:: String
34-
)
35-
) AS log_url,
23+
job.log_url AS log_url,
3624
if(
3725
job.started_at = 0,
3826
0,
@@ -43,10 +31,10 @@ WITH job AS (
4331
0,
4432
DATE_DIFF('SECOND', job.started_at, job.completed_at)
4533
) AS duration_s,
46-
job.torchci_classification.line as line,
47-
job.torchci_classification.captures as captures,
48-
job.torchci_classification.line_num as line_num,
49-
job.torchci_classification.context as context,
34+
job.torchci_classification_kg.'line' as line,
35+
job.torchci_classification_kg.'captures' as captures,
36+
job.torchci_classification_kg.'line_num' as line_num,
37+
job.torchci_classification_kg.'context' as context,
5038
job.runner_name AS runner_name,
5139
workflow.head_commit. 'author'.'email' AS authorEmail
5240
FROM

torchci/clickhouse_queries/failed_workflow_jobs/params.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,12 @@
55
"startTime": "DateTime64(3)",
66
"stopTime": "DateTime64(3)"
77
},
8-
"tests": []
9-
}
8+
"tests": [
9+
{
10+
"branch": "main",
11+
"repo": "pytorch/pytorch",
12+
"startTime": "2025-01-01T00:00:00.000",
13+
"stopTime": "2025-01-15T00:00:00.000"
14+
}
15+
]
16+
}

torchci/clickhouse_queries/failed_workflow_jobs/query.sql

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ SELECT DISTINCT
33
j.head_sha AS sha,
44
CONCAT(w.name, ' / ', j.name) AS jobName,
55
j.id,
6-
j.conclusion,
6+
j.conclusion_kg as conclusion,
77
j.html_url AS htmlUrl,
8-
CONCAT(
9-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
10-
j.id
11-
) AS logUrl,
8+
j.log_url as logUrl,
129
DATE_DIFF('SECOND', j.started_at, j.completed_at) AS durationS,
13-
array(j.torchci_classification. 'line') AS failureLines,
14-
j.torchci_classification. 'captures' AS failureCaptures,
15-
array(j.torchci_classification. 'line_num') AS failureLineNumbers
10+
array(j.torchci_classification_kg. 'line') AS failureLines,
11+
j.torchci_classification_kg. 'captures' AS failureCaptures,
12+
array(j.torchci_classification_kg. 'line_num') AS failureLineNumbers
1613
FROM
1714
workflow_job j FINAL
1815
JOIN workflow_run w FINAL on w.id = j.run_id
@@ -23,4 +20,4 @@ WHERE
2320
AND w.head_branch = {branch: String }
2421
AND w.event != 'workflow_run'
2522
AND w.event != 'repository_dispatch'
26-
AND j.conclusion IN ('failure', 'cancelled', 'time_out')
23+
AND j.conclusion_kg IN ('failure', 'cancelled', 'time_out')

torchci/clickhouse_queries/flaky_tests/ind_info/query.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ WITH failed_test_runs AS (
1616

1717
failed_jobs AS (
1818
SELECT
19-
j.conclusion AS conclusion,
19+
j.conclusion_kg AS conclusion,
2020
j.id AS id,
2121
j.run_id AS run_id,
2222
j.name AS name,
2323
j.html_url AS html_url,
2424
j.started_at AS started_at,
25-
tupleElement(j.torchci_classification, 'line') AS line,
26-
tupleElement(j.torchci_classification, 'line_num') AS line_num,
27-
tupleElement(j.torchci_classification, 'captures') AS captures,
25+
tupleElement(j.torchci_classification_kg, 'line') AS line,
26+
tupleElement(j.torchci_classification_kg, 'line_num') AS line_num,
27+
tupleElement(j.torchci_classification_kg, 'captures') AS captures,
2828
j.head_sha AS head_sha
2929
FROM default.workflow_job AS j
3030
WHERE

torchci/clickhouse_queries/hud_query/query.sql

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,18 @@ WITH job AS (
55
job.workflow_name as workflow_name,
66
job.id as id,
77
job.status as status,
8-
job.conclusion as conclusion,
8+
job.conclusion_kg as conclusion,
99
job.html_url as html_url,
10-
IF(
11-
{repo: String} = 'pytorch/pytorch',
12-
CONCAT(
13-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
14-
job.id::String
15-
),
16-
CONCAT(
17-
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
18-
{repo: String},
19-
'/',
20-
job.id::String
21-
)
22-
) as log_url,
10+
job.log_url as log_url,
2311
if(
2412
job.completed_at = 0,
2513
null,
2614
DATE_DIFF('SECOND', job.started_at, job.completed_at)
2715
) AS duration_s,
2816
job.repository_full_name as repo,
29-
job.torchci_classification.'line' as line,
30-
job.torchci_classification.'captures' as captures,
31-
job.torchci_classification.'line_num' as line_num,
17+
job.torchci_classification_kg.'line' as line,
18+
job.torchci_classification_kg.'captures' as captures,
19+
job.torchci_classification_kg.'line_num' as line_num,
3220
annotation.annotation as annotation
3321
FROM
3422
workflow_job job final

torchci/clickhouse_queries/log_captures_count/params.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"startTime": "DateTime64(3)",
44
"stopTime": "DateTime64(3)"
55
},
6-
"tests": []
7-
}
6+
"tests": [
7+
{
8+
"startTime": "2025-01-01T00:00:00.000",
9+
"stopTime": "2025-01-15T00:00:00.000"
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)