Consolidate service scripts into apps directories
- Move blockchain scripts to apps/blockchain-node/scripts/ - Move marketplace scripts to apps/marketplace/scripts/ - Move agent daemon to apps/agent-coordinator/scripts/ - Move monitor to apps/monitor/ - Update systemd service files to point to new locations - Update internal path references in moved scripts - Remove empty /opt/aitbc/services directory
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
temp123
|
|
||||||
@@ -22,13 +22,13 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
os.environ.setdefault('PYTHONPATH', '/opt/aitbc/services')
|
os.environ.setdefault('PYTHONPATH', '/opt/aitbc/apps/marketplace/scripts:/opt/aitbc/apps/marketplace/src:/opt/aitbc/apps/coordinator-api/src')
|
||||||
|
|
||||||
# Try to run the GPU marketplace service
|
# Try to run the GPU marketplace service
|
||||||
logger.info("Launching GPU marketplace service")
|
logger.info("Launching GPU marketplace service")
|
||||||
|
|
||||||
# Check if the main marketplace service exists
|
# Check if the main marketplace service exists
|
||||||
marketplace_path = '/opt/aitbc/services/marketplace.py'
|
marketplace_path = '/opt/aitbc/apps/marketplace/scripts/marketplace.py'
|
||||||
if os.path.exists(marketplace_path):
|
if os.path.exists(marketplace_path):
|
||||||
logger.info("Found marketplace service, launching...")
|
logger.info("Found marketplace service, launching...")
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
@@ -21,7 +21,7 @@ def main():
|
|||||||
logger.info("Launching real marketplace service")
|
logger.info("Launching real marketplace service")
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
'/opt/aitbc/venv/bin/python',
|
'/opt/aitbc/venv/bin/python',
|
||||||
'/opt/aitbc/services/marketplace.py'
|
'/opt/aitbc/apps/marketplace/scripts/marketplace.py'
|
||||||
], check=True)
|
], check=True)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
logger.error(f"Marketplace service failed with exit code {e.returncode}: {e}")
|
logger.error(f"Marketplace service failed with exit code {e.returncode}: {e}")
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# AITBC GPU Miner Startup Script
|
# AITBC GPU Miner Startup Script
|
||||||
@@ -25,12 +26,14 @@ fi
|
|||||||
|
|
||||||
echo "✅ Ollama is running"
|
echo "✅ Ollama is running"
|
||||||
|
|
||||||
# Check GPU
|
# Check GPU (NVIDIA required)
|
||||||
if command -v nvidia-smi &> /dev/null; then
|
if command -v nvidia-smi &> /dev/null; then
|
||||||
echo "GPU detected:"
|
echo "GPU detected:"
|
||||||
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
|
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
|
||||||
else
|
else
|
||||||
echo "⚠️ No NVIDIA GPU detected (CPU-only mode)"
|
echo "❌ No NVIDIA GPU detected"
|
||||||
|
echo "NVIDIA GPU is required for GPU mining"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Register miner
|
# Register miner
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ SERVICE_STARTUP_TIMEOUT=60
|
|||||||
# === EXAMPLE VALUES ===
|
# === EXAMPLE VALUES ===
|
||||||
# CONTAINER_NAME="aitbc"
|
# CONTAINER_NAME="aitbc"
|
||||||
# CONTAINER_IP="192.168.1.100"
|
# CONTAINER_IP="192.168.1.100"
|
||||||
# PROJECT_DIR="/home/user/aitbc"
|
# PROJECT_DIR="/opt/aitbc"
|
||||||
# SSH_ALIAS="user@container-ip"
|
# SSH_ALIAS="user@container-ip"
|
||||||
# SSH_KEY_PATH="/home/user/.ssh/id_rsa"
|
# SSH_KEY_PATH="/home/user/.ssh/id_rsa"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ WorkingDirectory=/opt/aitbc
|
|||||||
EnvironmentFile=/etc/aitbc/.env
|
EnvironmentFile=/etc/aitbc/.env
|
||||||
EnvironmentFile=/etc/aitbc/node.env
|
EnvironmentFile=/etc/aitbc/node.env
|
||||||
Environment="PATH=/opt/aitbc/venv/bin:/usr/local/bin:/usr/bin:/bin"
|
Environment="PATH=/opt/aitbc/venv/bin:/usr/local/bin:/usr/bin:/bin"
|
||||||
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/services/agent_daemon.py \
|
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/apps/agent-coordinator/scripts/agent_daemon.py \
|
||||||
--wallet temp-agent \
|
--wallet temp-agent \
|
||||||
--address ait1d18e286fc0c12888aca94732b5507c8787af71a5 \
|
--address ait1d18e286fc0c12888aca94732b5507c8787af71a5 \
|
||||||
--password-file /var/lib/aitbc/keystore/.agent_daemon_password \
|
--password-file /var/lib/aitbc/keystore/.agent_daemon_password \
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ User=root
|
|||||||
Group=root
|
Group=root
|
||||||
WorkingDirectory=/opt/aitbc
|
WorkingDirectory=/opt/aitbc
|
||||||
Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin
|
Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
Environment=PYTHONPATH=/opt/aitbc/services
|
Environment=PYTHONPATH=/opt/aitbc/apps/marketplace/scripts:/opt/aitbc/apps/marketplace/src:/opt/aitbc/apps/coordinator-api/src
|
||||||
EnvironmentFile=/etc/aitbc/.env
|
EnvironmentFile=/etc/aitbc/.env
|
||||||
EnvironmentFile=/etc/aitbc/node.env
|
EnvironmentFile=/etc/aitbc/node.env
|
||||||
|
|
||||||
# Production execution
|
# Production execution
|
||||||
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/services/marketplace.py
|
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/apps/marketplace/scripts/marketplace.py
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
TimeoutStopSec=10
|
TimeoutStopSec=10
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ EnvironmentFile=/etc/aitbc/.env
|
|||||||
EnvironmentFile=/etc/aitbc/node.env
|
EnvironmentFile=/etc/aitbc/node.env
|
||||||
|
|
||||||
# Monitor execution
|
# Monitor execution
|
||||||
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/services/monitor.py
|
ExecStart=/opt/aitbc/venv/bin/python /opt/aitbc/apps/monitor/monitor.py
|
||||||
|
|
||||||
# Production reliability
|
# Production reliability
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|||||||
Reference in New Issue
Block a user