From 113e1f611eb8dc34f76e9eb5a48765f0fd2db9ba Mon Sep 17 00:00:00 2001 From: ethanknights Date: Mon, 15 Jan 2024 23:05:03 +0000 Subject: [PATCH] run.sh to cover e2e setup --- run.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 69c0b3b..fed09ed 100755 --- a/run.sh +++ b/run.sh @@ -1,11 +1,20 @@ #!/bin/bash -# Purpose: Run streamlit application, ensuring that the `src` sub-modules are in the path -# (This emulates PyCharm's run configuration button parameter: `add content roots to PYTHONPATH`) +# Purpose: Run local development environment including API server, PostgreSQL container, and Streamlit application # Find the absolute path to the project root PROJECT_ROOT=$(realpath "$(dirname "$0")/..") +# Set up the API server +uvicorn src.fastAPI_app.app:app --reload & + +# Start a local PostgreSQL container +docker compose up -d + +# Wait for a moment to ensure that the API server and PostgreSQL container are up +sleep 5 + # Set PYTHONPATH to the project root, ensuring it's not added multiple times export PYTHONPATH=$(echo $PYTHONPATH | tr ":" "\n" | grep -v "$PROJECT_ROOT" | tr "\n" ":")$PROJECT_ROOT +# Run the Streamlit application venv/bin/streamlit run src/streamlit_app/app.py