Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
24ed3f32
Unverified
Commit
24ed3f32
authored
Oct 20, 2025
by
Xiaoyu Zhang
Committed by
GitHub
Oct 19, 2025
Browse files
fix(ci): Fix CI Monitor limit parameter and add CI Analysis to summary (#11832)
parent
44f0ece9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
4 deletions
+138
-4
.github/workflows/ci-monitor.yml
.github/workflows/ci-monitor.yml
+2
-2
scripts/ci_monitor/ci_analyzer.py
scripts/ci_monitor/ci_analyzer.py
+134
-0
scripts/ci_monitor/ci_analyzer_perf.py
scripts/ci_monitor/ci_analyzer_perf.py
+2
-2
No files found.
.github/workflows/ci-monitor.yml
View file @
24ed3f32
...
@@ -44,7 +44,7 @@ jobs:
...
@@ -44,7 +44,7 @@ jobs:
PYTHONIOENCODING
:
utf-8
PYTHONIOENCODING
:
utf-8
run
:
|
run
:
|
cd scripts/ci_monitor
cd scripts/ci_monitor
python ci_analyzer.py --token $GITHUB_TOKEN --limit ${{
github.event.
inputs.limit || '1000' }} --output ci_analysis_$(date +%Y%m%d_%H%M%S).json
python ci_analyzer.py --token $GITHUB_TOKEN --limit ${{ inputs.limit || '1000' }} --output ci_analysis_$(date +%Y%m%d_%H%M%S).json
-
name
:
Run Performance Analysis
-
name
:
Run Performance Analysis
env
:
env
:
...
@@ -53,7 +53,7 @@ jobs:
...
@@ -53,7 +53,7 @@ jobs:
PYTHONIOENCODING
:
utf-8
PYTHONIOENCODING
:
utf-8
run
:
|
run
:
|
cd scripts/ci_monitor
cd scripts/ci_monitor
python ci_analyzer_perf.py --token $GITHUB_TOKEN --limit ${{
github.event.
inputs.limit || '1000' }} --output-dir performance_tables_$(date +%Y%m%d_%H%M%S) --upload-to-github
python ci_analyzer_perf.py --token $GITHUB_TOKEN --limit ${{ inputs.limit || '1000' }} --output-dir performance_tables_$(date +%Y%m%d_%H%M%S) --upload-to-github
-
name
:
Upload Analysis Results
-
name
:
Upload Analysis Results
uses
:
actions/upload-artifact@v4
uses
:
actions/upload-artifact@v4
...
...
scripts/ci_monitor/ci_analyzer.py
View file @
24ed3f32
...
@@ -395,6 +395,137 @@ class SGLangCIAnalyzer:
...
@@ -395,6 +395,137 @@ class SGLangCIAnalyzer:
json
.
dump
(
stats
,
f
,
ensure_ascii
=
False
,
indent
=
2
)
json
.
dump
(
stats
,
f
,
ensure_ascii
=
False
,
indent
=
2
)
print
(
f
"
\n
Detailed report saved to:
{
output_file
}
"
)
print
(
f
"
\n
Detailed report saved to:
{
output_file
}
"
)
def
generate_github_summary
(
self
,
stats
:
Dict
):
"""Generate GitHub Actions summary"""
try
:
github_step_summary
=
os
.
environ
.
get
(
"GITHUB_STEP_SUMMARY"
)
if
not
github_step_summary
:
print
(
"ℹ️ Not running in GitHub Actions, skipping summary generation"
)
return
print
(
"📊 Generating GitHub Actions summary for CI Analysis..."
)
summary_lines
=
[]
summary_lines
.
append
(
"# 🔍 SGLang CI Analysis Report (CUDA Only)"
)
summary_lines
.
append
(
""
)
# Overall statistics
total
=
stats
[
"total_runs"
]
failed
=
stats
[
"failed_runs"
]
success
=
stats
[
"successful_runs"
]
cancelled
=
stats
[
"cancelled_runs"
]
skipped
=
stats
[
"skipped_runs"
]
success_rate
=
(
success
/
total
*
100
)
if
total
>
0
else
0
summary_lines
.
append
(
"## 📊 Overall Statistics"
)
summary_lines
.
append
(
""
)
summary_lines
.
append
(
"| Metric | Count | Percentage |"
)
summary_lines
.
append
(
"|--------|-------|------------|"
)
summary_lines
.
append
(
f
"| Total Runs |
{
total
}
| 100% |"
)
summary_lines
.
append
(
f
"| ✅ Successful |
{
success
}
|
{
success
/
total
*
100
:.
1
f
}
% |"
)
summary_lines
.
append
(
f
"| ❌ Failed |
{
failed
}
|
{
failed
/
total
*
100
:.
1
f
}
% |"
)
summary_lines
.
append
(
f
"| 🚫 Cancelled |
{
cancelled
}
|
{
cancelled
/
total
*
100
:.
1
f
}
% |"
)
summary_lines
.
append
(
f
"| ⏭️ Skipped |
{
skipped
}
|
{
skipped
/
total
*
100
:.
1
f
}
% |"
)
summary_lines
.
append
(
f
"| **Success Rate** | **
{
success_rate
:.
1
f
}
%** | - |"
)
summary_lines
.
append
(
""
)
# Category failure statistics
if
stats
[
"category_failures"
]:
summary_lines
.
append
(
"## 📁 Category Failure Statistics"
)
summary_lines
.
append
(
""
)
summary_lines
.
append
(
"| Category | Failures |"
)
summary_lines
.
append
(
"|----------|----------|"
)
for
category
,
count
in
sorted
(
stats
[
"category_failures"
].
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
):
summary_lines
.
append
(
f
"|
{
category
}
|
{
count
}
|"
)
summary_lines
.
append
(
""
)
# Most frequently failed jobs (Top 20)
if
stats
[
"job_failures"
]:
summary_lines
.
append
(
"## 🔴 Most Frequently Failed Jobs (Top 20)"
)
summary_lines
.
append
(
""
)
top_failures
=
sorted
(
stats
[
"job_failures"
].
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)[:
20
]
for
i
,
(
job
,
count
)
in
enumerate
(
top_failures
,
1
):
summary_lines
.
append
(
f
"###
{
i
}
. `
{
job
}
` (
{
count
}
failures)"
)
summary_lines
.
append
(
""
)
# Show last successful run
if
job
in
stats
[
"job_last_success"
]:
last_success
=
stats
[
"job_last_success"
][
job
]
success_date
=
datetime
.
fromisoformat
(
last_success
[
"created_at"
].
replace
(
"Z"
,
"+00:00"
)
)
pr_info
=
last_success
[
"pr_info"
]
pr_text
=
""
if
pr_info
[
"pr_number"
]:
pr_text
=
(
f
" (PR #
{
pr_info
[
'pr_number'
]
}
by
{
pr_info
[
'author'
]
}
)"
)
else
:
pr_text
=
f
" by
{
pr_info
[
'author'
]
}
"
summary_lines
.
append
(
f
"✅ **Last Success:** [Run #
{
last_success
[
'run_number'
]
}
](
{
last_success
[
'url'
]
}
) (
{
success_date
.
strftime
(
'%Y-%m-%d %H:%M'
)
}
)
{
pr_text
}
"
)
summary_lines
.
append
(
""
)
# Show recent failure links
if
(
job
in
stats
[
"job_failure_links"
]
and
stats
[
"job_failure_links"
][
job
]
):
summary_lines
.
append
(
"❌ **Recent Failures:**"
)
for
link_info
in
stats
[
"job_failure_links"
][
job
]:
created_at
=
datetime
.
fromisoformat
(
link_info
[
"created_at"
].
replace
(
"Z"
,
"+00:00"
)
)
pr_info
=
link_info
.
get
(
"pr_info"
,
{})
pr_text
=
""
if
pr_info
.
get
(
"pr_number"
):
pr_text
=
f
" (PR #
{
pr_info
[
'pr_number'
]
}
by
{
pr_info
.
get
(
'author'
,
'Unknown'
)
}
)"
else
:
pr_text
=
f
" by
{
pr_info
.
get
(
'author'
,
'Unknown'
)
}
"
summary_lines
.
append
(
f
"- [Run #
{
link_info
[
'run_number'
]
}
](
{
link_info
[
'url'
]
}
) (
{
created_at
.
strftime
(
'%Y-%m-%d %H:%M'
)
}
)
{
pr_text
}
"
)
summary_lines
.
append
(
""
)
# Failure pattern analysis
if
stats
[
"failure_patterns"
]:
summary_lines
.
append
(
"## 🔬 Failure Pattern Analysis"
)
summary_lines
.
append
(
""
)
summary_lines
.
append
(
"| Pattern | Count |"
)
summary_lines
.
append
(
"|---------|-------|"
)
for
pattern
,
count
in
sorted
(
stats
[
"failure_patterns"
].
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
):
summary_lines
.
append
(
f
"|
{
pattern
}
|
{
count
}
|"
)
summary_lines
.
append
(
""
)
# Write summary to GitHub Actions
with
open
(
github_step_summary
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
"
\n
"
.
join
(
summary_lines
))
f
.
write
(
"
\n\n
---
\n\n
"
)
# Add separator between reports
print
(
"✅ GitHub Actions summary generated successfully"
)
except
Exception
as
e
:
print
(
f
"❌ Failed to generate GitHub Actions summary:
{
e
}
"
)
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"SGLang CI Analyzer"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"SGLang CI Analyzer"
)
...
@@ -440,6 +571,9 @@ def main():
...
@@ -440,6 +571,9 @@ def main():
# Save detailed report
# Save detailed report
analyzer
.
save_detailed_report
(
stats
,
args
.
output
)
analyzer
.
save_detailed_report
(
stats
,
args
.
output
)
# Generate GitHub summary
analyzer
.
generate_github_summary
(
stats
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
f
"Error during analysis:
{
e
}
"
)
print
(
f
"Error during analysis:
{
e
}
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
scripts/ci_monitor/ci_analyzer_perf.py
View file @
24ed3f32
...
@@ -1304,8 +1304,8 @@ class SGLangPerfAnalyzer:
...
@@ -1304,8 +1304,8 @@ class SGLangPerfAnalyzer:
summary_lines
.
append
(
"---"
)
summary_lines
.
append
(
"---"
)
summary_lines
.
append
(
""
)
summary_lines
.
append
(
""
)
# Write summary to GitHub Actions
# Write summary to GitHub Actions
(append mode to preserve CI Analysis report)
with
open
(
github_step_summary
,
"
w
"
,
encoding
=
"utf-8"
)
as
f
:
with
open
(
github_step_summary
,
"
a
"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
"
\n
"
.
join
(
summary_lines
))
f
.
write
(
"
\n
"
.
join
(
summary_lines
))
print
(
"✅ GitHub Actions summary generated successfully"
)
print
(
"✅ GitHub Actions summary generated successfully"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment