Development

Since a lot of the operators depend on platform specific code, we rely on docker to encapsulate the requirements for Feluda. Which means we also use docker heavily for local development

To start the service, run docker-compose up.

Debugging

Once the services are running, run docker ps to get the container id of the tattle-api service. Once you attach a bash shell to it by running docker exec -it CONTAINER_ID /bin/sh, you can begin debugging it.

We use debugpy as the debugger.

  1. Edit the docker-compose.yml file as target : debug
  2. Ensure that the FLASK_ENV environment variable is set to development export FLASK_ENV=development
  3. run
python -m debugpy --listen 0.0.0.0:5678 --wait-for-client app.py

vscode can then listen on port 5678 to the debugger and intercept breakpoints.

Note : --wait-for-client argument makes debugpy wait on executing the given command (starting the app), till a client is listening to it (vscode, in our case)

Any changes you make to your source code will trigger an automatic reload of the server. As long as there's a client like VScode attached to the debug server, you'll be able to iterate on the codebase and debug quickly.