The worker was only configured with B2 (ARMOR) credentials, so replays were being uploaded to B2 but not to R2. The index builder's B2→R2 promotion cycle only covers the last 24 hours, so older replays were not available in R2, causing 404 errors when clicking "Watch Replay". This fix adds R2 credentials to the worker deployment, allowing it to upload replays directly to R2 (hot cache) in addition to B2 (cold archive). This makes replays immediately available for viewing without waiting for the promotion cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
122 lines
4 KiB
YAML
122 lines
4 KiB
YAML
# acb-worker: Match execution worker for AI Code Battle
|
|
# BRPOPs jobs from Valkey, runs matches, uploads replays to B2 (armor),
|
|
# writes results and Glicko-2 ratings to PostgreSQL.
|
|
#
|
|
# Staging file — sync to declarative-config/k8s/iad-acb/ai-code-battle/
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: acb-worker
|
|
namespace: ai-code-battle
|
|
labels:
|
|
app.kubernetes.io/component: worker
|
|
app.kubernetes.io/name: acb-worker
|
|
app.kubernetes.io/part-of: ai-code-battle
|
|
annotations:
|
|
argocd-image-updater.argoproj.io/image-list: app=ronaldraygun/acb-worker
|
|
argocd-image-updater.argoproj.io/app.update-strategy: name
|
|
argocd-image-updater.argoproj.io/app.allow-tags: 'regexp:^sha-[0-9a-f]+$'
|
|
argocd-image-updater.argoproj.io/write-back-method: argocd
|
|
reloader.stakater.com/auto: "true"
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: acb-worker
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: worker
|
|
app.kubernetes.io/name: acb-worker
|
|
app.kubernetes.io/part-of: ai-code-battle
|
|
annotations:
|
|
reloader.stakater.com/auto: "true"
|
|
spec:
|
|
restartPolicy: Always
|
|
containers:
|
|
- name: worker
|
|
image: ronaldraygun/acb-worker@sha256:edd9616aaefb684a59779ea4b46b2bfe72679eecf6867e1be658273648e86bbe
|
|
imagePullPolicy: Always
|
|
args:
|
|
- "-poll=5s"
|
|
- "-heartbeat=30s"
|
|
- "-timeout=3s"
|
|
ports:
|
|
- containerPort: 9090
|
|
name: metrics
|
|
protocol: TCP
|
|
env:
|
|
- name: ACB_POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-postgres-credentials
|
|
key: username
|
|
- name: ACB_POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-postgres-credentials
|
|
key: password
|
|
- name: ACB_DATABASE_URL
|
|
value: "postgresql://$(ACB_POSTGRES_USER):$(ACB_POSTGRES_PASSWORD)@acb-postgres:5432/ai_code_battle?sslmode=disable"
|
|
- name: ACB_B2_ENDPOINT
|
|
value: "http://armor:9000"
|
|
- name: ACB_B2_BUCKET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-armor-credentials
|
|
key: bucket
|
|
- name: ACB_B2_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-armor-credentials
|
|
key: auth-access-key
|
|
- name: ACB_B2_SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-armor-credentials
|
|
key: auth-secret-key
|
|
- name: ACB_B2_REGION
|
|
value: ""
|
|
- name: ACB_R2_ENDPOINT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-r2-credentials
|
|
key: endpoint
|
|
- name: ACB_R2_BUCKET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-r2-credentials
|
|
key: bucket
|
|
- name: ACB_R2_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-r2-credentials
|
|
key: access-key
|
|
- name: ACB_R2_SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: acb-r2-credentials
|
|
key: secret-key
|
|
- name: ACB_METRICS_ADDR
|
|
value: ":9090"
|
|
resources:
|
|
requests:
|
|
cpu: "100m"
|
|
memory: "256Mi"
|
|
limits:
|
|
memory: "512Mi"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: metrics
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 30
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: metrics
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
imagePullSecrets:
|
|
- name: docker-hub-registry
|