Skip to content
jh-hpi edited this page Jan 22, 2020 · 12 revisions

Prerequisites

As the user interface files are stored in a different repository, you have to clone the repo using:

git clone --recurse-submodules [email protected]:hpi-epic/mpci.git

To make your life easier to get from a git clone to an up-and-running project we prepared some scripts for you. Here’s a quick mapping of what our scripts are named and what they’re responsible for doing:

  • bash scripts/bootstrap.sh – installs/updates all dependencies
  • bash scripts/setup.sh – sets up a project to be used for the first time
  • bash scripts/update.sh – updates a project to run at its current version
  • bash scripts/server.sh – starts app
  • bash scripts/demo.sh – starts app with example dataset and experiment pre-configured.
  • bash scripts/test.sh – runs tests
  • bash scripts/cibuild.sh – invoked by continuous integration servers to run tests
  • bash scripts/console.sh – opens a console

The example dataset for demo.sh is generated from an EARTHQUAKE bayesian network on this page. Some of the scripts accept parameters that are passed through the underlying docker commands. For example, you can start a server in detached mode with bash scripts/server.sh --detach or run a specific test with bash scripts/test.sh test/unit/master/resources/test_job.py.

We provide three different ways how to run the Causal Inference Pipeline:

  1. backend – starts just the backend with a postgres and a database ui - uses docker-compose.yml

  2. staging – deploys the backend with an additional nginx server, that is used to serve static files and provide the backend functionality by connecting to uWSGI. The transpilation of the UI files will be done during build. - uses docker-compose-staging.yml

  3. production – same setup as staging but without database ui. Make sure to override DB credentials - uses docker-compose-prod.yml

Change the environment variable MPCI_ENVIRONMENT in conf/backend.env accordingly to choose the desired setup. The default is backend.

A database user interface is available using http://localhost:8081 given a backend or staging setup.

Try it out

Just run bash scripts/demo.sh and open http://localhost:5000 in your browser. Make sure to change the MPCI_ENVIRONMENT in your conf/backend.env to staging to also deploy the user interface.

Frequently Asked Questions

What should I do if following error occurs?

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
	Is the server running on host "database" (192.168.64.2) and accepting
	TCP/IP connections on port 5432?
 (Background on this error at: http://sqlalche.me/e/e3q8)

For some reason the database startup took a bit too long. Just retry the command.