|
|
name: Weekly Batch Evaluation
|
|
|
|
|
|
on:
|
|
|
schedule:
|
|
|
|
|
|
- cron: '0 0 * * 0'
|
|
|
workflow_dispatch:
|
|
|
inputs:
|
|
|
problems:
|
|
|
description: 'Comma-separated problem IDs (leave empty for all)'
|
|
|
required: false
|
|
|
default: ''
|
|
|
max_concurrent:
|
|
|
description: 'Max concurrent evaluations'
|
|
|
required: false
|
|
|
default: '4'
|
|
|
|
|
|
env:
|
|
|
SKYPILOT_CLOUD: gcp
|
|
|
|
|
|
jobs:
|
|
|
evaluate:
|
|
|
runs-on: ubuntu-latest
|
|
|
timeout-minutes: 360
|
|
|
|
|
|
steps:
|
|
|
- name: Checkout repository
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
- name: Install uv
|
|
|
uses: astral-sh/setup-uv@v4
|
|
|
|
|
|
- name: Set up Python
|
|
|
run: uv python install 3.11
|
|
|
|
|
|
- name: Install dependencies
|
|
|
run: |
|
|
|
uv sync
|
|
|
uv pip install skypilot[gcp]
|
|
|
|
|
|
- name: Set up GCP credentials
|
|
|
run: |
|
|
|
echo '${{ secrets.GCP_CREDENTIALS }}' > /tmp/gcp-key.json
|
|
|
|
|
|
mkdir -p ~/.config/gcloud
|
|
|
cp /tmp/gcp-key.json ~/.config/gcloud/application_default_credentials.json
|
|
|
|
|
|
if grep -q '"type": "service_account"' /tmp/gcp-key.json; then
|
|
|
gcloud auth activate-service-account --key-file=/tmp/gcp-key.json
|
|
|
fi
|
|
|
gcloud config set project ${{ secrets.GCP_PROJECT_ID }}
|
|
|
env:
|
|
|
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp-key.json
|
|
|
|
|
|
- name: Configure SkyPilot
|
|
|
run: |
|
|
|
mkdir -p ~/.sky
|
|
|
|
|
|
uv run sky check gcp || true
|
|
|
env:
|
|
|
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp-key.json
|
|
|
|
|
|
- name: Run batch evaluation
|
|
|
env:
|
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
|
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp-key.json
|
|
|
run: |
|
|
|
MAX_CONCURRENT="${{ github.event.inputs.max_concurrent || '4' }}"
|
|
|
|
|
|
uv run frontier-eval batch \
|
|
|
--pairs-file pairs.txt \
|
|
|
--skypilot \
|
|
|
--max-concurrent $MAX_CONCURRENT \
|
|
|
--results-dir results/batch
|
|
|
|
|
|
- name: Upload results
|
|
|
if: always()
|
|
|
uses: actions/upload-artifact@v4
|
|
|
with:
|
|
|
name: evaluation-results-${{ github.run_id }}
|
|
|
path: results/
|
|
|
retention-days: 90
|
|
|
|
|
|
- name: Push results to results repository
|
|
|
if: always()
|
|
|
env:
|
|
|
RESULTS_REPO_TOKEN: ${{ secrets.RESULTS_REPO_TOKEN }}
|
|
|
run: |
|
|
|
|
|
|
git clone https://x-access-token:${RESULTS_REPO_TOKEN}@github.com/FrontierCS/Frontier-CS-Result.git /tmp/results-repo
|
|
|
|
|
|
|
|
|
cp -r results/* /tmp/results-repo/
|
|
|
|
|
|
cd /tmp/results-repo
|
|
|
git config user.name "github-actions[bot]"
|
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
|
|
git add .
|
|
|
git diff --staged --quiet || git commit -m "chore: update evaluation results $(date +%Y-%m-%d)"
|
|
|
git push
|
|
|
|
|
|
- name: Cleanup SkyPilot clusters
|
|
|
if: always()
|
|
|
env:
|
|
|
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp-key.json
|
|
|
run: |
|
|
|
echo "Cleaning up SkyPilot clusters..."
|
|
|
|
|
|
uv run sky status --refresh 2>/dev/null | grep -E '^eval-' | awk '{print $1}' | while read cluster; do
|
|
|
echo "Terminating cluster: $cluster"
|
|
|
uv run sky down "$cluster" -y || true
|
|
|
done
|
|
|
echo "Cleanup complete"
|
|
|
|