refactor manage.sh from brain service to webui
This commit is contained in:
26
manage.sh
26
manage.sh
@@ -62,7 +62,7 @@ start_commander_service() {
|
||||
venv/bin/python commander/service.py $1
|
||||
}
|
||||
|
||||
start_brain_service() {
|
||||
start_webui_service() {
|
||||
commander_host=$1
|
||||
ENV_FOR_DYNACONF=$commander_host venv/bin/python -m gradio brain/service.py
|
||||
}
|
||||
@@ -172,18 +172,18 @@ elif [ "$1" == "stop-commander" ]; then
|
||||
echo "stopped commander"
|
||||
fi
|
||||
|
||||
elif [ "$1" == "start-brain" ]; then
|
||||
start_brain_service $2 > logs/brain.log 2>&1 &
|
||||
brain_pid=$!
|
||||
echo "started brain service with PID brain_pid"
|
||||
echo brain_pid > $pids_dir/brain_pid.txt
|
||||
elif [ "$1" == "start-webui" ]; then
|
||||
start_webui_service $2 > logs/webui.log 2>&1 &
|
||||
webui_pid=$!
|
||||
echo "started webui service with PID $webui_pid"
|
||||
echo webui_pid > $pids_dir/webui_pid.txt
|
||||
|
||||
elif [ "$1" == "stop-brain" ]; then
|
||||
brain_pid_file="$pids_dir/brain_pid.txt"
|
||||
if [ -f "brain_pid_file" ]; then
|
||||
sudo pkill -15 -P $(cat brain_pid_file)
|
||||
elif [ "$1" == "stop-webui" ]; then
|
||||
webui_pid_file="$pids_dir/webui_pid.txt"
|
||||
if [ -f "webui_pid_file" ]; then
|
||||
sudo pkill -15 -P $(cat webui_pid_file)
|
||||
sudo killport 8890
|
||||
echo "stopped brain service"
|
||||
echo "stopped webui service"
|
||||
fi
|
||||
|
||||
elif [ "$1" == "prepare-flight" ]; then
|
||||
@@ -213,8 +213,8 @@ else
|
||||
- start-/ stop-jupyter (8888)
|
||||
- start-/ stop-cs (8888)
|
||||
- start-/ stop-commander (8889)
|
||||
- start-/ stop-brain [host (tuncel/commander)] (8890)
|
||||
- start-clitalk [host (tuncel/commander_remote/commander_local)]
|
||||
- start-/ stop-webui [commander_host (tuncel / commander)] (8890)
|
||||
- start-/ stop-clitalk [commander_host (tuncel / commander_remote / commander_local)]
|
||||
- turn-off
|
||||
- prepare-/ finish-flight"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user