feat: Cloud-native deployment with unified configuration, security hardening, and Ansible automation
Summary
Consolidates the GENIE.AI deployment infrastructure for cloud-native Docker Swarm, rewrites the API gateway, and adds full Ansible automation for idempotent deployments.
Changes by area
1. Docker Compose consolidation
-
Single compose file: Merged
components/docker-compose.yamland GPU-specific compose files (docker-compose-t4.yaml,docker-compose-RTX6000-ADA.yaml) into rootdocker-compose.yaml(Swarm-compatible). -
DEPLOY_OPEAvariable: Controls OPEA service replicas via${DEPLOY_OPEA:-1}(set0to skip GPU services). -
Removed:
depends_ondirectives (Swarm uses healthchecks + restart policy), staleHUGGINGFACEHUB_API_TOKEN. -
Bind mounts: Centralized under
./data/withDATA_DIRvariable. -
GPU env files:
env.t4andenv.rtx6000now contain only GPU-specific overrides (memory, model length, TEI image versions). -
Removed stale files:
env-T4,components/docker-compose.yaml,configs/opea-config/docker-compose*.yaml, per-componentenvfiles, per-componentDockerfile-single-nodefiles.
2. API Gateway overhaul
-
Kong auto-config: Routes/plugins applied by
kong-configone-shot Swarm service — no manual post-deploy script needed. - Internalized Kong ports: Kong no longer exposes ports to the host; only NGINX exposes 80/443.
-
NGINX template-based config: Auto-rendered at startup via
default.conf.template. Uses Docker DNS resolver for lazy upstream hostname resolution (fixes startup race conditions). -
SPA routing fix: Replaced
http-serverwith nginx for proper Vue Router history mode (fixes 404 on page refresh). -
Removed: Entire
api-gateway-solution/old-config/,kong-backups/,journal-check.sh, stale Kong shell scripts (~4,000 lines of legacy automation).
3. Ansible deployment automation (new)
-
deploy/ansible/: Full playbook withinstall,prepare,build,deploytags for granular re-runs. -
Per-environment secrets: Ansible Vault with directory-based
group_vars/<env>/vars.yml+vault.yml. -
Docker/NVIDIA version pinning: Packages held via
dpkg --set-selectionsto prevent accidental upgrades. - Image build caching: Git SHA labels to skip rebuilds when code hasn't changed.
- Local Docker registry: Pushes built images to a local registry for Swarm distribution.
-
.envgeneration: Jinja2 template handles special characters in passwords (avoidssourceissues). -
GPU support:
gpu_env_fileoption (env.t4,env.rtx6000) for GPU-specific model parameters. - Post-deploy verification: Service replica health checks and HTTP smoke tests.
- Teardown playbook: Remove stack with optional volume and registry cleanup.
- SSL certificates: Self-signed generation or provided certs with proper file permissions.
4. Backend cloud-native adaptation
-
Proxy-aware frontend URL: Auth controller derives frontend URL from
X-Forwarded-Proto/X-Forwarded-Hostheaders (proxy deployments). -
Email verification flow: Redirects updated to
/verify-email-successwithstatus/reasonquery params. -
Service config:
db-connection-service.jsandappConfig.jsupdated for centralized env-based configuration.
5. Configuration system (config/)
-
LLM prompts: Three-tier priority system — ENV VAR > FILE (
config/prompts/) > CODE DEFAULT. -
Prompt files:
chatqna-system.txt,chatqna-abstention.txt,label-selector.txt. -
secrets/: Directory structure for SSL certificates with.gitignoreandREADME.md.
6. Documentation
-
CLAUDE.md: AI agent project context with architecture, commands, code standards. -
docs/docker-swarm-setup.md: Comprehensive Docker Swarm deployment guide. -
README_GPU.md: GPU deployment reference (T4, RTX 6000 Ada). -
GENIE.AI-Installation-Configuration-Guide.md: Major rewrite with cloud-native instructions. -
Tech specs: 6 tech specs in
_bmad-output/(API gateway, SPA routing, Kong init, Swarm deployment, Ansible, regression plan).
7. BMAD framework (_bmad/, .claude/commands/)
- Full BMAD framework integration (core 6.0.4, cis 0.1.9, tea 1.7.2) for AI-assisted project management.
- Agent definitions, workflow templates, and skill commands for Claude Code.
Files changed
712 files changed, +101,689 / -24,260 lines
Note: ~60% of the additions are the BMAD framework (
_bmad/) which is a vendored dependency tracked for worktree access.
Test plan
-
Clean stack deploy from scratch ( docker stack rmthendocker stack deploy) -
11 core services at 1/1 replicas -
OPEA services at 0/0 replicas ( DEPLOY_OPEA=0) -
Frontend returns 200 on https://localhost/ -
API health returns 200 through Kong ( https://localhost/api/health) -
docker compose config --env-file .envvalidates without errors -
Ansible playbook syntax check passes ( ansible-playbook --syntax-check) -
Ansible full deploy to test VM (10.0.0.110, RTX 6000 Ada, ports 1080/1443) -
Image build with git SHA caching (skip unchanged) -
Image push to local Docker registry -
SPA routing: page refresh returns 200 (no 404) -
Deploy with DEPLOY_OPEA=1on GPU node and verify full RAG pipeline
Edited by Jérôme Revillard