Skip to content

kill the startup script if python fails to start (#237) #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/startup_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ source scripts/load_nvm.sh > /dev/null
# start Python backend
cd llm-service
mkdir -p $MLFLOW_RECONCILER_DATA_PATH
uv run fastapi run --reload --host 127.0.0.1 --port 8081 2>&1 &

uv run fastapi run --host 127.0.0.1 --port 8081 2>&1 &
PY_BACKGROUND_PID=$!
# wait for the python backend to be ready
while ! curl --output /dev/null --silent --fail http://localhost:8081/amp; do
if ! kill -0 "$PY_BACKGROUND_PID" 2>/dev/null; then
echo "Python backend process exited unexpectedly."
exit 1
fi
echo "Waiting for the Python backend to be ready..."
sleep 4
done
Expand Down
Loading