Changes between Initial Version and Version 1 of GENIExperimenter/Tutorials/LabWiki/MultisiteExtendedLearningSwitch/Execute


Ignore:
Timestamp:
05/22/15 15:02:54 (9 years ago)
Author:
divyashri.bhat@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/LabWiki/MultisiteExtendedLearningSwitch/Execute

    v1 v1  
     1= Module C Execute Experiment (on extended topology) =
     2
     3== 3. Instrument your Application using !LabWiki ==
     4
     5In this part of Module C we will learn how to extend an OEDL script to execute
     6an experiment on the extended topology you reserved in the [wiki:GEC22Agenda/LabWiki/ModuleC/DesignSetup previous step].
     7
     8=== 3.1 Design and Execute measurement in !LabWiki ===
     9
     10
     11=== 3.1.1. The "Plan" Window ===
     12Now you can use the original MD script and modify it with new information on the extended topology and the
     13experiment you are executing on the extended topology.
     14
     15
     16Look [wiki:GEC22Agenda/LabWiki/ModuleA/Execute here] if you have to refresh your memory on how to use the prepare window.
     17
     18TIP: To add images to your markdown script, please add a line similar to the one shown below into your .md file at the place where you want the image to appear:
     19{{{
     20
     21<img src="http://emmy9.casa.umass.edu/GEC-20/threenoderoute.png">
     22
     23}}}
     24The image has to be hosted on a webserver.
     25
     26You can edit Markdown files in the Prepare Window.
     27
     28=== 3.1.2 The "Prepare" Window ===
     29
     30In the Search bar in the prepare window, find the script GEC22learningswitchextend.oedl and click on it to load it. The script is also shown here for your reference:
     31{{{
     32#!ruby
     33
     34defProperty('source1', "nodea", "ID of a resource")
     35defProperty('source2', "switch1", "ID of a resource")
     36defProperty('source3', "switch2", "ID of a resource")
     37peak_list = []
     38
     39defProperty('sinkaddr12', '192.168.1.7', "Ping destination address")
     40defProperty('sinkaddr13', '192.168.1.8', "Ping destination address")
     41
     42defProperty('sinkaddr21', '192.168.1.13', "Ping destination address")
     43defProperty('sinkaddr23', '192.168.1.14', "Ping destination address")
     44defProperty('sinkaddr24', '192.168.1.15', "Ping destination address")
     45defProperty('sinkaddr11', '192.168.1.6', "Ping destination address")
     46
     47defApplication('ping') do |app|
     48  app.description = 'Simple Definition for the ping-oml2 application'
     49  # Define the path to the binary executable for this application
     50  app.binary_path = '/usr/local/bin/ping-oml2'
     51  # Define the configurable parameters for this application
     52  # For example if target is set to foo.com and count is set to 2, then the
     53  # application will be started with the command line:
     54  # /usr/bin/ping-oml2 -a foo.com -c 2
     55  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     56  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     57  # Define the OML2 measurement point that this application provides.
     58  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     59  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     60  app.defMeasurement('ping') do |m|
     61    m.defMetric('dest_addr',:string)
     62    m.defMetric('ttl',:uint32)
     63    m.defMetric('rtt',:double)
     64    m.defMetric('rtt_unit',:string)
     65  end
     66end
     67
     68defApplication('trema') do |app|
     69  app.description = 'This app runs trema from command line'
     70  app.binary_path = '/bin/sh /root/ovs-setup2.sh'
     71end
     72defGroup('Source2', property.source2, property.source3) do |node|
     73  node.addApplication("trema")
     74end
     75defGroup('Source1', property.source1) do |node|
     76  node.addApplication("ping") do |app|
     77    app.setProperty('target', property.sinkaddr12)
     78    app.setProperty('count', 30)
     79    #app.setProperty('interval', 1)
     80    app.measure('ping', :samples => 1)
     81  end
     82  node.addApplication("ping") do |app|
     83    app.setProperty('target', property.sinkaddr13)
     84    app.setProperty('count', 30)
     85    #app.setProperty('interval', 1)
     86    app.measure('ping', :samples => 1)
     87  end
     88   node.addApplication("ping") do |app|
     89    app.setProperty('target', property.sinkaddr21)
     90    app.setProperty('count', 30)
     91    #app.setProperty('interval', 1)
     92    app.measure('ping', :samples => 1)
     93  end
     94   node.addApplication("ping") do |app|
     95    app.setProperty('target', property.sinkaddr23)
     96    app.setProperty('count', 30)
     97    #app.setProperty('interval', 1)
     98    app.measure('ping', :samples => 1)
     99  end
     100  node.addApplication("ping") do |app|
     101    app.setProperty('target', property.sinkaddr24)
     102    app.setProperty('count', 30)
     103    #app.setProperty('interval', 1)
     104    app.measure('ping', :samples => 1)
     105  end
     106end
     107
     108defGroup('Source3', property.source1) do |node|
     109  node.addApplication("ping") do |app|
     110    app.setProperty('target', property.sinkaddr11)
     111    app.setProperty('count', 30)
     112    #app.setProperty('interval', 1)
     113    app.measure('ping', :samples => 1)
     114  end
     115end
     116
     117defEvent(:MY_EVENT, every: 0.5) do
     118# Query for some measurements...
     119  # returns an array where each element is a hash representing a row from the DB
     120  query = ms('ping').select { [ :remote] }
     121  data = defQuery(query)
     122
     123  triggered = false
     124  if !data.nil? && !(last_row = data.pop).nil? # Make sure we have some data
     125    next if peak_list.include?(last_row[:remote]) # Do nothing if we have seen this sample before
     126    if !peak_list.include?(last_row[:remote])
     127      peak_list << last_row[:remote] # record that sample, so we dont trigger on it again
     128    end
     129    if peak_list.include?('192.168.1.7')&&peak_list.include?('192.168.1.8')&&peak_list.include?('192.168.1.13')&&peak_list.include?('192.168.1.14')&&peak_list.include?('192.168.1.15')
     130     
     131      triggered = true
     132    end
     133  end
     134  triggered
     135end
     136onEvent :MY_EVENT do
     137  group('Source3').startApplications
     138end
     139
     140onEvent(:ALL_UP_AND_INSTALLED) do |event|
     141  info "Starting the ping"
     142  after 2 do
     143    group('Source2').startApplications
     144  end
     145  after 20 do
     146    group('Source1').startApplications
     147  end
     148  after 80 do
     149    info "Stopping the ping"
     150    allGroups.stopApplications
     151    Experiment.done
     152  end
     153end
     154
     155defGraph 'RTT' do |g|
     156  g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
     157  g.caption "RTT of received packets."
     158  g.type 'line_chart3'
     159  g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
     160  g.xaxis :legend => 'oml_seq'
     161  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
     162end
     163
     164}}}
     165
     166=== 3.1.3 Start your application from !LabWiki ===
     167
     168To 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.
     169Explanation of the fields in the Execute window:
     170
     171* name: In this field you specify the name of your experiment.
     172
     173* project: This pull-down menu list all the projects you are currently a member of. Select the project that contains the slice you want to run your experiment on.
     174
     175* experiment context: With the context you can specify a certain set of experiments. E.g., a series of experiments you run under a certain set of startup parameters. This field is not mandatory and only necessary if you would like to save your experiment data to view later.
     176
     177* slice: This pull down menu lists all slice that have been created under "project". Select the slice you would like to run your experiment on.
     178
     179*Change source1 and source2 fields to include your slice name similar to nodea-<slicename>
     180
     181Then, start the actual experiment by clicking on the "Start Experiment" button.
     182[[BR]]
     183
     184[[Image(learnswitch2.png, 60%)]]
     185
     186
     187=== 3.1.4 During experiment execution ===
     188
     189After pressing the "Start" button, the Execute window will change and start showing status information about your experiment.
     190The figure below gives an example for the Execute window during experiment execution.
     191
     192[[Image(GEC22learnswitchgraph.png, 60%)]]
     193
     194Now 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.
     195
     196Depending on the status of your resources and experiments, you will see one of the following statuses at the top of the Execute window:
     197 * 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
     198 * Running - This status appears when your experiment starts running. If it fails for one or more reasons, a Failed status will appear instead
     199 * Aborted - When you click on "Stop Experiment" at the top-left corner of the Execute window, the status changes to aborted
     200 * Finished - When your experiment is done, you will see this status
     201
     202== Note to Student ==
     203
     204Please check out this [http://groups.geni.net/geni/wiki/GEC22Agenda/LabWiki/ModuleA/Execute#NoteforStudents link]
     205== Note to Instructors ==
     206Please check out this [http://groups.geni.net/geni/wiki/GEC22Agenda/LabWiki/ModuleA/Execute#NotetoInstructors link]
     207= [wiki:GEC22Agenda/LabWiki/ModuleC/Finish Next: Finish] =
     208= [wiki:GEC22Agenda/LabWiki/ModuleC/DesignSetup Design] =