-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstart_aura.sh
More file actions
executable file
·130 lines (113 loc) · 3.32 KB
/
start_aura.sh
File metadata and controls
executable file
·130 lines (113 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env bash
echo "+--------------------------------------+"
echo "| AURA System Launcher |"
echo "| Zero-Docker Architecture |"
echo "+--------------------------------------+"
echo ""
# Get the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
# Cleanup Existing Services first
echo "Cleaning up existing AURA services..."
if [ -x "./stop_aura.sh" ]; then
./stop_aura.sh
elif [ -f "./stop_aura.sh" ]; then
bash ./stop_aura.sh
fi
sleep 1
echo "[0/4] Checking environments..."
# AI Service
if [ ! -d "ai-service/venv" ]; then
echo "Creating AI Service venv..."
python3 -m venv ai-service/venv
fi
echo "Installing/Updating AI Service dependencies..."
source ai-service/venv/bin/activate || exit 1
pip install -r ai-service/requirements.txt
deactivate
# Voice Agent
if [ ! -d "voice-agent/venv" ]; then
echo "Creating Voice Agent venv..."
python3 -m venv voice-agent/venv
fi
echo "Installing/Updating Voice Agent dependencies..."
source voice-agent/venv/bin/activate || exit 1
pip install -r voice-agent/requirements.txt
deactivate
echo ""
echo "Environments ready. Starting services..."
echo ""
# Keep track of PIDs
PID_FILE=".aura_pids"
> "$PID_FILE"
# Make sure all children exit when this script exits
trap 'echo "Stopping services..."; bash ./stop_aura.sh; exit 0' INT TERM EXIT
# 1. Token Server
echo "[1/4] Starting Token Server (port 8082)..."
(
cd voice-agent || exit
source venv/bin/activate
python token_server.py
) &
echo $! >> "$PID_FILE"
sleep 2
# 2. Voice Agent
echo "[2/4] Starting Voice Agent..."
TTS_TYPE="qwen"
if [ -f ".env" ]; then
TTS_VAL=$(grep -i "^TTS_TYPE=" .env | cut -d '=' -f2 | tr -d '\r"' | xargs)
if [ -n "$TTS_VAL" ]; then
TTS_TYPE="$TTS_VAL"
fi
fi
if [ "$(echo "$TTS_TYPE" | tr '[:upper:]' '[:lower:]')" = "qwen" ]; then
echo "Detect TTS_TYPE=qwen. Verifying 'aura' conda environment..."
if ! conda env list 2>/dev/null | grep -q "\baura\b"; then
echo "[ERROR] Conda environment 'aura' not found!"
echo "Since you have TTS_TYPE=qwen, this environment is REQUIRED for GPU acceleration."
echo "Please run: conda env create -f voice-agent/environment.yml"
echo "Or change TTS_TYPE=cartesia in .env to use cloud TTS."
echo ""
# cleanup
bash ./stop_aura.sh
exit 1
fi
(
cd voice-agent || exit
eval "$(conda shell.bash hook 2>/dev/null || echo '')"
conda activate aura
python agent.py dev
) &
echo $! >> "$PID_FILE"
else
echo "Detect TTS_TYPE=$TTS_TYPE (Cloud). Using standard venv..."
(
cd voice-agent || exit
source venv/bin/activate
python agent.py dev
) &
echo $! >> "$PID_FILE"
fi
sleep 2
# 3. AI Service
echo "[3/4] Starting AI Service (port 8000)..."
(
cd ai-service || exit
source venv/bin/activate
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
) &
echo $! >> "$PID_FILE"
sleep 2
# 4. Dashboard
echo "[4/4] Starting Dashboard (port 5173)..."
(
cd dashboard || exit
npm run dev -- --host
) &
echo $! >> "$PID_FILE"
sleep 5
echo ""
echo "=========================================================="
echo "All services running! Press CTRL+C to stop them."
echo "=========================================================="
wait