- Install the requirements
poetry install - Update environment variables needed (see Environment Variables)
- Run the following for database migration;
poetry run alembic upgrade head- Start the API server
uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload - Set up the "MODEL_PREDICTION_ENDPOINT" environment variable to point to the regression model prediction endpoint.
- Access the swagger ui here -
http://localhost:8000/swagger - The API documentations is available here -
http://localhost:8000/api-docs
The following environment variables need to be set:
| Variable | Default Value | Description |
|---|---|---|
| MODEL_PREDICTION_ENDPOINT | http://localhost:5001/invocations |
The endpoint URL for making model prediction requests. |
| POSTGRES_HOST | localhost |
The hostname or IP address of the PostgreSQL server. |
| POSTGRES_USER | admin |
The username for authenticating to the PostgreSQL database. |
| POSTGRES_PASSWORD | password |
The password for authenticating to the PostgreSQL database. |
| POSTGRES_DB | bridgeai |
The name of the PostgreSQL database to connect to. |
| POSTGRES_PORT | 5432 |
The port number on which the PostgreSQL server is listening. |
- Make the database up and running by
docker compose up -dfrom terminal You can login to the database usingpsql -h localhost -p 5432 -U admin -d bridgeai - Install the requirements
poetry install - Run
poetry run alembic upgrade headfor database migration - Run the tests
poetry run pytest
- To deploy -
helm install prediction-server-release charts/prediction-server-chart - Then port forward -
kubectl port-forward service/prediction-server-release-prediction-server-chart 8000:8000 - Check the swagger ui here -
http://localhost:8000/swagger
Note: To delete the deployment - helm uninstall prediction-server-release