Compare commits
2 Commits
fd3ba4a62d
...
a9c2ebe3f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9c2ebe3f7 | ||
|
|
e7eecacf9b |
@@ -3,7 +3,7 @@ Models package for the AITBC Coordinator API
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Import basic types from types.py to avoid circular imports
|
# Import basic types from types.py to avoid circular imports
|
||||||
from ..types import (
|
from ..custom_types import (
|
||||||
JobState,
|
JobState,
|
||||||
Constraints,
|
Constraints,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
from ..deps import require_client_key
|
from ..deps import require_client_key
|
||||||
from ..schemas import JobCreate, JobView, JobResult, JobPaymentCreate
|
from ..schemas import JobCreate, JobView, JobResult, JobPaymentCreate
|
||||||
from ..types import JobState
|
from ..custom_types import JobState
|
||||||
from ..services import JobService
|
from ..services import JobService
|
||||||
from ..services.payments import PaymentService
|
from ..services.payments import PaymentService
|
||||||
from ..config import settings
|
from ..config import settings
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import re
|
|||||||
|
|
||||||
from pydantic import BaseModel, Field, ConfigDict, field_validator, model_validator
|
from pydantic import BaseModel, Field, ConfigDict, field_validator, model_validator
|
||||||
|
|
||||||
from ..types import JobState, Constraints
|
from ..custom_types import JobState, Constraints
|
||||||
|
|
||||||
|
|
||||||
# Payment schemas
|
# Payment schemas
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
5d21312e467c438bbfcd035f2c65ba815ee326bf
|
9153d888e5ca0923a494b5c849cffd15125abc46
|
||||||
|
|||||||
73
health-check.sh
Executable file
73
health-check.sh
Executable file
@@ -0,0 +1,73 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# AITBC Health Check Script
|
||||||
|
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
check_service() {
|
||||||
|
local name=$1
|
||||||
|
local url=$2
|
||||||
|
local expected=${3:-200}
|
||||||
|
|
||||||
|
if curl -s -o /dev/null -w "%{http_code}" "$url" | grep -q "$expected"; then
|
||||||
|
echo -e "${GREEN}✓${NC} $name is healthy"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} $name is unhealthy"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "AITBC Service Health Check"
|
||||||
|
echo "========================"
|
||||||
|
|
||||||
|
# Core Services (8000-8009)
|
||||||
|
echo ""
|
||||||
|
echo "🔧 Core Services (8000-8009):"
|
||||||
|
check_service "Coordinator API" "http://localhost:8000/health"
|
||||||
|
check_service "Exchange API" "http://localhost:8001/api/health"
|
||||||
|
check_service "Marketplace API" "http://localhost:8002/health"
|
||||||
|
check_service "Wallet API" "http://localhost:8003/health"
|
||||||
|
check_service "Explorer" "http://localhost:8004/health"
|
||||||
|
check_service "Web UI" "http://localhost:8007/health"
|
||||||
|
|
||||||
|
# Check blockchain node and RPC
|
||||||
|
echo ""
|
||||||
|
echo "⛓️ Blockchain Services:"
|
||||||
|
if systemctl is-active --quiet aitbc-blockchain-node.service; then
|
||||||
|
echo -e "${GREEN}✓${NC} Blockchain Node is running"
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} Blockchain Node is not running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if systemctl is-active --quiet aitbc-blockchain-rpc.service; then
|
||||||
|
echo -e "${GREEN}✓${NC} Blockchain RPC (port 8006) is running"
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} Blockchain RPC (port 8006) is not running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# AI/Agent/GPU Services (8010-8019)
|
||||||
|
echo ""
|
||||||
|
echo "🚀 AI/Agent/GPU Services (8010-8019):"
|
||||||
|
check_service "GPU Service" "http://localhost:8010/health"
|
||||||
|
check_service "Learning Service" "http://localhost:8011/health"
|
||||||
|
check_service "Agent Coordinator" "http://localhost:8012/health"
|
||||||
|
check_service "Agent Registry" "http://localhost:8013/health"
|
||||||
|
check_service "OpenClaw Service" "http://localhost:8014/health"
|
||||||
|
check_service "AI Service" "http://localhost:8015/health"
|
||||||
|
|
||||||
|
# Other Services (8020-8029)
|
||||||
|
echo ""
|
||||||
|
echo "📊 Other Services (8020-8029):"
|
||||||
|
check_service "Multimodal Service" "http://localhost:8020/health"
|
||||||
|
check_service "Modality Optimization" "http://localhost:8021/health"
|
||||||
|
|
||||||
|
# Check process status
|
||||||
|
echo ""
|
||||||
|
echo "Process Status:"
|
||||||
|
ps aux | grep -E "simple_daemon|uvicorn|simple_exchange_api" | grep -v grep | while read line; do
|
||||||
|
echo -e "${GREEN}✓${NC} $line"
|
||||||
|
done
|
||||||
10
setup.sh
10
setup.sh
@@ -68,15 +68,15 @@ check_prerequisites() {
|
|||||||
clone_repo() {
|
clone_repo() {
|
||||||
log "Cloning AITBC repository..."
|
log "Cloning AITBC repository..."
|
||||||
|
|
||||||
# Remove existing installation if present
|
# Check if repository already exists
|
||||||
if [ -d "/opt/aitbc" ]; then
|
if [ -d "/opt/aitbc/.git" ]; then
|
||||||
warning "Removing existing /opt/aitbc"
|
success "AITBC repository already exists, skipping clone"
|
||||||
rm -rf /opt/aitbc
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
cd /opt
|
cd /opt
|
||||||
git clone https://github.com/aitbc/aitbc.git aitbc || error "Failed to clone repository"
|
git clone http://gitea.bubuit.net:3000/oib/aitbc.git aitbc || error "Failed to clone repository"
|
||||||
|
|
||||||
cd /opt/aitbc
|
cd /opt/aitbc
|
||||||
success "Repository cloned successfully"
|
success "Repository cloned successfully"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/home/oib/aitbc/apps/coordinator-api
|
WorkingDirectory=/opt/aitbc/apps/coordinator-api/src/app
|
||||||
Environment=PYTHONPATH=/home/oib/aitbc/apps/coordinator-api/src:/opt/aitbc/packages/py/aitbc-sdk/src:/opt/aitbc/packages/py/aitbc-crypto/src
|
Environment=PYTHONPATH=/opt/aitbc/apps/coordinator-api/src:/opt/aitbc/packages/py/aitbc-sdk/src:/opt/aitbc/packages/py/aitbc-crypto/src
|
||||||
ExecStart=/opt/aitbc/venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 8000
|
ExecStart=/opt/aitbc/venv/bin/python -m uvicorn main:app --host 0.0.0.0 --port 8000
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
|
|||||||
Reference in New Issue
Block a user