HeliosDB Phase 1 Staging Deployment Guide
HeliosDB Phase 1 Staging Deployment Guide
Version: 7.0.0 Environment: Staging Features: Conversational BI, Auto-Compliance, Embedded+Cloud Unified Last Updated: 2025-11-17
Table of Contents
- Overview
- Prerequisites
- Pre-Deployment Checklist
- Deployment Methods
- Configuration
- Deployment Steps
- Post-Deployment Validation
- Troubleshooting
Overview
This guide provides step-by-step instructions for deploying HeliosDB Phase 1 production-ready features to the staging environment. The deployment includes:
- Conversational BI Service - Natural language to SQL with LLM integration
- Auto-Compliance Service - SOC2, GDPR, HIPAA, PCI-DSS, ISO27001 compliance automation
- Embedded+Cloud Sync Service - Unified embedded and cloud database with offline support
Architecture
┌─────────────────────────────────────────────────────────┐│ Load Balancer (Nginx) ││ HTTPS / Rate Limiting / Routing │└────────────────────┬────────────────────────────────────┘ │ ┌────────────┼────────────┐ │ │ │ ▼ ▼ ▼┌──────────────┐ ┌──────────────┐ ┌──────────────┐│Conversational│ │Auto-Compliance│ │Embedded+Cloud││BI Service │ │Service │ │Sync Service ││:8081 │ │:8082 :8090 │ │:8083 :8084 │└──────┬───────┘ └──────┬────────┘ └──────┬───────┘ │ │ │ ▼ ▼ ▼┌──────────────────────────────────────────────┐│ Shared Infrastructure ││ PostgreSQL │ Redis │ Prometheus │Grafana │└──────────────────────────────────────────────┘Prerequisites
System Requirements
Minimum (Development/Testing):
- CPU: 8 cores
- RAM: 16 GB
- Disk: 100 GB SSD
- Network: 1 Gbps
Recommended (Staging):
- CPU: 16 cores
- RAM: 32 GB
- Disk: 500 GB SSD (NVMe preferred)
- Network: 10 Gbps
Software Dependencies
- Docker: >= 24.0.0
- Docker Compose: >= 2.20.0
- Kubernetes (optional): >= 1.28
- Git: >= 2.40.0
- curl: Latest
- OpenSSL: >= 3.0
External Services
Required:
-
LLM API Access (at least one):
- OpenAI API key (GPT-4 recommended)
- Anthropic API key (Claude 3.5 Sonnet)
- Cohere API key
-
Cloud Storage (for Embedded+Cloud):
- AWS S3 bucket + credentials, OR
- S3-compatible storage (MinIO, DigitalOcean Spaces, etc.)
Optional:
- Email SMTP (for Compliance alerts)
- Monitoring Integration (PagerDuty, Slack, etc.)
Pre-Deployment Checklist
1. Infrastructure Preparation
- Provision compute resources (VMs, cloud instances, or Kubernetes cluster)
- Configure network security groups/firewall rules
- Set up DNS records (if using domain names)
- Provision persistent storage volumes
- Configure backup infrastructure
2. Credentials and Secrets
- Obtain LLM API keys (OpenAI/Anthropic/Cohere)
- Generate strong passwords for PostgreSQL and Redis
- Set up AWS/S3 credentials for cloud storage
- Configure SMTP credentials (if using email alerts)
- Create Grafana admin password
3. Code and Builds
- Clone HeliosDB repository
- Checkout v7.0.0 tag
- Verify all source code is present
- Review and customize configuration files
4. Environment Configuration
- Copy
.env.exampleto.env - Fill in all required environment variables
- Validate configuration file syntax
- Review resource limits and quotas
Deployment Methods
HeliosDB Phase 1 supports two primary deployment methods:
Method 1: Docker Compose (Recommended for Single-Node Staging)
Pros:
- Simple, single-command deployment
- Easier to debug and troubleshoot
- Lower resource overhead
- Fast iteration during testing
Cons:
- No high availability
- Limited scalability
- Manual load balancing
Use When:
- Deploying to a single server/VM
- Rapid testing and validation
- Development or staging environments
Method 2: Kubernetes (Recommended for Production-Like Staging)
Pros:
- High availability and self-healing
- Horizontal scalability
- Built-in service discovery and load balancing
- Production parity
Cons:
- Higher complexity
- More resource overhead
- Steeper learning curve
Use When:
- Multi-node deployment
- Production-like staging environment
- Need for high availability
- Load testing at scale
Configuration
Environment Variables
Copy the template and customize:
cd /home/claude/HeliosDB/deployment/stagingcp .env.example .envEdit .env with your values:
# DatabasePOSTGRES_PASSWORD=<strong-random-password>REDIS_PASSWORD=<strong-random-password>
# LLM APIs (at least one required)OPENAI_API_KEY=sk-...ANTHROPIC_API_KEY=sk-ant-...COHERE_API_KEY=...
# Cloud Storage (for Embedded+Cloud)S3_BUCKET=heliosdb-sync-stagingS3_REGION=us-east-1S3_ACCESS_KEY_ID=AKIA...S3_SECRET_ACCESS_KEY=...
# Compliance (optional email alerts)ALERT_EMAIL_ENABLED=trueALERT_EMAIL_SMTP_HOST=smtp.gmail.comALERT_EMAIL_SMTP_PORT=587ALERT_EMAIL_FROM=compliance@yourdomain.comALERT_EMAIL_TO=admin@yourdomain.com
# MonitoringGRAFANA_ADMIN_PASSWORD=<strong-random-password>Validation
Validate your .env file:
# Check for missing required variablesgrep -E "^(POSTGRES_PASSWORD|REDIS_PASSWORD|OPENAI_API_KEY|S3_BUCKET)=" .env || echo "Missing required variables!"
# Check for placeholder valuesgrep "changeme\|your-.*-here" .env && echo "WARNING: Found placeholder values!"Deployment Steps
Method 1: Docker Compose Deployment
Step 1: Build Docker Images
cd /home/claude/HeliosDB
# Build all service imagesdocker compose -f deployment/staging/docker-compose.yml build
# Verify images were createddocker images | grep heliosdbExpected output:
heliosdb-conversational-bi latest ... ... ...heliosdb-compliance latest ... ... ...heliosdb-embedded-cloud latest ... ... ...Step 2: Start Infrastructure Services
# Start PostgreSQL and Redis firstdocker compose -f deployment/staging/docker-compose.yml up -d postgres redis
# Wait for services to be healthydocker compose -f deployment/staging/docker-compose.yml ps
# Check logsdocker compose -f deployment/staging/docker-compose.yml logs postgres redisStep 3: Initialize Database
# Run database migrations (if applicable)# docker compose -f deployment/staging/docker-compose.yml run --rm conversational-bi migrate
# Verify database is accessibledocker compose -f deployment/staging/docker-compose.yml exec postgres \ psql -U heliosdb_admin -d heliosdb -c "SELECT version();"Step 4: Start Feature Services
# Start all feature servicesdocker compose -f deployment/staging/docker-compose.yml up -d \ conversational-bi \ compliance \ embedded-cloud-sync
# Wait for services to be healthy (this may take 1-2 minutes)watch -n 2 'docker compose -f deployment/staging/docker-compose.yml ps'Step 5: Start Monitoring Stack
# Start Prometheus and Grafanadocker compose -f deployment/staging/docker-compose.yml up -d prometheus grafana
# Verify Prometheus is scraping metricscurl http://localhost:9090/api/v1/targetsStep 6: Start Load Balancer
# Start Nginxdocker compose -f deployment/staging/docker-compose.yml up -d nginx
# Verify Nginx is routing correctlycurl http://localhost/healthStep 7: Verify All Services
# Check all containers are runningdocker compose -f deployment/staging/docker-compose.yml ps
# Expected: All services in "Up" state and healthyMethod 2: Kubernetes Deployment
Step 1: Prepare Kubernetes Cluster
# Verify kubectl is configuredkubectl cluster-info
# Create namespacekubectl apply -f /home/claude/HeliosDB/deployment/staging/kubernetes/00-namespace.yaml
# Verify namespacekubectl get namespace heliosdb-stagingStep 2: Create Secrets
# Create secrets from .env filekubectl create secret generic heliosdb-secrets \ --from-env-file=/home/claude/HeliosDB/deployment/staging/.env \ --namespace=heliosdb-staging
# Verify secretkubectl get secrets -n heliosdb-stagingStep 3: Deploy Infrastructure
# Deploy PostgreSQLkubectl apply -f deployment/staging/kubernetes/postgres-statefulset.yaml
# Deploy Rediskubectl apply -f deployment/staging/kubernetes/redis-deployment.yaml
# Wait for readykubectl wait --for=condition=ready pod -l app=postgres -n heliosdb-staging --timeout=300skubectl wait --for=condition=ready pod -l app=redis -n heliosdb-staging --timeout=300sStep 4: Deploy Feature Services
# Deploy Conversational BIkubectl apply -f deployment/staging/kubernetes/conversational-bi-deployment.yaml
# Deploy Compliancekubectl apply -f deployment/staging/kubernetes/compliance-deployment.yaml
# Deploy Embedded+Cloudkubectl apply -f deployment/staging/kubernetes/embedded-cloud-deployment.yaml
# Wait for readykubectl wait --for=condition=available deployment --all -n heliosdb-staging --timeout=600sStep 5: Deploy Monitoring
# Deploy Prometheuskubectl apply -f deployment/staging/kubernetes/prometheus-deployment.yaml
# Deploy Grafanakubectl apply -f deployment/staging/kubernetes/grafana-deployment.yaml
# Wait for readykubectl wait --for=condition=ready pod -l app=prometheus -n heliosdb-staging --timeout=300skubectl wait --for=condition=ready pod -l app=grafana -n heliosdb-staging --timeout=300sStep 6: Deploy Ingress
# Deploy Ingress controller (if not already installed)kubectl apply -f deployment/staging/kubernetes/ingress.yaml
# Get Ingress IPkubectl get ingress -n heliosdb-stagingPost-Deployment Validation
1. Service Health Checks
Docker Compose:
# Check service healthcurl http://localhost:8081/health # Conversational BIcurl http://localhost:8082/health # Compliancecurl http://localhost:8083/health # Embedded+Cloud
# All should return: {"status": "healthy"}Kubernetes:
# Check pod statuskubectl get pods -n heliosdb-staging
# Check service endpointskubectl get endpoints -n heliosdb-staging
# Test health checkskubectl exec -it -n heliosdb-staging deployment/conversational-bi -- curl http://localhost:8081/health2. Smoke Tests
Conversational BI:
# Test NL2SQL endpointcurl -X POST http://localhost:8081/api/v1/query \ -H "Content-Type: application/json" \ -d '{ "question": "Show me all users created in the last 7 days", "database": "heliosdb" }'
# Expected: Valid SQL query responseCompliance:
# Test compliance check endpointcurl http://localhost:8082/api/v1/compliance/status
# Expected: Compliance framework statusEmbedded+Cloud:
# Test sync endpointcurl http://localhost:8083/api/v1/sync/status
# Expected: Sync service status3. Monitoring Validation
Prometheus:
# Access Prometheus UIopen http://localhost:9090
# Verify targets are upcurl http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | {job: .labels.job, health: .health}'
# Expected: All targets showing "up"Grafana:
# Access Grafana UIopen http://localhost:3000
# Login with credentials from .env# Username: admin# Password: <GRAFANA_ADMIN_PASSWORD>
# Verify dashboards:# - HeliosDB Conversational BI - Production Metrics# - HeliosDB Auto-Compliance - Production Metrics# - HeliosDB Embedded+Cloud Unified - Production Metrics4. Metrics Validation
# Check Conversational BI metricscurl http://localhost:9091/metrics | grep heliosdb_conversational_bi
# Check Compliance metricscurl http://localhost:9092/metrics | grep heliosdb_compliance
# Check Embedded+Cloud metricscurl http://localhost:9093/metrics | grep heliosdb_embedded_cloud5. Log Validation
Docker Compose:
# View service logsdocker compose -f deployment/staging/docker-compose.yml logs -f conversational-bidocker compose -f deployment/staging/docker-compose.yml logs -f compliancedocker compose -f deployment/staging/docker-compose.yml logs -f embedded-cloud-sync
# Check for errorsdocker compose -f deployment/staging/docker-compose.yml logs | grep -i errorKubernetes:
# View service logskubectl logs -f -n heliosdb-staging deployment/conversational-bikubectl logs -f -n heliosdb-staging deployment/compliancekubectl logs -f -n heliosdb-staging deployment/embedded-cloud-sync
# Check for errorskubectl logs -n heliosdb-staging --all-containers=true | grep -i errorTroubleshooting
Common Issues
Issue 1: Service Won’t Start
Symptoms:
- Container exits immediately
- Health check fails
- “Unhealthy” status
Diagnosis:
# Check logsdocker compose -f deployment/staging/docker-compose.yml logs <service-name>
# Check container statusdocker compose -f deployment/staging/docker-compose.yml psCommon Causes:
- Missing environment variables
- Database connection failure
- Port conflict
- Insufficient resources
Solutions:
# 1. Validate environment variablesdocker compose -f deployment/staging/docker-compose.yml config
# 2. Test database connectivitydocker compose -f deployment/staging/docker-compose.yml exec <service> \ nc -zv postgres 5432
# 3. Check port availabilityss -tulpn | grep <port>
# 4. Check resource usagedocker statsIssue 2: High Memory Usage
Symptoms:
- Container OOM kills
- Slow performance
- Service restarts
Diagnosis:
# Check memory usagedocker stats --no-stream
# Check container limitsdocker inspect <container-id> | jq '.[].HostConfig.Memory'Solutions:
# Increase memory limits in docker-compose.yml# Under deploy.resources.limits.memory
# Restart service with new limitsdocker compose -f deployment/staging/docker-compose.yml up -d --force-recreate <service>Issue 3: LLM API Errors
Symptoms:
- “API key invalid” errors
- High latency
- Rate limit errors
Diagnosis:
# Check Conversational BI logsdocker compose -f deployment/staging/docker-compose.yml logs conversational-bi | grep -i "llm\|api"
# Check metricscurl http://localhost:9091/metrics | grep llm_errorsSolutions:
- Verify API keys are correct
- Check API rate limits
- Switch to alternate LLM provider
- Increase rate limit settings
Issue 4: Database Connection Issues
Symptoms:
- “Connection refused”
- “Too many connections”
- Timeout errors
Diagnosis:
# Check PostgreSQL is runningdocker compose -f deployment/staging/docker-compose.yml ps postgres
# Check PostgreSQL logsdocker compose -f deployment/staging/docker-compose.yml logs postgres
# Check connection countdocker compose -f deployment/staging/docker-compose.yml exec postgres \ psql -U heliosdb_admin -d heliosdb -c "SELECT count(*) FROM pg_stat_activity;"Solutions:
# 1. Restart PostgreSQLdocker compose -f deployment/staging/docker-compose.yml restart postgres
# 2. Increase max connections (in postgres config)# Edit deployment/staging/configs/postgres/postgresql.conf# max_connections = 200
# 3. Restart all servicesdocker compose -f deployment/staging/docker-compose.yml restartIssue 5: Monitoring Not Working
Symptoms:
- Grafana shows “No data”
- Prometheus can’t reach targets
- Metrics not updating
Diagnosis:
# Check Prometheus targetscurl http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | select(.health != "up")'
# Check Prometheus logsdocker compose -f deployment/staging/docker-compose.yml logs prometheus
# Check service metrics endpointscurl http://localhost:9091/metrics # Conversational BIcurl http://localhost:9092/metrics # Compliancecurl http://localhost:9093/metrics # Embedded+CloudSolutions:
- Verify Prometheus configuration
- Check network connectivity between services
- Restart monitoring stack
- Verify firewall rules
Next Steps
After successful deployment:
- Review Monitoring: Check Grafana dashboards for baseline metrics
- Configure Alerts: Set up alert notifications (see MONITORING_GUIDE.md)
- Load Testing: Run validation tests (see VALIDATION_TEST_SUITE.md)
- Documentation: Update deployment notes with any customizations
- Backups: Configure automated backups (see BACKUP_PROCEDURES.md)
Support and Resources
- Deployment Issues: See TROUBLESHOOTING.md
- Rollback Procedures: See ROLLBACK_PROCEDURES.md
- Incident Response: See INCIDENT_RESPONSE.md
- Performance Tuning: See PERFORMANCE_TUNING.md
- Monitoring Guide: See MONITORING_GUIDE.md
Deployment Complete! Your HeliosDB Phase 1 staging environment is now operational.