Files
aitbc/docs/project/infrastructure/PRODUCTION_ARCHITECTURE.md
aitbc 40ddf89b9c
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Waiting to run
Documentation Validation / validate-docs (push) Waiting to run
CLI Tests / test-cli (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
docs: update CLI command syntax across workflow documentation
- Updated marketplace commands: `marketplace --action` → `market` subcommands
- Updated wallet commands: direct flags → `wallet` subcommands
- Updated AI commands: `ai-submit`, `ai-status` → `ai submit`, `ai status`
- Updated blockchain commands: `chain` → `blockchain info`
- Standardized command structure across all workflow files
- Affected files: MULTI_NODE_MASTER_INDEX.md, TEST_MASTER_INDEX.md, multi-node-blockchain-marketplace
2026-04-08 12:10:21 +02:00

3.3 KiB

AITBC Production Environment

🏗️ Proper System Architecture

The AITBC production environment follows Linux Filesystem Hierarchy Standard (FHS) compliance:

📁 System Directory Structure

/etc/aitbc/production/          # Production configurations
├── .env                       # Production environment variables
├── blockchain.py              # Blockchain service config
├── database.py                # Database configuration
├── services.py                # Services configuration
└── certs/                     # SSL certificates

/var/lib/aitbc/production/     # Production services and data
├── blockchain.py              # Production blockchain service
├── marketplace.py             # Production marketplace service
├── unified_marketplace.py     # Unified marketplace service
├── openclaw_ai.py             # OpenClaw AI service
└── backups/                   # Production backups

/var/log/aitbc/production/      # Production logs
├── blockchain/                # Blockchain service logs
├── marketplace/               # Marketplace service logs
└── unified_marketplace/       # Unified marketplace logs

🚀 Launching Production Services

Use the production launcher:

# Launch all production services
/opt/aitbc/scripts/production_launcher.py

# Launch individual service
python3 /var/lib/aitbc/production/blockchain.py

⚙️ Configuration Management

Production configurations are stored in /etc/aitbc/production/:

  • Environment variables in .env
  • Service-specific configs in Python modules
  • SSL certificates in certs/

📊 Monitoring and Logs

Production logs are centralized in /var/log/aitbc/production/:

  • Each service has its own log directory
  • Logs rotate automatically
  • Real-time monitoring available

Coordinator observability endpoints:

  • JSON metrics endpoint: http://localhost:8000/v1/metrics
  • Prometheus metrics endpoint: http://localhost:8000/metrics
  • Health endpoint: http://localhost:8000/v1/health
  • Web dashboard source: /opt/aitbc/website/dashboards/metrics.html

Current monitoring flow:

  • FastAPI request middleware records request counts, error counts, response time, and cache stats
  • metrics.py calculates live metric summaries and alert thresholds
  • /v1/metrics returns JSON for dashboard consumption
  • /metrics remains available for Prometheus-style scraping
  • Alert delivery uses webhook dispatch when AITBC_ALERT_WEBHOOK_URL is configured, otherwise alerts are logged locally

🔧 Maintenance

  • Backups: Stored in /var/lib/aitbc/production/backups/
  • Updates: Update code in /opt/aitbc/, restart services
  • Configuration: Edit files in /etc/aitbc/production/

🛡️ Security

  • All production files have proper permissions
  • Keystore remains at /var/lib/aitbc/keystore/
  • Environment variables are protected
  • SSL certificates secured in /etc/aitbc/production/certs/

📋 Migration Complete

The "box in box" structure has been eliminated:

  • Configurations moved to /etc/aitbc/production/
  • Services moved to /var/lib/aitbc/production/
  • Logs centralized in /var/log/aitbc/production/
  • Repository cleaned of production runtime files
  • Proper FHS compliance achieved