Skip to content
New issue

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

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

Already on GitHub? # to your account

run.sh to cover e2e setup #4

Merged
merged 1 commit into from
Jan 15, 2024
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
13 changes: 11 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -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
Loading