Once you have a clone of the core repository you can begin active development.
We maintain an up to date docker-compose script for development purposes under
grai-server folder of the monorepo.
In order to deploy an instance locally you can do the following
cd grai-core/grai-server docker compose up
It may take a minute for all of the services to deploy depending on your machine
so give it a moment but you will soon have access to an instance of the server
localhost:8000 and the frontend on
The default login credentials are
username: email@example.com password: super_secret
Grai relies on the following background services.
- PostgresQL (opens in a new tab) as the core database
- Redis (opens in a new tab) for cacheing
- Celery (opens in a new tab) for job scheduling and worker execution
- Flower (opens in a new tab) for monitoring of Celery tasks
- Django (opens in a new tab) for our backend web framework
You'll find all of the integration code under the
Each is a python application which you can install locally without any dependencies other than python.
However, we use poetry extensively for managing our libraries.
We will be using the postgres integration as an example below but all of this is equally applicable to the other python libraries and integrations.
Although all of our python libraries are installable through pip
cd grai-core/grai-integrations/source-postgres pip install -e .
We recommend using poetry to manage your installations like so.
cd grai-core/grai-integrations/source-postgres poetry install
This will create a new virtual environment with all required dependencies for the integration.
You can run command inside this virtual environment by prefixing commands with
poetry run python will place in you the python interpreter for your environment.
We use pytest in all of our python applications and you can run tests in your virtual environment with this command.
poetry run pytest
Some integrations might depend on a database instance in which case there will be a docker-compose file in the root of the integration subdirectory. In these cases you should use Docker to spin up an instance of the needed containers before running the test commands.
docker compose up poetry run pytest
GitHub Actions definition files are available in the root directory of the
Each of these testing steps will run a CI job built using GitHub Actions. For new integrations we ask that you add an action which runs Linting, and unit tests on every pull request.
Our Python libraries all follow a consistent style guide consisting of
- Black (opens in a new tab) for linting
- We use a line-width of 120 characters not 81
- MyPy (opens in a new tab) for static type checking
- isort (opens in a new tab) for standardized import ordering
There are pre-commit hooks available across the repository. If you're unfamiliar with pre-commit hooks you don't need to worry about this though you can find out more about them here (opens in a new tab).