Table Of Contents

Previous topic

2. Extending SEER

Next topic

2.2. How it all fits together

This Page

2.1. How to add modules and software

(diagram of package directories and experiment-setup)

2.1.1. Modules

The modules directory contains python modules that implement behaviour in the SEER framework. Each module contains a least one class that extends from one of the add-on classes ( Agent, Service, Collector, Aggregator ). Each of these add-on classes also contains dependencies on other modules or software. The source directory contains the source to build software packages for use by SEER modules. It also contains scripts that are called upon to build the associated source.

During the setup process, initial modules dependencies are passed to the setup script from the user as arguments on the command line. The full dependency tree is calculated by searching the configured SEER package directories.

2.1.2. Adding An External Module

  1. Create a packages directory on users that can be seen by your experiment. Common places would be in the project directory or your personal directory. The name of the directory itself is not important but an example would be /users/username/myseer:

    cd ~/
    mkdir myseer
  2. Create the following subdirectories

  • modules
  • source
  • scripts
mkdir modules source scripts
  1. Place python module files in the modules directory:

    mv mymodule.py ~/myseer/modules
  2. In the NS file, add -d /path/to/dir ClassName [ClassName [...]] to the experiment-setup call. If your class is called myAgent defined in modules/newAgent.py, the parameter should be myAgent.:

    tb-set-node-startcmd $node "sudo python /share/seer/v160/experiment-setup.py Basic -d /users/me/myseer myAgent"

Note

The arguments for modules to load are class names, not file names.

2.1.3. Providing Software for Modules

Make sure you have a packages directly as described above

If you have the source code

place the software in ‘source’

place a build script in ‘scripts’, see this page for the arguments a script is called with

If the software is already built for a particular image
place in a tar.gz or zip file called softwarename.[tgz,zip] and place in the architecture directory. See Support Software for naming information.
If the software is already present on the machine
place a blank file named softwarename.INSTALLED in the architecture directory

Examples:

  • source/apache22.tgz
  • Linux-redhat8-i686/apache22.Linux-redhat8-i686.tgz
  • Linux-debianlennysid-i686/tcpdump.INSTALLED

2.1.4. Adding External Modules to the GUI

Loading it from the experiment:

  1. Place the python or class files in a jarfile
  2. Place the jar file in /usr/seer/modules on the control node before connecting with the GUI

Loading it directly on the desktop:

  1. Place the python or class files in a jarfile
  2. From the File menu, select “Load GUI Module From Jar” and select the jarfile you created

2.1.5. Experiment Setup Process

When the SEER experiment setup script is executed, the following process occurs:

  1. A check for SSL certificates is made in the projects directory. A node will wait for the keys, the control node will generate them
  2. A list of package directories is created from the location of the experiment-setup.py script and any -d arguments
  3. A list of required modules is created from any remaining arguments to experiment-setup.py
  4. A depedency list of modules is created by recusive looking at DEPENDS in each loaded module in any of the package directories, any missing requirements are noted
  5. A list of software is created from the SOFTWARE value in each loaded class
  6. All loaded python modules are copied to each node
  7. All software packages are copied to each node, checking first for a cached binary version and attemping to build (and cache) if one can’t be found
  8. A daemon is started on each experiment node and a controller is started on each control node

Note

A module can also be an empty python class that only depends on other modules. The ‘Basic’ module is an example of this.