Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ OPENAI_API_KEY=
# Job Server (optional)
# API_KEY=
# JOB_STORE_PATH=jobs.db
# BREV_TOKEN=
6 changes: 4 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl git && \
curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz \
| tar xzf - -C /usr/local/bin oc kubectl && \
curl -sL https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc && \
chmod +x /usr/local/bin/mc && \
apt-get remove -y curl && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
chmod +x /usr/local/bin/mc

RUN pip install --upgrade pip uv

Expand All @@ -21,4 +20,7 @@ USER 1001

RUN uv sync --no-cache

# Install Brev
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh)"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

CMD ["echo", "Image is live!"]
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Reproducible benchmarks for coding agents and models using Harbor
- [Queue Service](#queue-service)
- [Set up the service](#set-up-the-service)
- [Use the service](#use-the-service)
- [Brev Integration](#brev-integration)
- [Harbor Command Examples](#harbor-command-examples)
- [Claude Code vLLM](#claude-code-vllm)
- [Codex vLLM](#codex-vllm)
Expand Down Expand Up @@ -144,6 +145,7 @@ If you want to see a preview of Harbor command that would be run for a given set

The queue service is a FastAPI application that can be deployed on OpenShift to queue and run benchmarks automatically.
Benchmark results are stored to MinIO for later review.
The queue service can also be configured to spin up/down models on demand using GPU-enabled VMs from [NVIDIA's Brev](https://developer.nvidia.com/brev).

```mermaid
sequenceDiagram
Expand Down Expand Up @@ -181,14 +183,15 @@ sequenceDiagram
oc apply -f deploy/harbor-orchestrator-sa.yml
oc apply -f deploy/harbor-task-sa.yml
```
4. Create a secret file named `job-queue-secret` with an `API_KEY` and apply it:
4. Create a secret file named `job-queue-secret` with an `API_KEY` (and optional `BREV_TOKEN`) and apply it:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: job-queue-secret
stringData:
API_KEY: <your-api-key>
# BREV_TOKEN: <your-brev-token>
Comment on lines +186 to +194

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Align the optional-token documentation with the deployment contract.

deploy/job-queue-service.yml references job-queue-secret/BREV_TOKEN without marking the SecretKeyRef optional. A secret created exactly as documented without that key can leave the pod in CreateContainerConfigError, even when Brev is not used. Mark the reference optional in the deployment, or make BREV_TOKEN required in these instructions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 186 - 194, The documented optional BREV_TOKEN
conflicts with the required SecretKeyRef in the deployment. Update the
BREV_TOKEN reference in the job-queue deployment manifest to set optional: true,
preserving the README instructions that omit the key.

type: Opaque
```
5. Create the queue service:
Expand Down Expand Up @@ -243,6 +246,41 @@ Cancel a running or queued job:
curl -X DELETE $JOB_QUEUE_URL/jobs/<job_id> -H "X-API-Key: <your-api-key>"
```

### Brev Integration

The queue service can automatically manage [NVIDIA Brev](https://developer.nvidia.com/brev) GPU VMs to serve models on demand. When a job is submitted with `server_url` set to `"brev"`, the service will:

1. Create a Brev VM instance and set up a port-forward to it
2. Start the requested model as a Docker container on the VM
3. Wait for the model's `/health` endpoint to respond
4. Run the benchmark job
5. Stop the model container when the job completes

If the next job in the queue uses the same model, the model container is kept running to avoid unnecessary restart cycles. Jobs are automatically reordered so that jobs using the same model run consecutively. When the queue is empty, the Brev instance is deleted.

**Prerequisites:**

- Add your `BREV_TOKEN` to the `job-queue-secret` (see [Set up the service](#set-up-the-service) step 4)
- Ensure your model is configured in `src/coding_agent_bench/brev.py` under `MODEL_CONFIGS`

**Usage:**

```sh
curl -X POST $JOB_QUEUE_URL/jobs \
-H "Content-Type: application/json" \
-H "X-API-Key: <your-api-key>" \
-d '{
"job_name": "my-benchmark",
"agent": "pi",
"dataset": "swe-bench/swe-bench-verified",
"model_name": "RedHatAI/Qwen3.6-27B-FP8",
"server_url": "brev",
"n_concurrent": 16
}'
```

To bypass Brev and use a specific server, set `server_url` to the server URL as usual.

## Harbor Command Examples

**Prerequisites:**
Expand Down
25 changes: 25 additions & 0 deletions deploy/job-queue-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ spec:
secretKeyRef:
name: job-queue-secret
key: API_KEY
- name: BREV_TOKEN
valueFrom:
secretKeyRef:
name: job-queue-secret
key: BREV_TOKEN
ports:
- containerPort: 8000
name: http
- containerPort: 9000
name: brev-model
imagePullPolicy: Always
volumeMounts:
- mountPath: /app/data
Expand Down Expand Up @@ -89,6 +96,24 @@ spec:
targetPort: 8000
protocol: TCP
---
kind: Service
apiVersion: v1
metadata:
name: brev-model-service
labels:
app: job-queue
component: brev-model
spec:
selector:
app: job-queue
component: api
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 9000
protocol: TCP
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
Expand Down
Loading