This project provides a python backend for MonPoly (https://bitbucket.org/jshs/monpoly). It requires an instance of a QuestDB database (https://questdb.io/get-questdb/).
/
- displays info page/get-policy
- returns the current policy/set-policy
- sets the policy/get-signature
- returns the current signature/set-signature
- sets the signature/log-events
- requires a JSON array of events to send to the monitor, it forwards them to the monitor and logs time points in QuestDB, if they are in order and otherwise correct
- Clone the latest version of the corresponding MonPoly branch (https://bitbucket.org/jshs/monpoly/src/BA_logging_backend/)
- Follow the instructions in the README of MonPoly to set up the build environment and Dune
- Use
inside the repository to compile a binary of the latest version
cd monpoly dune build
- Use the
Dockerfile.server
to build a docker image that can then be used with this backend. For this run:inside the repository.docker build -t monpoly:dev -f Dockerfile.server .
- Clone this repository (monpoly-server)
- Use the Dockerfile in this repository to build another image
docker build -t monpoly-wrapper:dev .
- Create a new container using this image:
or
docker run --net monpoly --name wrapper -v "[path to this repository on your system]:/monpoly-backend" -it -p 5000:5000 monpoly-wrapper:dev
(using PowerShell and inside the repository)docker run --net monpoly --name wrapper -v "$(pwd):/monpoly-backend" -it -p 5000:5000 monpoly-wrapper:dev
- To start the server, use:
inside the container (either after the previous
flask --app=src/app.py run
docker run...
command or withdocker start wrapper
anddocker attach wrapper
)