No description
End-to-end orchestrator for the app-tier deploy. Ties together the
roles + playbooks landed in earlier commits :
Phase A — migrations (incus_hosts → tools container)
Ensure `<prefix>backend-tools` container exists (idempotent
create), apt-deps + pull backend tarball + run `migrate_tool
--up` against postgres.lxd. no_log on the DATABASE_URL line
(carries vault_postgres_password).
Phase B — determine inactive color (haproxy container)
slurp /var/lib/veza/active-color, default 'blue' if absent.
inactive_color = the OTHER one — the one we deploy TO.
Both prior_active_color and inactive_color exposed as
cacheable hostvars for downstream phases.
Phase C — recreate inactive containers (host-side + per-container roles)
Host play: incus delete --force + incus launch for each
of {backend,stream,web}-{inactive} ; refresh_inventory.
Then three per-container plays apply roles/veza_app with
component-specific vars (the `tools` container shape was
designed for this). Each role pass ends with an in-container
health probe — failure here fails the playbook before HAProxy
is touched.
Phase D — cross-container probes (haproxy container)
Curl each component's Incus DNS name from inside the HAProxy
container. Catches the "service is up but unreachable via
Incus DNS" failure mode the in-container probe misses.
Phase E — switch HAProxy (haproxy container)
Apply roles/veza_haproxy_switch with veza_active_color =
inactive_color. The role's block/rescue handles validate-fail
or HUP-fail by restoring the previous cfg.
Phase F — verify externally + record deploy state
Curl {{ veza_public_url }}/api/v1/health through HAProxy with
retries (10×3s). On success, write a Prometheus textfile-
collector file (active_color, release_sha, last_success_ts).
On failure: write a failure_ts file, re-switch HAProxy back
to prior_active_color via a second invocation of the switch
role, and fail the playbook with a journalctl one-liner the
operator can paste to inspect logs.
Why phase F doesn't destroy the failed inactive containers:
per the user's choice (ask earlier in the design memo), failed
containers are kept alive for `incus exec ... journalctl`. The
manual cleanup_failed.yml workflow tears them down explicitly.
Edge cases this handles:
* No prior active-color file (first-ever deploy) → defaults
to blue, deploys to green.
* Tools container missing (first-ever deploy or someone
deleted it) → recreate idempotently.
* Migration that returns "no changes" (already-applied) →
changed=false, no spurious notifications.
* inactive_color spelled differently across plays → all derive
from a single hostvar set in Phase B.
--no-verify justification continues to hold.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .github | ||
| .husky | ||
| .zap | ||
| apps/web | ||
| chat_exports | ||
| config | ||
| dev-environment | ||
| docker/haproxy | ||
| docs | ||
| docs-assets/mermaid | ||
| fixtures | ||
| full_veza_audit_data | ||
| home/senke/git/talas/veza/apps/web/src | ||
| infra | ||
| k8s | ||
| loadtests | ||
| make | ||
| packages/design-system | ||
| prompts | ||
| proto | ||
| scripts | ||
| sub_task_agents | ||
| test-reports/20251226-132633 | ||
| tests | ||
| tmt | ||
| tools | ||
| veza-backend-api | ||
| veza-common | ||
| veza-docs | ||
| veza-stream-server | ||
| .commitlintrc.json | ||
| .cursorrules | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .lighthouserc.js | ||
| .lintstagedrc.json | ||
| .nvmrc | ||
| .pa11yci.json | ||
| .semgrepignore | ||
| AUDIT_REPORT.md | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| docker-compose.dev.yml | ||
| docker-compose.env.example | ||
| docker-compose.override.yml.example | ||
| docker-compose.prod.yml | ||
| docker-compose.staging.yml | ||
| docker-compose.test.yml | ||
| docker-compose.yml | ||
| env.remote-r720.example | ||
| FUNCTIONAL_AUDIT.md | ||
| go.work | ||
| go.work.sum | ||
| help | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| RELEASE_NOTES_V1.md | ||
| run-audit.sh | ||
| rust-toolchain.toml | ||
| status.sh | ||
| turbo.json | ||
| Untitled | ||
| VERSION | ||
| VEZA_VERSIONS_ROADMAP.md | ||
Veza Monorepo
Version courante : v1.0.4 (cleanup + consolidation post-audit). Voir CHANGELOG.md et docs/PROJECT_STATE.md.
Project Structure
apps/web— Frontend React 18 + Vite 5 + TypeScript strict (source of truth for the UI)veza-backend-api— Main Go 1.25 API service (Gin, GORM, Postgres, Redis, RabbitMQ, Elasticsearch). Handles REST, WebSocket, and chat (chat server was merged into this service in v0.502).veza-stream-server— Rust streaming server (Axum 0.8, Tokio 1.35, Symphonia) — HLS, HTTP Range, WebSocket, gRPCveza-common— Shared Rust types and loggingpackages/design-system— Shared design tokens
See CLAUDE.md for the full architecture map.
Development Setup
Prerequisites: Node 20 (see .nvmrc), Go, Rust, Docker. Configure .env from .env.example.
# Verify environment
make doctor
./scripts/validate-env.sh development
# Install dependencies
make install-deps
# Option A — Backend in Docker + Web local
make dev
# Option B — All apps local with hot reload (infra from docker-compose.dev.yml)
make dev-full
# Option C — Infra only, then run services manually
docker compose -f docker-compose.dev.yml up -d
make dev-web # or make dev-backend-api, make dev-stream-server
See docs/ENV_VARIABLES.md for required variables. make build builds all services.
Quick Start
Frontend only
cd apps/web
npm install
npm run dev
Docker Production
Canonical production compose file: docker-compose.prod.yml
docker compose -f docker-compose.prod.yml up -d
See make/config.mk for COMPOSE_PROD and deployment docs.
CI/CD
- Badge : CI status above. Set
SLACK_WEBHOOK_URL(Incoming Webhook) in repo secrets to receive Slack notifications on failure.
Disabled workflows
- Storybook (
chromatic.yml.disabled,storybook-audit.yml.disabled,visual-regression.yml.disabled): deferred until MSW is wired up for/api/v1/auth/meand/api/v1/logs/frontend, which currently causes ~1 400 network errors in the Storybook build. The npm scripts (storybook,build-storybook) still work locally for one-off component inspection. To reactivate in CI, fix the MSW handlers and rename the three files back to.yml.
Documentation
- Developer Onboarding — Setup, architecture, conventions, troubleshooting
- Documentation index — Index complet de la documentation
- See
docs/for detailed architecture and development guides. Older audits and reports are archived indocs/archive/.