Skip to content

Commit 48cab4d

Browse files
authored
Merge pull request #22 from ZephyrCloudIO/feat/arch-revamp
Worker D1 integration
2 parents 8d6c9d8 + c65d239 commit 48cab4d

123 files changed

Lines changed: 11337 additions & 3043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Anthropic API Key (Required for Claude agents)
2+
ANTHROPIC_API_KEY=your_anthropic_api_key_here
3+
4+
# OpenRouter API Key (Optional - for OpenRouter agent)
5+
OPENROUTER_API_KEY=your_openrouter_api_key_here
6+
7+
# Worker Configuration (Required for all benchmarks)
8+
# The worker must be running for benchmarks to work
9+
# Start it with: cd worker && pnpm dev
10+
ZE_BENCHMARKS_WORKER_URL=http://localhost:8787
11+
ZE_BENCHMARKS_API_KEY=dev-local-key
12+
13+
# Claude Model Override (Optional)
14+
# CLAUDE_MODEL=claude-3-5-sonnet-20241022
15+
16+
# LLM Judge Model (Optional)
17+
# LLM_JUDGE_MODEL=anthropic/claude-3.5-sonnet
18+
19+
# Debug Mode (Optional)
20+
# DEBUG=true

.github/workflows/bench.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ jobs:
1818
with: { node-version: 24, cache: 'pnpm' }
1919
- run: pnpm install
2020
- run: pnpm --filter packages/harness build
21+
env:
22+
# Worker API Configuration
23+
ZE_BENCHMARKS_WORKER_URL: ${{ secrets.ZE_BENCHMARKS_WORKER_URL }}
24+
ZE_BENCHMARKS_API_KEY: ${{ secrets.ZE_BENCHMARKS_API_KEY }}
25+
# Agent API Keys
26+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
27+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
2128
- uses: actions/upload-artifact@v4
2229
with:
2330
name: results-${{ matrix.suite }}-${{ matrix.scenario }}-${{ matrix.tier }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy Worker - Development
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'apps/worker/**'
9+
- '.github/workflows/deploy-worker-dev.yml'
10+
11+
concurrency:
12+
group: deploy-worker-dev
13+
cancel-in-progress: true
14+
15+
jobs:
16+
deploy:
17+
name: Deploy to Development
18+
runs-on: ubuntu-latest
19+
environment:
20+
name: development
21+
url: https://bench-api-dev.zephyr-cloud.io
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 9
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '24'
36+
cache: 'pnpm'
37+
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Build worker dependencies
42+
run: pnpm build
43+
44+
- name: Deploy to Cloudflare Workers (Development)
45+
uses: cloudflare/wrangler-action@v3
46+
with:
47+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
49+
workingDirectory: apps/worker
50+
environment: dev
51+
command: deploy --env dev
52+
53+
- name: Run database migrations
54+
uses: cloudflare/wrangler-action@v3
55+
with:
56+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
57+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
58+
workingDirectory: apps/worker
59+
command: d1 migrations apply ze-benchmarks-dev --env dev
60+
61+
- name: Deployment summary
62+
run: |
63+
echo "### 🚀 Development Deployment Successful!" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "**Environment:** Development" >> $GITHUB_STEP_SUMMARY
66+
echo "**URL:** https://bench-api-dev.zephyr-cloud.io" >> $GITHUB_STEP_SUMMARY
67+
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
68+
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
69+
echo "**Deployed by:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy Worker - Release
2+
3+
on:
4+
release:
5+
types: [prereleased, released]
6+
7+
concurrency:
8+
group: deploy-worker-${{ github.event.release.prerelease && 'staging' || 'production' }}
9+
cancel-in-progress: false
10+
11+
jobs:
12+
deploy:
13+
name: Deploy to ${{ github.event.release.prerelease && 'Staging' || 'Production' }}
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: ${{ github.event.release.prerelease && 'staging' || 'production' }}
17+
url: ${{ github.event.release.prerelease && 'https://bench-api-stg.zephyr-cloud.io' || 'https://bench-api.zephyr-cloud.io' }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.release.tag_name }}
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: 9
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '24'
34+
cache: 'pnpm'
35+
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile
38+
39+
- name: Build worker dependencies
40+
run: pnpm build
41+
42+
- name: Deploy to Cloudflare Workers
43+
uses: cloudflare/wrangler-action@v3
44+
with:
45+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
46+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
47+
workingDirectory: apps/worker
48+
environment: ${{ github.event.release.prerelease && 'staging' || 'production' }}
49+
command: deploy --env ${{ github.event.release.prerelease && 'staging' || 'production' }}
50+
51+
- name: Run database migrations
52+
uses: cloudflare/wrangler-action@v3
53+
with:
54+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
55+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
56+
workingDirectory: apps/worker
57+
command: d1 migrations apply ${{ github.event.release.prerelease && 'ze-benchmarks-staging' || 'ze-benchmarks-prod' }} --env ${{ github.event.release.prerelease && 'staging' || 'production' }}
58+
59+
- name: Deployment summary
60+
run: |
61+
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
62+
ENVIRONMENT="Staging"
63+
URL="https://bench-api-stg.zephyr-cloud.io"
64+
EMOJI="🧪"
65+
else
66+
ENVIRONMENT="Production"
67+
URL="https://bench-api.zephyr-cloud.io"
68+
EMOJI="🚀"
69+
fi
70+
71+
echo "### ${EMOJI} ${ENVIRONMENT} Deployment Successful!" >> $GITHUB_STEP_SUMMARY
72+
echo "" >> $GITHUB_STEP_SUMMARY
73+
echo "**Environment:** ${ENVIRONMENT}" >> $GITHUB_STEP_SUMMARY
74+
echo "**URL:** ${URL}" >> $GITHUB_STEP_SUMMARY
75+
echo "**Version:** ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
76+
echo "**Release Type:** ${{ github.event.release.prerelease && 'Pre-release' || 'Full release' }}" >> $GITHUB_STEP_SUMMARY
77+
echo "**Deployed by:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,6 @@ results/summary.json
111111

112112
# Snapshot files
113113
snapshot.json5
114+
115+
# Wrangler local development state
116+
.wrangler/

0 commit comments

Comments
 (0)