Installation#

The model checker can be run in two configurations, REST API and CLI.

First, you’ll need to install the dependencies to run this tool.

Installing the dependencies#

  1. Clone/download the model checker repository.

  2. Setting up a Python virtual environment is recommended. You can run the following command to create it:

    python -m venv .venv
    
    # Remember to activate it! e.g.:
    source .venv/bin/activate
    
  3. Install the dependencies with:

    pip install -r requirements.txt
    

Run locally for testing#

Run with:

python -m mc_openapi

This command serves the APIs through a Flask instance, which is suitable for testing, but not recommended for production.

Run locally with Uvicorn#

The project may be run with Uvicorn, which is better-suited for production environments, as follows:

uvicorn --port 8080 --host 0.0.0.0 --interface wsgi --workers 2 mc_openapi.app_config:app

You may also configure Uvicorn using environment variables with the prefix UVICORN_. For example, if you want to run the server with 4 workers, set the environment variable UVICORN_WORKERS to 4.

Run with Docker#

The best way of deploying the DOML Model Checker is by using Docker.

First, build the docker image with the usual:

docker build -t wp4/dmc .

And then run it with:

docker run -d wp4/dmc

The Uvicorn server will be running and listening on port 80 of the container. To use it locally, you may e.g. bind it with port 8080 of localhost by adding -p 127.0.0.1:8080:80/tcp to the docker run command.

REST API Endpoints#

You may read the API specification generated by Swagger-UI at http://127.0.0.1:8080/ui/.

Building the Documentation#

The documentation has been written in Sphinx.

To build it manually, run:

cd docs
make html

The documentation will be generated in docs/_build.