Skip to main content

Deployment

Deploy agents and infrastructure to ludus hosts.

Goal

Deploy the full #B4arena stack — infrastructure, agents, sandbox containers — to a ludus host, and deploy Tabula to Cloudflare Workers.

Prerequisites

  • Completed Dev Setup
  • SSH access to the ludus host (e.g., Mimas)
  • Ansible installed (pip install ansible)
  • Wrangler installed (for Tabula deployment): npm install -g wrangler

Steps

1. Deploy infrastructure

Infrastructure is managed via Ansible in the infra/ repo:

cd meta/infra

# Dry-run first (always!)
just check mimas

# Deploy to a specific host
just deploy mimas

# Deploy to all hosts
just deploy

# Config-only push (no provisioning)
just configure

Expected output: Ansible play recap with changed and ok counts, zero failed.

2. Deploy agents

Agent deployment is managed from the ludus/ repo:

cd meta/ludus

# Rsync agents, scripts, skills, CLI to all hosts
just deploy-agents

# First-time full deploy (images + register + configure + cron)
just deploy-full

3. Build sandbox Docker images

All agents run in Docker containers. Images are built on the ludus host:

cd meta/ludus

# Build all image layers on the ludus host
just images-build

Image hierarchy:

fedora:43
├─► openclaw-sandbox:fedora ← Minimal: bash, curl, git, python3
├─► openclaw-sandbox-common:fedora ← + Node.js, npm, gcc, make
├─► b4arena-base:latest ← + gh, bd CLI
└─► b4arena-dev:latest ← + full dev toolchain

4. Register and configure agents

cd meta/ludus

# Register all agents with the OpenClaw gateway
just register

# Configure sandbox defaults + per-agent overrides
just sandbox-configure

5. Verify deployment

cd meta/ludus

# Show registered agents and sync state
just status

# Health check
uv run ludus info doctor

# Check agent logs
uv run ludus info logs

Expected output: All agents registered, containers healthy, no errors.

6. Deploy Tabula to Cloudflare Workers

cd meta/tabula

# Build and deploy
npm run deploy

This runs docusaurus build followed by wrangler deploy. The site is published to tabula.b4arena.dev.

For a preview build:

npm run preview

This runs docusaurus build followed by wrangler dev for local preview.

Validation

# Infrastructure
cd meta/infra && just check mimas

# Agents registered
cd meta/ludus && just status

# Agent health
cd meta/ludus && uv run ludus info doctor

# Tabula live
curl -s https://tabula.b4arena.dev | head -5

If Things Go Wrong

ProblemSolution
Ansible fails with SSH errorsCheck ssh mimas works. Verify SSH config in ~/.ssh/config.
Agent registration failsCheck the OpenClaw gateway is running: ssh mimas sudo systemctl status openclaw-gateway.
Container build failsCheck Docker is running on the host: ssh mimas docker ps.
Gateway dies after agent deletionKnown issue: Restart=on-failure doesn't trigger on clean exit. Fix: ssh mimas sudo systemctl start openclaw-gateway.
Tabula deploy failsEnsure wrangler is authenticated: wrangler login. Check wrangler.jsonc for correct config.
ICU library mismatch breaks bdReinstall bd binary after OS upgrades (e.g., dnf upgrade on Fedora).