Developer Installation Instructions

Note

This page is for developers who want to customize or extend OpenWISP Monitoring, whether for bug fixes, new features, or contributions.

For user guides and general information, please see:

Dependencies

  • Python >= 3.8

  • InfluxDB 1.8

  • fping

  • OpenSSL

Installing for Development

Install the system dependencies:

Install system packages:

sudo apt update
sudo apt install -y sqlite3 libsqlite3-dev openssl libssl-dev
sudo apt install -y gdal-bin libproj-dev libgeos-dev libspatialite-dev libsqlite3-mod-spatialite
sudo apt install -y fping
sudo apt install -y chromium

Fork and clone the forked repository:

git clone git://github.com/<your_fork>/openwisp-monitoring

Navigate into the cloned repository:

cd openwisp-monitoring/

Start Redis and InfluxDB using Docker:

docker-compose up -d redis influxdb

Setup and activate a virtual-environment. (we'll be using virtualenv)

python -m virtualenv env
source env/bin/activate

Make sure that you are using pip version 20.2.4 before moving to the next step:

pip install -U pip wheel setuptools

Install development dependencies:

pip install -e .
pip install -r requirements-test.txt
npm install -g jshint stylelint

Install WebDriver for Chromium for your browser version from https://chromedriver.chromium.org/home and extract chromedriver to one of directories from your $PATH (example: ~/.local/bin/).

Create database:

cd tests/
./manage.py migrate
./manage.py createsuperuser

Run celery and celery-beat with the following commands (separate terminal windows are needed):

cd tests/
celery -A openwisp2 worker -l info
celery -A openwisp2 beat -l info

Launch development server:

./manage.py runserver 0.0.0.0:8000

You can access the admin interface at http://127.0.0.1:8000/admin/.

Run tests with:

./runtests.py  # using --parallel is not supported in this module

Run quality assurance tests with:

./run-qa-checks

Alternative Sources

PyPI

To install the latest Pypi:

pip install openwisp-monitoring

Github

To install the latest development version tarball via HTTPs:

pip install https://github.com/openwisp/openwisp-monitoring/tarball/master

Alternatively you can use the git protocol:

pip install -e git+git://github.com/openwisp/openwisp-monitoring#egg=openwisp_monitoring

Install and Run on Docker

Warning

This Docker image is for development purposes only.

For the official OpenWISP Docker images, see: Docker OpenWISP.

Build from the Dockerfile:

docker-compose build

Run the docker container:

docker-compose up