Changes between Initial Version and Version 1 of GENIFIRE/Labwiki/Part0/Execute


Ignore:
Timestamp:
07/07/14 05:34:05 (10 years ago)
Author:
divyashri.bhat@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIFIRE/Labwiki/Part0/Execute

    v1 v1  
     1== 2. Instrument your Application using !LabWiki ==
     2
     3In this part you will learn how you can use !LabWiki to execute an experiment on the slice you
     4reserved earlier today.
     5
     6=== 2.1 Design and Execute measurement in !LabWiki ===
     7
     8
     9=== 2.1.1. The "Plan" Window ===
     10To get started point your browser to [http://labwiki.test.atlantis.ugent.be:4000/labwiki]. Labwiki has three major windows. We will focus on the leftmost window first. This is the "Planning" window in which you document your experiment. (This is somewhat the equivalent of an electronic lab journal.) Documents are written in [http://daringfireball.net/projects/markdown/ Markdown].
     11
     12At the top of that window is a text field which you can use to search for existing MD scripts. Type "firegenipart0" in the field and then select "firegenipart0.md" from the list of files that are offered. This document has some information on the experiment that will be performed in the tutorial.
     13
     14'''Note''': Create a new script by clicking on the wheel and prepend your username to the name of the script. Copy and paste the contents of firegenipart0.md to create a copy of your own. [[BR]]
     15'''Please do not modify the original script.'''
     16
     17The entire Markdown script is shown here for your reference:
     18
     19
     20{{{
     21# My First Application
     22
     23Today, we will write a simple script to automate tests such as Ping and Iperf using LabWiki
     24Overall we will do the following:
     25
     26*  Define OEDL script for ping and Iperf
     27*  Run Experiment in LabWiki and view Graphs
     28
     29## My Topology
     30
     31<img src="http://emmy9.casa.umass.edu/FGRE2014/part0_topo.png" width="100%" height="100%">
     32
     33## Define Property
     34
     35Example:
     36
     37defProperty('source1', "client-lwtest6", "ID of a resource")
     38
     39## Define Application
     40<pre><code>
     41defApplication('ping') do |app|
     42  app.description = 'Simple Definition for the ping-oml2 application'
     43  # Define the path to the binary executable for this application
     44  app.binary_path = '/usr/local/bin/ping-oml2'
     45  # Define the configurable parameters for this application
     46  # For example if target is set to foo.com and count is set to 2, then the
     47  # application will be started with the command line:
     48  # /usr/bin/ping-oml2 -a foo.com -c 2
     49  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     50  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     51  # Define the OML2 measurement point that this application provides.
     52  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     53  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     54  app.defMeasurement('ping') do |m|
     55    m.defMetric('dest_addr',:string)
     56    m.defMetric('ttl',:uint32)
     57    m.defMetric('rtt',:double)
     58    m.defMetric('rtt_unit',:string)
     59  end
     60end
     61</code></pre>
     62## Experiment
     63* Define Traffic Controller
     64* Define Application Events
     65
     66## Iperf Graphs
     67a) Nymber of Bytes
     68
     69![](_)
     70__Figure 1__. Total number of Bytes
     71
     72
     73b) Connection
     74
     75![](_)
     76__Figure 2__. Connection-IP Mapping
     77## Ping Graph
     78
     79
     80![](_)
     81__Figure 3__. Round-trip Time.
     82
     83}}}
     84
     85
     86=== 2.1.2 The "Prepare" Window ===
     87
     88In the Search bar in the prepare window, find the script firegenipart1.oedl and click on it to load it. [[BR]]
     89
     90'''Note''': Create a new script by clicking on the wheel and prepend your username to the name of the script. Copy and paste the contents of firegenipart1.oedl to create a copy of your own. [[BR]]
     91'''Please do not modify the original script.'''
     92
     93[[Image(Lw-createscript2.png, 90%)]]
     94
     95The script is also shown here for your reference:
     96{{{
     97
     98defProperty('source1', "nodea-exttest7", "ID of a resource")
     99defProperty('source2', "switch1-exttest7", "ID of a resource")
     100defProperty('source3', "switch2-exttest7", "ID of a resource")
     101
     102
     103defProperty('sinkaddr12', '192.168.1.7', "Ping destination address")
     104defProperty('sinkaddr13', '192.168.1.8', "Ping destination address")
     105
     106defProperty('sinkaddr21', '192.168.1.13', "Ping destination address")
     107defProperty('sinkaddr23', '192.168.1.14', "Ping destination address")
     108defProperty('sinkaddr24', '192.168.1.15', "Ping destination address")
     109
     110
     111defApplication('ping') do |app|
     112  app.description = 'Simple Definition for the ping-oml2 application'
     113  # Define the path to the binary executable for this application
     114  app.binary_path = '/usr/local/bin/ping-oml2'
     115  # Define the configurable parameters for this application
     116  # For example if target is set to foo.com and count is set to 2, then the
     117  # application will be started with the command line:
     118  # /usr/bin/ping-oml2 -a foo.com -c 2
     119  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     120  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     121  # Define the OML2 measurement point that this application provides.
     122  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     123  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     124  app.defMeasurement('ping') do |m|
     125    m.defMetric('dest_addr',:string)
     126    m.defMetric('ttl',:uint32)
     127    m.defMetric('rtt',:double)
     128    m.defMetric('rtt_unit',:string)
     129  end
     130end
     131
     132defApplication('trema') do |app|
     133  app.description = 'This app runs trema from command line'
     134  app.binary_path = '/bin/sh /root/ovs-setup2.sh'
     135end
     136defGroup('Source2', property.source2, property.source3) do |node|
     137  node.addApplication("trema")
     138end
     139defGroup('Source1', property.source1) do |node|
     140  node.addApplication("ping") do |app|
     141    app.setProperty('target', property.sinkaddr12)
     142    app.setProperty('count', 30)
     143    #app.setProperty('interval', 1)
     144    app.measure('ping', :samples => 1)
     145  end
     146  node.addApplication("ping") do |app|
     147    app.setProperty('target', property.sinkaddr13)
     148    app.setProperty('count', 30)
     149    #app.setProperty('interval', 1)
     150    app.measure('ping', :samples => 1)
     151  end
     152   node.addApplication("ping") do |app|
     153    app.setProperty('target', property.sinkaddr21)
     154    app.setProperty('count', 30)
     155    #app.setProperty('interval', 1)
     156    app.measure('ping', :samples => 1)
     157  end
     158   node.addApplication("ping") do |app|
     159    app.setProperty('target', property.sinkaddr23)
     160    app.setProperty('count', 30)
     161    #app.setProperty('interval', 1)
     162    app.measure('ping', :samples => 1)
     163  end
     164  node.addApplication("ping") do |app|
     165    app.setProperty('target', property.sinkaddr24)
     166    app.setProperty('count', 30)
     167    #app.setProperty('interval', 1)
     168    app.measure('ping', :samples => 1)
     169  end
     170end
     171
     172
     173onEvent(:ALL_UP_AND_INSTALLED) do |event|
     174  info "Starting the ping"
     175  after 2 do
     176    group('Source2').startApplications
     177  end
     178  after 20 do
     179    group('Source1').startApplications
     180  end
     181  after 80 do
     182    info "Stopping the ping"
     183    allGroups.stopApplications
     184    Experiment.done
     185  end
     186end
     187
     188defGraph 'RTT' do |g|
     189  g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
     190  g.caption "RTT of received packets."
     191  g.type 'line_chart3'
     192  g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
     193  g.xaxis :legend => 'oml_seq'
     194  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
     195end
     196
     197}}}
     198
     199=== 2.1.3 Start your application from !LabWiki ===
     200
     201To start your experiment, simply drag the icon that is to the left of the file name (see figure below) from the middle (Prepare) to the right (Execute) window.
     202Explanation of the fields in the Execute window:
     203
     204* name: In this field you specify the name of your experiment.
     205
     206* slice: Type the name of the slice you would like to run your experiment on
     207
     208*Change source1, source2 and source3 fields to include your slice name similar to nodea-<slicename>
     209
     210Then, start the actual experiment by clicking on the "Start Experiment" button.
     211[[BR]]
     212
     213[[Image(LW-extended-lw.png, 90%)]]
     214
     215=== 3.1.4 During experiment execution ===
     216
     217After pressing the "Start" button, the Execute window will change and start showing status information about your experiment.
     218The figure below gives an example for the Execute window during experiment execution.
     219
     220[[Image(LW-execute-extended.png, 90%)]]
     221
     222Now the window lists experiment properties, one or several live graphs (if they have been specified in the OEDL script), and logging information. The latter would be a good starting point for trouble shooting, should your experiment not run as expected.
     223
     224Depending on the status of your resources and experiments, you will see one of the following statuses at the top of the Execute window:
     225 * Pending - This is the first state of your experiment where the job scheduler adds it to the run queue. This status would remain for the first few seconds before it changes to Running or Failed
     226 * Running - This status appears when your experiment starts running. If it fails for one or more reasons, a Failed status will appear instead
     227 * Aborted - When you click on "Stop Experiment" at the top-left corner of the Execute window, the status changes to aborted
     228 * Finished - When your experiment is done, you will see this status
     229
     230
     231= [wiki:GENIFIRE/Labwiki/Part1/DesignSetup Design] =
     232= [wiki:GENIFIRE/Labwiki/Part1/Finish Next: Finish] =