iGent Concert
/unison/deployment/

Deployment

Running Unison in development and production

Development

The root Fabric PM2 stack runs Unison on 127.0.0.1:8005 and passes the shared Valkey URL as UNISON_VALKEY_URL.

cd /Users/chabotc/Projects/fabric
./fabric-start.sh
./scripts/fabric-status.sh

For standalone Unison work:

cd /Users/chabotc/Projects/fabric/unison
bun install
bun run dev

If no explicit Valkey URL is set, the standalone dev path reuses a local Valkey/Redis-compatible server or starts the Bun-native valkey-bun backend.

Production Shape

Run one or more stateless Unison API workers against a managed Valkey/Redis-compatible deployment.

UNISON_LISTEN=0.0.0.0:8005 \
UNISON_VALKEY_URL=rediss://unison.example.internal:6379 \
UNISON_API_KEY="$UNISON_API_KEY" \
UNISON_AGENT_API_KEY="$UNISON_AGENT_API_KEY" \
UNISON_ENCRYPTION_KEY="$UNISON_ENCRYPTION_KEY" \
bun run service/main.ts

Production requirements:

  • managed Valkey/Redis with TLS for non-loopback traffic
  • persistence, backups, monitoring, and failover at the Valkey layer
  • non-default UNISON_API_KEY and UNISON_AGENT_API_KEY
  • configured UNISON_ENCRYPTION_KEY
  • network isolation so public clients cannot hit service-key routes directly

Build Standalone Binary

bun build service/main.ts --compile --outfile=unison

Failure Behavior

ScenarioImpactRecovery
One Unison API worker exitsOther workers continue if presentRestart the worker
Valkey unavailableReads/writes/readiness failRestore Valkey or fail over managed endpoint
Pub/sub reconnectLive watches may pauseClients can catch up through /api/v1/changes

Health Monitoring

curl http://127.0.0.1:8005/api/v1/health
curl http://127.0.0.1:8005/api/v1/ready
curl http://127.0.0.1:8005/api/v1/cluster/status

The cluster routes are compatibility-only. status reports Valkey mode; join and remove return 410 Gone because topology belongs to Valkey, not to Unison API workers.