Sister Brawl — Deployment Guide
Pure ops/deployment. Architecture → Architecture. Systems → Systems.
Build Pipeline
Frontend Build (Atomic)
cd /home/usr/funday
bash scripts/build-atomic.shWhat it does:
npx vite build→build/client/+build/server/- Atomic swap:
mv build /var/www/sisterbrawl-build-new - Symlink:
ln -sfn build-new public - Restart:
systemctl restart funday-frontend
Nakama Module Build
cd /home/usr/funday/nakama-modules
npm run buildOutput: dist/index.js → copied to /var/lib/nakama/modules/
K8s Deploy (Optional)
sudo kubectl apply -f games/sisterbrawl/deploy/k3s-deployment.yaml
sudo kubectl apply -f games/sisterbrawl/deploy/k3s-metrics-deployment.yaml
sudo kubectl rollout status -n funday-platform deployment/sisterbrawlHealth Checks
Frontend
# Local
curl -sf http://127.0.0.1:3000/health
# Remote
curl -sf https://funday.gg/play/sisterbrawl | head -3Expected: 200 OK with HTML containing <canvas> and data-game-id="sisterbrawl"
Nakama
curl -sf https://funday.gg/v2/healthcheckExpected: 200 OK with {"status":"healthy","services":{"nakama":"ok"}}
Metrics Sidecar
curl -sf http://localhost:9101/metrics | grep sisterbrawlExpected: Prometheus metrics:
sisterbrawl_active_matches 2
sisterbrawl_tick_latency_ms 15
sisterbrawl_avg_players 4.5
Solo Mode (Headless Chrome)
cd /home/usr/funday
node scripts/verify-solo-headless.jsExpected output:
✅ Canvas: 896x493
✅ Coverage: 12.3%
✅ Solo mode: true
✅ Entities: 2
Deployment Commands (Quick Reference)
| Step | Command |
|---|---|
| Deploy Nakama | cd nakama-modules && npm run build && sudo kubectl rollout restart deployment/nakama -n funday-platform |
| Deploy Frontend | bash scripts/build-atomic.sh |
| Check Frontend | systemctl is-active funday-frontend && curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/play/sisterbrawl |
| Check Nakama logs | sudo kubectl logs -n funday-platform deployment/nakama --tail=50 |
| Check Frontend logs | sudo journalctl -u funday-frontend -f |
| Rollback frontend | ln -sfn build-prev public && systemctl restart funday-frontend |
Rollback Procedure
Frontend Rollback
# Previous build stored at /var/www/sisterbrawl-build-prev
sudo ln -sfn /var/www/sisterbrawl-build-prev /var/www/sisterbrawl-public
sudo systemctl restart funday-frontend
sudo systemctl is-active funday-frontend
curl -sf http://127.0.0.1:3000/healthNakama Rollback
# Roll back to previous image
sudo kubectl rollout undo deployment/nakama -n funday-platform
sudo kubectl rollout status deployment/nakama -n funday-platformVerification Checklists
Pre-Deploy
| Check | Command | Expected |
|---|---|---|
| Build success | ls -la build/server/index.js | File exists |
| TypeScript clean | tsc --noEmit | 0 errors |
| Lint clean | eslint src/ | 0 warnings |
| Vite build | npx vite build --mode production | Success |
| Health check (local) | curl -sf http://localhost:3000/health | 200 OK |
| Game loads (prod) | curl -sf https://funday.gg/play/sisterbrawl | grep canvas | Contains canvas |
Post-Deploy
| Check | Tool | Expected |
|---|---|---|
| Canvas alive | browser_console | canvas.width > 0 && non_black_pixels > 1% |
| No JS errors | browser_console | console.errors.length === 0 |
| Feature renders | browser_vision | Vision confirms expected UI |
| 60fps sustained | browser_console | requestAnimationFrame delta < 18ms |
| WebSocket connects | browser_console | socket.onopen logged, STATE_UPDATE received |
| Solo mode works | browser_play | 2s timeout → bot spawns |
Monitoring & Alerts
Prometheus Alerts
| Alert | Condition | Severity |
|---|---|---|
SisterBrawlHighTickLatency | p95 > 20ms for 1m | warning |
SisterBrawlVeryHighTickLatency | p99 > 50ms for 30s | critical |
SisterBrawlNoActivePlayers | 0 players for 10m | info |
Grafana Dashboard
URL: https://funday.gg:9119/d/sisterbrawl-dashboard
Key panels:
- Active matches (gauge)
- Tick latency (p95/p99)
- Players online
- Match duration histogram
- Top characters played
Scaling & Performance
Fleet Autoscaler (Agones)
Uses Packed scheduling for cost efficiency.
apiVersion: autoscaling.agones.dev/v1
kind: FleetAutoscaler
metadata:
name: sisterbrawl-autoscaler
spec:
replicas: 3
scaleUp:
delayAfterActions: 5m
scaleDown:
delayAfterActions: 10mResource Limits
| Container | CPU | Memory |
|---|---|---|
| Nakama | 500m | 512Mi |
| Metrics | 100m | 128Mi |
| Frontend | N/A (systemd) | 256Mi |
Common Issues & Fixes
| Issue | Symptom | Fix |
|---|---|---|
| Black screen | Canvas exists but no draw | Check isSoloMode in console |
| No bot spawn | Solo mode doesn’t start | Verify matchId === null in store |
| WebSocket fail | socket.onopen never fires | Check Nakama logs for errors |
| Build fails | TypeScript error | Run tsc --noEmit locally |
| Metrics missing | No Prometheus data | Check metrics sidecar logs |
File References
| File | Purpose |
|---|---|
scripts/build-atomic.sh | Atomic frontend deployment |
games/sisterbrawl/deploy/k3s-deployment.yaml | K8s manifests |
nakama-modules/server/metrics.ts | Prometheus metrics |
devops/monitoring/prometheus/rules/sisterbrawl.yml | Alert rules |
Related Pages
- Architecture → Integration Points — System boundaries
- Systems → Core Constants — Tick rate, arena size, etc.
- Reference → Verification Checklists — Complete checklists