forked from UIUC-Chatbot/ai-ta-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-dev.sh
24 lines (19 loc) · 914 Bytes
/
run-dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Starting with Redis Queue. Just run this script!
# ./run-dev.sh
# Function to clean up processes on exit
cleanup() {
echo "Cleaning up processes..."
kill $(lsof -t -i:9181) 2>/dev/null
kill $WORKER_PID 2>/dev/null
kill $FLASK_PID 2>/dev/null
exit 0
}
# Set up trap to catch SIGTERM and other signals
trap cleanup SIGTERM SIGINT SIGQUIT
export PYTHONPATH=${PYTHONPATH}:$(pwd)/ai_ta_backend
# To start the dashboard -- the problem is shutting it down propery on SIGTERM
infisical run --env=dev -- bash -c 'echo "REDIS URL -- redis://:$INGEST_REDIS_PASSWORD@$INGEST_REDIS_HOST:$INGEST_REDIS_PORT"'
infisical run --env=dev -- bash -c 'rq-dashboard --redis-url "redis://:$INGEST_REDIS_PASSWORD@$INGEST_REDIS_HOST:$INGEST_REDIS_PORT"' &
infisical run --env=dev -- python3 ai_ta_backend/redis_queue/worker.py &
infisical run --env=dev -- flask --app ai_ta_backend.main:app --debug run --port 8000