MAGI provides deterministic control over the various components in an experiment. It can be used to express and automate the procedural workflow for an experiment.
An experiment procedure can be expressed as streams of events that together form a workflow. An event is a mechanism to invoke a functional behavior on a node. A functional behavior description is known as an agent. An agent implementation is a piece of code that instruments a given functional behavior.
Agent Activation Language (AAL) is a YAML based descriptive language that MAGI uses to describe an experiment’s procedural workflow. The entire experiment procedure needs to be expressed as part of an AAL file. An AAL representation has mainly 3 parts.
An event stream is a list of events and wait states that is parsed and executed in linear order. An experimentation procedure can be expressed in an AAL by defining multiple event streams and connecting them according to their dependencies. Different event streams can execute concurrently and can be synchronized with each other using triggers.
All the event streams that need to begin execution at the start are to be listed as part of a list called streamstarts.
Wait state and triggers are used as a synchronization mechanism among different event streams.
Wait states are holding points in an event stream. They pause the execution of an event stream until the completion of a specified trigger.
An agent represents the relationship between a functional behavior and the corresponding implementation code. It is a mapping between a behavioral name and a set that contains the following
- An accessible path to the code available either as a directory or a tarred file.
- A base64 encoding of tarred code.
Groups provide a mapping from a functional name to a set of experiment nodes. It is a mechanism used to couple the procedure to the apparatus.
The MAGI orchestrator is a tool that parses an AAL file and orchestrates an experiment based on the specified procedures.
The orchestrator iterates over the list of groups and for each group sends a request to all the mapped nodes to join the group. A corresponding reply adds the replier to the group. Messages addressed to a group are sent to all the nodes that are part of the group.
The orchestrator iterates over the list of agents and for each agent sends an agent load request to the mapped groups. An agent load message specifies to start an instance of the agent implementation and to put it in a listening mode, where the instance waits for further messages.
Next, the orchestrator concurrently executes all the event streams listed as part of streamstarts.
The MAGI orchestrator has a predefined event stream called exit. The purpose of this event stream is to unload all the agents and disjoin groups. All workflows should end up executing this stream for a clean exit.
MAGI is not tied to any particular testbed architecture. Following are basic instructions on how to setup an experiment with MAGI on DETER/Emulab.
If you aren’t already familiar with DETER, please go through the tutorial on how to setup an experiment.
Begin a new experiment and load the ns file that defines the network topology. Simple ns file modifications are required to support loading the MAGI backend on each node:
tb-set-node-startcmd $node "sudo python /share/magi/current/magi_bootstrap.py"
Next create and swap in the experiment.
Once the experiment is swapped in, you can then run the MAGI orchestrator passing it the control node’s address and the AAL file to orchestrate.
/share/magi/current/magi_orchestrator.py -c control.exp.proj –f procedure.aal
Now you can try to work with the sample test cases.