Skip to content

try-prism/prism-api

Repository files navigation

prism-api

Prism Backend implemented with FastAPI

Setup

  1. Create a new conda environment and install python 3.10
conda create -n prism
conda install python=3.10
  1. Install poetry
curl -sSL https://install.python-poetry.org | python -
  1. Install packages and activate the virtual environment
poetry install
poetry shell
  1. Setup pre-commit git hook
pre-commit install
  1. Create .env file

Ask teammates for the environment configuration

touch .env
  1. Start local Ray instance
ray start --head --port=6379
  1. Run the api using the following command
cd app
python -m uvicorn main:app --workers 4

Before committing

Run the following command

pre-commit run --all-files

You can also fix auto-fixable ruff erros by running the following command

ruff check . --fix

Adding new packages

Use the following command

poetry add [PACKAGE_NAME]

Terraform

Setup

  1. Install Terraform
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
  1. Verify the installation
terraform -help
  1. Enable DEBUG logging (if you want to)
export TF_LOG=DEBUG

ETC

Delete pycache

find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf

Delete local branches

git branch | grep -v "main" | xargs git branch -D