CAIRIS

Live Demo

A live demo of CAIRIS is available to use on demo.cairis.org. The username and password you need are test and test. The live demo is rebuilt every night based on the latest updates to CAIRIS.

The live demo comes with two example models: NeuroGrid and ACME Water. To open these, select the System / Open Database menu, and choose the model to open.

Installing CAIRIS

CAIRIS container on Docker Hub

If you have Docker installed on your laptop or an available machine, the easiest way of getting up and running with the web application is to download the CAIRIS container from Docker hub. This is built from the latest changes in github, and uses mod_wsgi-express to deliver the CAIRIS web services.

$ sudo docker run --name cairis-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.5
$ sudo docker run --name CAIRIS --link cairis-mysql:mysql -d -P -p 80:8000 --net=bridge shamalfaily/cairis

fig:initStartup

Source installation and configuration

CAIRIS web services can be installed on any platform that its open-source dependencies are available for. The most tested platforms are Ubuntu or Debian Linux.

$ sudo apt-get install python-dev build-essential mysql-server mysql-client graphviz docbook dblatex python-pip python-numpy git libmysqlclient-dev --no-install-recommends texlive-latex-extra docbook-utils inkscape libxml2-dev libxslt1-dev poppler-utils python-setuptools
$ git clone https://github.com/failys/cairis
$ cd cairis
$ sudo pip install -r requirements.txt
$ ./quick_setup.py

fig:quick_setup_db

You can accept many of these defaults, except for the database root password. When you select Ok, the script will create a new CAIRIS database, and accompanying CAIRIS configuration file; this file will ensure that CAIRIS knows what database it needs to refer to when you start up the tool and setup the necessary environment variables. The form below will then be displayed.

fig:quick_setup_user

You will need to supply a username and password here. When you select Ok, the script will add a user to the CAIRIS database.

source .bashrc

If you want to run the Flask development server, run ./cairisd.py runserver (the script can be found in cairis/cairis/bin).

If you want to run CAIRIS in a production environment then it may be sensible to use mod_wsgi-express rather than the Flask development server. To do this, you will need to install the requisite Apache2 packages.

$ sudo apt-get install apache2 apache2-dev

You will then need to use pip to install the requisite dependencies.

$ sudo pip install -r wsgi_requirements.txt

To start mod_wsgi-express, you should run mod_wsgi-express start-server cairis.wsgi; cairis.wsgi can also be found in cairis/cairis/bin.

You can now point your browser to http://SERVERNAME:PORT_NUMBER, depending on where cairisd is installed, and what port cairisd or mod_wsgi-express is listening to, e.g. http://myserver.org:7071.

If you plan to develop for CAIRIS, you should install the requisite packages for running the tests in cairis/cairis/test.

$ sudo pip install -r test_requirements.txt

You should also set the CAIRIS_SRC and CAIRIS_CFG_DIR environment variables in your .bashrc file.

export CAIRIS_SRC=/home/cairisuser/cairis/cairis
export CAIRIS_CFG_DIR=${CAIRIS_SRC}/config