Backend
Contributing to the backend server
Guides on adding features to the backend server.
Language | Python |
Framework | Tornado |
Code directory | mage_ai/server/ |
Style guide
Linter
Install flake8
in your IDE to lint the Python code.
To run the linter locally, execute this script:
./scripts/server/lint.sh
Testing
Unit tests
Add unit tests for the feature in mage_ai/tests directory.
To run the tests locally, execute this script:
./scripts/server/test.sh
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:
% docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8dbcfbe41755 mage/data "./scripts/install_a…" 5 days ago Up 38 minutes 0.0.0.0:3000->3000/tcp mage-ai-app-1
b9d811e1e3e8 mage/data "python mage_ai/serv…" 5 days ago Up 38 minutes 0.0.0.0:6789->6789/tcp mage-ai-server-1
- Start an interactive
bash
session with the backend server container:
% docker exec -it mage-ai-server-1 /bin/bash
- Run unit tests with the following command:
root@b9d811e1e3e8:/home/src# python3 -m unittest discover -s mage_ai.tests --failfast
Guides
API
Data integrations
- Add a new source to the data integration pipeline
- Add a new destination to the data integration pipeline