mirror of
https://github.com/katanemo/plano.git
synced 2026-07-05 15:52:12 +02:00
45 lines
1.1 KiB
Bash
Executable file
45 lines
1.1 KiB
Bash
Executable file
#!/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 agent 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 weather agent on port 10510..."
|
|
uv run python -m travel_agents --host 0.0.0.0 --port 10510 --agent weather &
|
|
WAIT_FOR_PIDS+=($!)
|
|
|
|
log "Starting flight agent on port 10520..."
|
|
uv run python -m travel_agents --host 0.0.0.0 --port 10520 --agent flight &
|
|
WAIT_FOR_PIDS+=($!)
|
|
|
|
log "Starting hotel agent on port 10530..."
|
|
uv run python -m travel_agents --host 0.0.0.0 --port 10530 --agent hotel &
|
|
WAIT_FOR_PIDS+=($!)
|
|
|
|
log "All agents started successfully!"
|
|
log " - Weather Agent: http://localhost:10510"
|
|
log " - Flight Agent: http://localhost:10520"
|
|
log " - Hotel Agent: http://localhost:10530"
|
|
log ""
|
|
log "Waiting for agents to run..."
|
|
|
|
for PID in "${WAIT_FOR_PIDS[@]}"; do
|
|
wait "$PID"
|
|
done
|