name: Weekly Batch Evaluation on: schedule: # Run every Sunday at 00:00 UTC - 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 # 6 hours max 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 # Set as application default credentials for SkyPilot mkdir -p ~/.config/gcloud cp /tmp/gcp-key.json ~/.config/gcloud/application_default_credentials.json # For service account, also activate with gcloud 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 # SkyPilot uses GCP project from gcloud config or ADC 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: | # Clone the results repository git clone https://x-access-token:${RESULTS_REPO_TOKEN}@github.com/FrontierCS/Frontier-CS-Result.git /tmp/results-repo # Copy results 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..." # List and terminate all eval-* 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"