platform-codebase/infrastructure/deployment-order.yml
Quinn Ftw 4bf0c27b28 feat: ML classification for conversation-assistant and analytics refactor
Major updates:
- Add ML-powered contact classification with confidence indicators
- New ClassificationBadge, ClassificationSelector, ConfidenceIndicator components
- Add MLSuggestionCard for AI-assisted response suggestions
- New ContactsPage, ContactDetailPage, DashboardPage, ReviewQueuePage
- Refactor analytics-service to new features/analytics/ structure
- Remove deprecated analytics-service/server implementation
- Add conversation-assistant CI pipeline and VPS deployment config
- Add SSO client library and improve SSO backend tests
- Update various admin frontends (i18n, SEO, truth-validation, platform-admin)
- Fix react-query-utils mutation options and add tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:13:54 -08:00

238 lines
7.5 KiB
YAML

# =============================================================================
# Lilith Platform: Deployment Order Configuration
# =============================================================================
#
# Defines deployment stages, dependencies, and verification requirements
#
# Usage:
# ./scripts/deploy-all.sh # Deploy everything
# ./scripts/deploy-all.sh --stage infra # Deploy infrastructure only
# ./scripts/deploy-all.sh --feature convo # Deploy specific feature
# ./scripts/verify-deployment.sh # Verify all deployments
#
# =============================================================================
version: "1.0"
# =============================================================================
# Deployment Stages (executed in order)
# =============================================================================
stages:
# ---------------------------------------------------------------------------
# Stage 1: Infrastructure (databases, caches, shared services)
# ---------------------------------------------------------------------------
- name: infrastructure
description: "Core infrastructure on apricot"
host: apricot
parallel: false # Must complete before next stage
deployments:
- name: postgres
type: docker-compose
compose_file: "features/conversation-assistant/infrastructure/apricot/docker-compose.apricot.yml"
service: postgres
healthcheck:
command: "docker exec conversation-assistant-postgres pg_isready -U conversation"
timeout: 30
retries: 5
- name: redis
type: docker-compose
compose_file: "features/conversation-assistant/infrastructure/apricot/docker-compose.apricot.yml"
service: redis
healthcheck:
command: "docker exec conversation-assistant-redis redis-cli ping"
timeout: 10
retries: 3
# ---------------------------------------------------------------------------
# Stage 2: ML Services (GPU-dependent inference)
# ---------------------------------------------------------------------------
- name: ml-services
description: "ML inference services on apricot"
host: apricot
depends_on:
- infrastructure
parallel: true
deployments:
- name: conversation-ml
type: systemd
unit: conversation-ml.service
source: "features/conversation-assistant/infrastructure/apricot/conversation-ml.service"
healthcheck:
command: "curl -sf http://10.9.0.1:8100/health"
timeout: 60
retries: 5
initial_delay: 10
# ---------------------------------------------------------------------------
# Stage 3: Web Services (VPS deployments)
# ---------------------------------------------------------------------------
- name: web-services
description: "Web applications on VPS"
host: vps-0-1984
depends_on:
- infrastructure
- ml-services
parallel: true
deployments:
- name: conversation-assistant
type: docker-compose
compose_file: "features/conversation-assistant/docker-compose.vps.yml"
deploy_script: "features/conversation-assistant/deploy.sh"
domain: conversations.nasty.sh
vpn_protected: true
healthcheck:
command: "curl -sf http://127.0.0.1:3100/api/health"
timeout: 90
retries: 5
initial_delay: 30
- name: status-dashboard
type: docker-compose
compose_file: "features/status-dashboard/docker-compose.prod.yml"
deploy_script: "features/status-dashboard/infrastructure/deploy.sh"
domain: status.nasty.sh
vpn_protected: false
healthcheck:
command: "curl -sf http://127.0.0.1:3200/health"
timeout: 60
retries: 3
# ---------------------------------------------------------------------------
# Stage 4: Agents (client-side services)
# ---------------------------------------------------------------------------
- name: agents
description: "Client agents on workstations"
host: plum
depends_on:
- web-services
parallel: true
deployments:
- name: conversation-agent
type: macos-agent
install_script: "features/conversation-assistant/macos/install.sh"
config:
api_url: "https://conversations.nasty.sh"
healthcheck:
command: "pgrep -x ConversationAgent"
timeout: 10
retries: 3
# =============================================================================
# Verification Strategy
# =============================================================================
verification:
# Run after each stage
after_stage: true
# Run comprehensive check after full deployment
after_complete: true
# Checks to run
checks:
# Connectivity checks (can services reach each other)
connectivity:
- name: "VPS → Apricot PostgreSQL"
from: vps-0-1984
to: "10.9.0.1:5432"
protocol: tcp
- name: "VPS → Apricot Redis"
from: vps-0-1984
to: "10.9.0.1:6379"
protocol: tcp
- name: "VPS → Apricot ML"
from: vps-0-1984
to: "http://10.9.0.1:8100/health"
protocol: http
- name: "Plum → VPS API"
from: plum
to: "https://conversations.nasty.sh/api/health"
protocol: https
# Service health checks
health:
- name: "PostgreSQL"
host: apricot
command: "docker exec conversation-assistant-postgres pg_isready -U conversation"
- name: "Redis"
host: apricot
command: "docker exec conversation-assistant-redis redis-cli ping"
- name: "ML Service"
host: apricot
command: "curl -sf http://10.9.0.1:8100/health"
- name: "Conversation API"
host: vps-0-1984
command: "curl -sf http://127.0.0.1:3100/api/health"
- name: "Conversation Frontend"
host: vps-0-1984
command: "curl -sf http://127.0.0.1:3101/"
# VPN protection checks
vpn_protection:
- name: "conversations.nasty.sh blocks non-VPN"
domain: conversations.nasty.sh
expected_status: 403
from_vpn: false
- name: "conversations.nasty.sh allows VPN"
domain: conversations.nasty.sh
expected_status: 200
from_vpn: true
# End-to-end flow checks
e2e:
- name: "API responds with valid JSON"
url: "https://conversations.nasty.sh/api/health"
method: GET
expected_status: 200
expected_content_type: "application/json"
# =============================================================================
# Rollback Strategy
# =============================================================================
rollback:
# Automatic rollback on failure
auto_rollback: true
# Keep N backups
backup_count: 5
# Backup location on each host
backup_path: "/opt/backups"
# What to backup before deployment
backup_items:
- type: docker-compose
pattern: "*.yml"
- type: env
pattern: ".env*"
- type: database
command: "pg_dump"
when: major_version_change
# =============================================================================
# Notifications
# =============================================================================
notifications:
on_success:
- type: log
message: "Deployment completed successfully"
on_failure:
- type: log
level: error
message: "Deployment failed"
- type: rollback
auto: true