restructure: eliminate box-in-box production architecture
Some checks failed
Documentation Validation / validate-docs (push) Has been cancelled

- Move production configs from /opt/aitbc/production/config to /etc/aitbc/production
- Move production services from /opt/aitbc/production/services to /var/lib/aitbc/production
- Centralize production logs in /var/log/aitbc/production
- Remove redundant /opt/aitbc/production directory
- Add production launcher script at /opt/aitbc/scripts/production_launcher.py
- Update production services to use system configuration paths
- Create comprehensive production architecture documentation
- Achieve proper FHS compliance with clean separation of concerns
This commit is contained in:
aitbc
2026-04-02 14:20:40 +02:00
parent 48449dfb25
commit 01124d7fc0
17 changed files with 127 additions and 2741 deletions

51
scripts/production_launcher.py Executable file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env python3
"""
Production Services Launcher
Launches AITBC production services from system locations
"""
import os
import sys
import subprocess
from pathlib import Path
def launch_service(service_name: str, script_path: str):
"""Launch a production service"""
print(f"Launching {service_name}...")
# Ensure log directory exists
log_dir = Path(f"/var/log/aitbc/production/{service_name}")
log_dir.mkdir(parents=True, exist_ok=True)
# Launch service
try:
subprocess.run([
sys.executable,
str(Path("/var/lib/aitbc/production") / script_path)
], check=True)
except subprocess.CalledProcessError as e:
print(f"Failed to launch {service_name}: {e}")
return False
except FileNotFoundError:
print(f"Service script not found: {script_path}")
return False
return True
def main():
"""Main launcher"""
print("=== AITBC Production Services Launcher ===")
services = [
("blockchain", "blockchain.py"),
("marketplace", "marketplace.py"),
("unified_marketplace", "unified_marketplace.py"),
]
for service_name, script_path in services:
if not launch_service(service_name, script_path):
print(f"Skipping {service_name} due to error")
continue
if __name__ == "__main__":
main()