feat: add weekly workflow to update CI test est_time values (#22545)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
f7a1740101
commit
3f39b3d811
@@ -0,0 +1,70 @@
|
||||
name: Weekly Update Est Time
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 6' # Saturday 00:00 UTC
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update-est-time:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Update est_time values
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
python scripts/ci/update_est_time.py
|
||||
|
||||
- name: Check for changes
|
||||
id: changes
|
||||
run: |
|
||||
if git diff --quiet; then
|
||||
echo "has_changes=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No est_time changes detected"
|
||||
else
|
||||
echo "has_changes=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Est_time changes detected:"
|
||||
git diff --stat
|
||||
fi
|
||||
|
||||
- name: Create PR
|
||||
if: steps.changes.outputs.has_changes == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT_FOR_PULL_REQUEST }}
|
||||
run: |
|
||||
git config user.name "sglang-bot"
|
||||
git config user.email "sglang-bot@users.noreply.github.com"
|
||||
|
||||
BRANCH_NAME="bot/update-est-time-$(date +%Y%m%d)"
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
|
||||
git add -A
|
||||
git commit -m "chore: update CI test est_time from recent run data"
|
||||
|
||||
git push origin "$BRANCH_NAME"
|
||||
|
||||
gh pr create \
|
||||
--title "chore: update CI test est_time values" \
|
||||
--body "## Summary
|
||||
|
||||
Updates \`est_time\` values in CI test registration calls based on the median of the last 10 successful executions from scheduled PR Test runs on main.
|
||||
|
||||
This keeps the LPT load-balancing algorithm accurate for partitioning tests across parallel CI jobs.
|
||||
|
||||
🤖 Generated with GitHub Actions" \
|
||||
--base main \
|
||||
--head "$BRANCH_NAME"
|
||||
Reference in New Issue
Block a user