1.5 KiB
1.5 KiB
WESP Orchestrator — production deploy
Bootstrap
- Copy env template and run install secrets (
site/scripts/or admin UI). - Start stack:
docker compose -f site/infra/docker/docker-compose.prod.yml up -d. - Run migrations:
docker compose exec api alembic upgrade head. - Sync WESP static UI:
site/scripts/sync-wesp-ui.sh.
Hub pairing
- Open Enterprise cabinet → Generate pairing code.
- On farm hub (K-hub server role): Admin → Orchestrator sync → enter VPS URL + code.
- Verify heartbeat and sync metrics in cabinet.
Worker
- Default loop:
python -m app.worker(reconcile every 5 min). - Celery (recommended prod):
celery -A app.celery_app worker --loglevel=info(servicecelery-workerin compose).
Hub (WESP)
- Run migration:
flask db upgrade(revision0025/web_user_lab_access→ orchestrator tables). - Configure orchestrator sync in hub admin (URL + pairing code).
- Catalog edits enqueue
orchestrator_outbox; reports enqueuereport_outbox.
nginx
- Zootech static:
/recipes,/components, … →public/wesp/*.html(seeinfra/nginx/default.tls.conf). - API:
/api/→ FastAPI.
Security checklist
- Rotate
JWT_ACCESS_SECRET,JWT_REFRESH_PEPPER, hub API keys. - Enable PostgreSQL RLS in production (
DATABASE_URL=postgresql+psycopg://...). - Review
site/docs/security.mdbefore go-live.
Tests (CI gate)
cd site/apps/api && .venv/bin/python -m pytest tests/modules/sync/test_orchestrator_dual_hub_e2e.py -q
Dual-hub E2E must pass before merge.