Montage Banner

Table Of Contents

Previous topic

MAGI Development Codebase

Next topic

Tools

This Page

Installation Instructions

MAGI Core

  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 https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install pyyaml
pip install pymongo
pip install pydot
pip install networkx
pip install matplotlib
  1. Download and install MAGI
$ git clone https://github.com/deter-project/magi.git
$ cd magi
$ sudo python setup.py install
  1. Create a MAGI distribution for MAGI installation on experiment nodes
$ mkdir /share/magi
$ sudo python setup.py sdist toshare -p /share/magi/current/
  1. Copy the source installation files, if required. Some of the existing agents refer to these.
$ scp -r users.isi.deterlab.net:/share/magi/tarfiles /share/magi/
  1. Make a copy of the existing MAGI modules, if required
$ cd /share/magi
$ mkdir modules
$ git clone https://github.com/deter-project/magi-modules.git 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.

$ cd $WEBSERVER_HOME
$ git clone https://github.com/deter-project/magi-viz.git
  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
http://php.net/manual/en/book.mongo.php
  1. Install PHP JSON extension
http://php.net/manual/en/book.json.php
  1. Install PHP YAML extension
http://php.net/manual/en/book.yaml.php

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/populate_db.sh magi_cs experiment_data

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

http://localhost/magi-viz/casestudy/clientserver/traffic.html

Note

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.
magi-viz/util/helpers.js
getDefault(db_config, 'sshUserName', 'muser')
  1. Add host key to known_hosts
$ sudo -u www ssh muser@users.isi.deterlab.net
The authenticity of host 'users.isi.deterlab.net (206.117.25.49)'
can't be established.
ECDSA key fingerprint is SHA256:jj1atx6ugYXTkkmzAIPWVsl9LsOaOjxjb3n9emb4iwE.
Are you sure you want to continue connecting (yes/no)? yes