Backend
Contributing to the backend server
Mage backend code is written in Python π and our server uses the Tornado πͺοΈ framework. Here are some guides on adding features to the Mage backend.
Guides
API
Data integrations
- Add a new source to the data integration pipeline
- Add a new destination to the data integration pipeline
Streaming pipelines
IO classes
Style guide
Linter
Install flake8
in your IDE to lint the Python code.
To run the linter locally, execute this script:
Testing
Unit tests
Add unit tests for the feature in mage_ai/tests directory.
To run the tests locally, execute this script:
It is also possible to run unit tests directly in a live docker instance, as given in the following steps.
- Find out the backend server container name, with the command
docker container ls
in a terminal:
- Start an interactive
bash
session with the backend server container:
- Run unit tests with the following command:
Debugging
Instead of using breakpoint()
, add the following line to your code where you
want a debug:
Attach to running container to use debugger. To get the container ID, run
docker ps
and look in the NAMES
column.
Snippets
Was this page helpful?