Files
aitbc/scripts/wrappers/aitbc-monitoring-wrapper.py
aitbc d7da8ba880
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Systemd Sync / sync-systemd (push) Successful in 20s
fix: update ai-service module path in systemd service
- Change ExecStart from src.app:app to src.ai_service.main:app in aitbc-ai.service
2026-05-03 22:12:07 +02:00

36 lines
880 B
Python

#!/usr/bin/env python3
"""
Wrapper script for aitbc-monitoring service
Uses centralized aitbc utilities for path configuration
"""
import sys
import os
from pathlib import Path
# Add aitbc to path
sys.path.insert(0, str(Path("/opt/aitbc")))
sys.path.insert(0, str(Path("/opt/aitbc/aitbc")))
from aitbc import ENV_FILE, NODE_ENV_FILE, REPO_DIR, DATA_DIR, LOG_DIR
# Set up environment using aitbc constants
os.environ["AITBC_ENV_FILE"] = str(ENV_FILE)
os.environ["AITBC_NODE_ENV_FILE"] = str(NODE_ENV_FILE)
os.environ["PYTHONPATH"] = f"{REPO_DIR}/apps/monitoring-service/src"
os.environ["DATA_DIR"] = str(DATA_DIR)
os.environ["LOG_DIR"] = str(LOG_DIR)
# Execute the actual service
exec_cmd = [
"/opt/aitbc/venv/bin/python",
"-m",
"uvicorn",
"monitoring_service.main:app",
"--host",
"0.0.0.0",
"--port",
"8002"
]
os.execvp(exec_cmd[0], exec_cmd)