-
Notifications
You must be signed in to change notification settings - Fork 95
129 lines (102 loc) · 3.66 KB
/
nightly-test-summize.yml
File metadata and controls
129 lines (102 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI Trend Summary
on:
schedule:
- cron: '30 22 * * *'
push:
branches:
- main
paths:
- "python/sgl_jax/version.py"
workflow_dispatch:
concurrency:
group: nightly-test-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
issues: write
jobs:
generate-summary:
if: github.repository == 'sgl-project/sglang-jax'
runs-on: arc-runner-v6e-1
continue-on-error: true
env:
TZ: Asia/Shanghai
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set current date
run: echo "DATE_DIR=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Set up Python Environment
run: |
python3.12 -m venv .venv
source .venv/bin/activate
pip install uv
uv pip install requests pandas matplotlib seaborn
- name: Prepare Image Directory
run: mkdir -p "summary_images/image_trend/${{ env.DATE_DIR }}"
- name: Generate Accuracy Trend Image
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
run: |
source .venv/bin/activate
python scripts/ci/plot_acc.py \
--token $GITHUB_TOKEN \
--limit ${{ inputs.limit || '30' }} \
--output "summary_images/image_trend/${{ env.DATE_DIR }}/accuracy_trend.png"
- name: Generate Performance Trend Image
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
run: |
source .venv/bin/activate
python scripts/ci/plot_perf.py \
--token $GITHUB_TOKEN \
--limit ${{ inputs.limit || '30' }} \
--output_file "summary_images/image_trend/${{ env.DATE_DIR }}/perf_trend.png"
- name: Upload Images to External Data Repo
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: |
python3 scripts/ci/publish_trend.py --source-dir ./summary_images
- name: Generate Dashboard Summary
env:
LIMIT: ${{ inputs.limit || '30' }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
DATE_DIR: ${{ env.DATE_DIR }}
run: |
source .venv/bin/activate
python -c '
import os
limit = os.environ.get("LIMIT", "30")
repo = os.environ["REPO"]
run_id = os.environ["RUN_ID"]
date_dir = os.environ["DATE_DIR"]
target_repo = "pathfinder-pf/sglang-jax-ci-data"
target_branch = "main"
base_url = f"https://raw.githubusercontent.com/{target_repo}/{target_branch}/image_trend/{date_dir}"
acc_img_url = f"{base_url}/accuracy_trend.png?v={run_id}"
perf_img_url = f"{base_url}/perf_trend.png?v={run_id}"
summary_content = f"""
# 📊 SGLang JAX Nightly Trend Report ({date_dir})
Here are the trends for the last **{limit} runs**.
### 📈 Accuracy Trend

### 🚀 Performance Trend

---
> Data generated at date: **{date_dir}**
> Data generated at run [{run_id}](${{ github.server_url }}/{repo}/actions/runs/{run_id})
"""
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f:
f.write(summary_content)
'
- name: Upload Trend Images Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: trend-charts
path: summary_images/
retention-days: 7