CI Trend Summary #113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |