Setup development sandbox#

Introduction#

We are happy you reached this point of the documentation. This will probably mean you want to setup a development sandbox in order to hack on the source code. We appreciate that, you mean it. Let’s go.

Prerequisites#

Environment#

Install some needed packages:

apt-get install python3-venv python3-dev docker-compose mosquitto-clients

Foundation services#

You will need InfluxDB, Grafana, Mosquitto and optionally MongoDB.

For installing them on your workstation, you might want to have a look at the Run through Docker. When running Linux, you can also install the infrastructure on your local workstation natively like Setup on Debian and Ubuntu.

The most easy way is to run Mosquitto, InfluxDB, MongoDB and Grafana as Docker containers:

make start-foundation-services

Walkthrough#

Get the source code#

mkdir -p develop; cd !$
git clone https://github.com/daq-tools/kotori.git
cd kotori

Setup virtualenv#

# Create and activate virtualenv
make setup-virtualenv
source .venv/bin/activate

# Set option to make the pip installer prefer binary dependencies
# This might prevent compilation steps for some of them
export PIP_PREFER_BINARY=1

# Install package
pip install --editable=.

# Install extra features

# Data acquisition base
pip install --editable=.[daq]

# Data acquisition base, with export features
pip install --editable=.[daq,export]

# Data acquisition with data sink for binary payloads
pip install --editable=.[daq_binary]

# Data storage for RDBMS databases and MongoDB
pip install --editable=.[storage_plus]

Run ad hoc#

Please follow Kotori.

PyCharm#

Add Project to PyCharm by using “Open Directory…”

There’s a Free Community edition of PyCharm, you should really give it a try.

Run as service#

When having the need to run the application as a system service even while still being in development mode, have a look at Kotori development with systemd. We actively use this scenario for integration scenarios, testing and debugging.