-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.75 KB
/
Copy pathrefresh_cache.yml
File metadata and controls
71 lines (62 loc) · 2.75 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
name: Refresh Model Cache
on:
schedule:
- cron: '0 0 * * *' # Every night at 00:00 UTC
workflow_dispatch:
permissions:
contents: write
jobs:
refresh:
name: Nightly Refresh
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install requests urllib3
- name: Run cache refresh
run: python scripts/refresh_cache.py
- name: Validate cache.json
run: |
python -c "
import json, sys
with open('data/cache.json') as f:
d = json.load(f)
sources = d.get('sources', {})
models = d.get('models', [])
gpus = d.get('gpus', [])
leaderboard_ok = sources.get('huggingface_leaderboard', {}).get('status') == 'success'
models_ok = len(models) > 0
print(f'Models: {len(models)}, GPUs: {len(gpus)}')
print(f'Leaderboard: {sources.get(\"huggingface_leaderboard\", {}).get(\"status\")} ({sources.get(\"huggingface_leaderboard\", {}).get(\"row_count\", 0)} rows)')
for k, v in sources.items():
print(f' {k}: {v.get(\"status\")} ({v.get(\"row_count\", 0)} rows)')
if not models_ok:
print('ERROR: No models in cache!')
sys.exit(1)
if not leaderboard_ok:
print('WARNING: Leaderboard fetch failed - benchmarks will use fallback estimates')
else:
measured = sum(1 for m in models if m.get('benchmarks', {}).get('status') in ('measured', 'derived'))
print(f'Benchmark coverage: {measured}/{len(models)} models have measured/derived scores')
"
- name: Commit and push updated cache
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add data/cache.json
git diff --staged --quiet || git commit -m "Nightly refresh: update model & GPU cache database"
git pull --rebase origin main && git push
# NOTE: No explicit deploy job here. This repo's Pages is configured as
# "Deploy from a branch" (legacy mode), so GitHub's built-in
# "pages build and deployment" workflow builds and deploys automatically on
# every push to main — including the cache.json push above. Adding our own
# actions/deploy-pages step here (as was done before) created a second,
# concurrent deployment that raced with the built-in one and intermittently
# failed with "Deployment request failed ... due to in progress deployment"
# (see run 31551404326, 2026-08-12).