Files
aitbc/production/config/services.py
aitbc 8cf185e2f0 feat: upgrade to production-grade systemd services
 Production SystemD Services Upgrade
- Upgraded existing services instead of creating new ones
- Added production-grade configuration with resource limits
- Implemented real database persistence and logging
- Added production monitoring and health checks

 Upgraded Services
- aitbc-blockchain-node.service: Production blockchain with persistence
- aitbc-marketplace.service: Production marketplace with real data
- aitbc-gpu.service: Production GPU marketplace
- aitbc-production-monitor.service: Production monitoring

 Production Features
- Real database persistence (JSON files in /opt/aitbc/production/data/)
- Production logging to /opt/aitbc/production/logs/
- Resource limits (memory, CPU, file handles)
- Security hardening (NoNewPrivileges, ProtectSystem)
- Automatic restart and recovery
- Multi-node deployment (aitbc + aitbc1)

 Service Endpoints
- aitbc (localhost): Marketplace (8002), GPU Marketplace (8003)
- aitbc1 (remote): Marketplace (8004), GPU Marketplace (8005)

 Monitoring
- SystemD journal integration
- Production logs and metrics
- Health check endpoints
- Resource utilization monitoring

🚀 AITBC now running production-grade systemd services!
Real persistence, monitoring, and multi-node deployment operational.
2026-04-02 13:00:59 +02:00

62 lines
1.4 KiB
Python

import os
# Production Services Configuration
SERVICES_CONFIG = {
'blockchain': {
'host': '0.0.0.0',
'port': 8545,
'workers': 4,
'log_level': 'INFO',
'max_connections': 1000
},
'marketplace': {
'host': '0.0.0.0',
'port': 8002,
'workers': 8,
'log_level': 'INFO',
'max_connections': 5000
},
'gpu_marketplace': {
'host': '0.0.0.0',
'port': 8003,
'workers': 4,
'log_level': 'INFO',
'max_connections': 1000
},
'monitoring': {
'host': '0.0.0.0',
'port': 9000,
'workers': 2,
'log_level': 'INFO'
}
}
# Production Logging
LOGGING_CONFIG = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'production': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
}
},
'handlers': {
'file': {
'class': 'logging.handlers.RotatingFileHandler',
'filename': '/opt/aitbc/production/logs/services/aitbc.log',
'maxBytes': 10485760, # 10MB
'backupCount': 5,
'formatter': 'production'
},
'console': {
'class': 'logging.StreamHandler',
'formatter': 'production'
}
},
'root': {
'level': 'INFO',
'handlers': ['file', 'console']
}
}