Skip to content
danthe edited this page Mar 27, 2019 · 12 revisions

Prerequisites

The complete setup is done using Docker that means that you will require docker to be running for a local execution. As the user interface files are stored in a different repository, you have to clone the repo using:

git clone --recurse-submodules git@github.com:danthe96/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

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.