First, make an env, activate it and pip install the dependencies:
pip install -r requirements.txtYou can run locally in multiple terminals like so:
# Start the backend
gunicorn backend.app:app -c gunicorn_config.pyIn a different terminal, run the frontend with:
streamlit run src/main.pyTwo endpoints, asset liabilities and price shock are CPU heavy and so are pre-generated in a separate process
and stored in results/. The backend serves these pre-generated results instead of computing on-request.
In a different terminal, you can generate the results with:
python -m backend.scripts.generateInstead of all the above you can also run it in docker with:
docker compose up --buildwhich will start a process to generate the cache files and then start the backend and frontend.
Pushing should automatically build the docker images and deploy to our k8s cluster.