Debugging the model algorithm with actual requests
Right now we haven't figured out a way to debug FastAPI applications in a container, so to use a debugger to debug the application you need to the following:
- Start MongoDB service
- In
app.py
, modify the declaration ofmodel_algorithm
variable to the following:model_algorithm = ModelAlgorithm(host="localhost", port="27018")
- Run the FastAPI application
- In VSCode: insert the following code snippet to
.vscode/launch.json
(can be opened viaShow All Commands
>Open 'launch.json'
){ "name": "Python: FastAPI", "type": "python", "request": "launch", "module": "uvicorn", "args": [ "exodus_model_template.app:app" ], "jinja": true, "justMyCode": true }
- In command line: run the app via the following command:
poetry run python -m pdb exodus_model_template/app.py
- In VSCode: insert the following code snippet to
Debug the deployed, containerized model algorithm
TODO