Montage Banner

Table Of Contents

Previous topic

MAGI Development Codebase

Next topic


This Page

Installation Instructions


  1. Install the following dependencies.
  • python-yaml
  • python-pymongo
  • python-pydot
  • python-networkx
  • py-matplotlib

These packages can all be installed using pip.

Install pip, if not already available.

curl -O
pip install pyyaml
pip install pymongo
pip install pydot
pip install networkx
pip install matplotlib
  1. Download and install MAGI
$ git clone
$ cd magi
$ sudo python install
  1. Create a MAGI distribution for MAGI installation on experiment nodes
$ mkdir /share/magi
$ sudo python sdist toshare -p /share/magi/current/
  1. Copy the source installation files, if required. Some of the existing agents refer to these.
$ scp -r /share/magi/
  1. Make a copy of the existing MAGI modules, if required
$ cd /share/magi
$ mkdir modules
$ git clone modules

MAGI Visualization

We have been working on a javascript based visualization library for MAGI experiments. Although, currently, the libray only has a few sample visualizations, we have tried to create a framework that can be expanded to do generalizaed visualizations.

Experimenters can download the curently available source from out git repo, use it as it is, or build upon the same. We would be more than happy to see what others build, and if feasible add it to our codebase.

  1. Download MAGI visualization code

Make a copy of the visualization code under your web server home directory.

$ git clone
  1. Install Mongo DB

The visualization code works with Mongo DB. Install it and run a mongod server.

Try connecting to the mongo db server to make sure it is up.

$ mongo
MongoDB shell version: 2.6.4
connecting to: test
  1. Enable PHP
Install php module, and enable it in the apache configuration file.
  1. Install PHP MongoDB extension
  1. Install PHP JSON extension
  1. Install PHP YAML extension

Canned Data Visualization

At this point you should be able to populate the database with canned data, and see sample visualizations.

$ cd $WEBSERVER_HOME/magi-viz/casestudy/clientserver
$ ../../util/ magi_cs experiment_data

If the data is successfully imported into the database, visit the following link to see a sample visualization.



The information about importing/exporting of data, and visualization urls is available in a README file under each experiment directory.

Realtime Data Visualization

To be able to visualize real time data for an experiment, the visualization code needs to be able to pull data from the experiment database.

SSH keys need to be setup for automatic creation of a SSH tunnel to experiment database through DeterLab Ops machine.

  1. Generate keys for web server user
sudo -u www ssh-keygen
  1. Add generated pubkey as an authorized key for a user on Deter. This can be done by visiting the DeterLab webpage. The default userid that magi visualization code tries to use is ‘muser’. This can either be changed in the code base, or can be overwritten using the config file or url parameters.
getDefault(db_config, 'sshUserName', 'muser')
  1. Add host key to known_hosts
$ sudo -u www ssh
The authenticity of host ' ('
can't be established.
ECDSA key fingerprint is SHA256:jj1atx6ugYXTkkmzAIPWVsl9LsOaOjxjb3n9emb4iwE.
Are you sure you want to continue connecting (yes/no)? yes