mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
add startup script
This commit is contained in:
parent
f0c3e65c9c
commit
efa73e1f3d
1 changed files with 38 additions and 0 deletions
38
demos/use_cases/rag_agent/start_agents.sh
Normal file
38
demos/use_cases/rag_agent/start_agents.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
WAIT_FOR_PIDS=()
|
||||
|
||||
log() {
|
||||
timestamp=$(python3 -c 'from datetime import datetime; print(datetime.now().strftime("%Y-%m-%d %H:%M:%S,%f")[:23])')
|
||||
message="$*"
|
||||
echo "$timestamp - $message"
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
log "Caught signal, terminating all user processes ..."
|
||||
for PID in "${WAIT_FOR_PIDS[@]}"; do
|
||||
if kill $PID 2> /dev/null; then
|
||||
log "killed process: $PID"
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
log "Starting query_parser agent on port 10500..."
|
||||
uv run python -m rag_agent --rest-server --host 0.0.0.0 --rest-port 10500 --agent query_parser &
|
||||
WAIT_FOR_PIDS+=($!)
|
||||
|
||||
log "Starting content_builder agent on port 10501..."
|
||||
uv run python -m rag_agent --rest-server --host 0.0.0.0 --rest-port 10501 --agent content_builder &
|
||||
WAIT_FOR_PIDS+=($!)
|
||||
|
||||
log "Starting response_generator agent on port 10502..."
|
||||
uv run python -m rag_agent --rest-server --host 0.0.0.0 --rest-port 10502 --agent response_generator &
|
||||
WAIT_FOR_PIDS+=($!)
|
||||
|
||||
for PID in "${WAIT_FOR_PIDS[@]}"; do
|
||||
wait "$PID"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue