Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision of Experiments Tutorials and 'Theoretically Working' adaptations to OMF6 #5

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f8cfb3b
New code set-out
Jun 18, 2013
ad3af96
Ruby Syntax highlighting
Jun 18, 2013
77cf049
Removed DISABLED
Jun 19, 2013
ff5da43
Nicer code and spelling mistakes
Jun 19, 2013
7c6293b
Fixed markdown formatting problem
Jun 19, 2013
fa0e162
Changed comments
Jun 19, 2013
8032979
Adapted experiment to OMF6
Jun 19, 2013
8b2ddb7
Fixed some description mistakes
Jun 19, 2013
ac30b1a
Changes all tutorial file-formats to markdown
Jun 19, 2013
4ac574b
changed node8 to node9
Jun 19, 2013
a49fc74
Renamed tutorial files
Jun 19, 2013
c9c8908
Changed filename
Jun 19, 2013
9c08866
Introduced new markdown feature
Jun 19, 2013
baf2aa6
Converted experiment 3 from OMF5 to OMF6. Still some errors.
Jun 20, 2013
4100538
Addressed error messages
Jun 20, 2013
af8b8e8
Fixed bugs. Still errors in code.
Jun 20, 2013
17b4201
Fixed syntax error at lines 26 and 45
Jun 20, 2013
f45898d
Errors stilll present
Jun 20, 2013
3da060c
Solved errors
Jun 20, 2013
a90bfe2
Defined properties and measurements
Jun 20, 2013
a640c11
Changed some comments
Jun 20, 2013
e697367
Changed syntax of experiment04
Jun 20, 2013
1cdae58
Theoretically working code (w/ one exception)
Jun 20, 2013
e54e4e5
Adapted syntax highlighting code to yard
Jun 20, 2013
3ecdaa2
Largely converted experiment05 to OMF6
Jun 20, 2013
8ea74a3
Breifly adapted to OMF6
Jun 20, 2013
496f71d
Theoretically working ED with small errors
Jun 20, 2013
7b56fb8
Briefly converted to OMF6 with errors
Jun 20, 2013
60b04ff
Briefly adapted experiment for OMF6
Jun 20, 2013
ca39d7a
Theoretically working experiment
Jun 20, 2013
2429909
Theoretically working experiment
Jun 20, 2013
19e5d96
Theoretically working experiment
Jun 20, 2013
c524bd5
Mostly working code
Jun 20, 2013
f961011
Requires some revision for experiment to work
Jun 20, 2013
e8f3537
Theoretically working experiment
Jun 20, 2013
d2c9ba7
Requires revision for experiment to work properly
Jun 20, 2013
08d69cf
Theoretically working with some revisions required
Jun 20, 2013
2200d63
Introducing new experiment code to tutorials mkd
Jun 20, 2013
b34b2ab
Markdown Editing
Jun 20, 2013
c617a61
Tutorial complete and optimised for YARD
Jun 20, 2013
ff966ff
Experiment tutorial complete and optimised for yard
Jun 20, 2013
ab1ebd6
Experiment Tutorial complete and optimised for YARD
Jun 20, 2013
c5e3ea9
Experiment Tutorial complete
Jun 20, 2013
d69f2aa
Experiment Tutorials 1-3 Complete and optimised for YARD
Jun 21, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
tags
**/coverage
documentation
omf_common/example/auth
omf_common/example/auth
File renamed without changes
173 changes: 95 additions & 78 deletions doc/tutorials/TUTORIAL_00.mkd → doc/tutorials/Experiment01.mkd
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Tutorial 00
# Experiment 01

1. "Hello World" Tutorial

1. "Hello World" *Experiment Tutorial*
---------------------------

This simple tutorial presents all the basic steps to develop, run, and
This simple experiment tutorial presents all the basic steps to develop, run, and
access the result of an experiment with OMF 6.
Subsequent tutorials will build on this one to introduce further OMF
features.
Expand All @@ -27,7 +28,7 @@ Description Language
**Files**

The experiment description (aka script) is:
{file:doc/tutorials/tutorial00.rb tutorial00.rb}
{file:doc/tutorials/experiment01.rb experiment01.rb}

**Experiment Scenario**

Expand Down Expand Up @@ -135,69 +136,85 @@ of the resources involved in an experiment and the sets of actions to perform
in order to realize that experiment. An ED is written using the
OMF Experiment Description Language (OEDL).

The ED describing this simple “Hello World” experiment is {file:doc/tutorials/tutorial00.rb tutorial00.rb}. It is composed of 3 distinct
The ED describing this simple “Hello World” experiment is {file:doc/tutorials/experiment01.rb experiment01.rb}. It is composed of 3 distinct
parts, described in the following listing and subsections below.

# A. Define an OMF Application Definition for the ping-oml2 application
# The OMF entities are using this definition to know where to find the
# application, what are its configurable parameters, and what are the
# OML2 measurement points that it provides.
# This ping-oml2 application will be known by OMF entities as 'ping_oml2'
#
defApplication('ping_oml2') do |app|
app.description = 'Simple Definition for the ping-oml2 application'
# Define the path to the binary executable for this application
app.binary_path = '/usr/bin/ping-oml2'
# Define the configurable parameters for this application
# For example if target is set to foo.com and count is set to 2, then the
# application will be started with the command line:
# /usr/bin/ping-oml2 -a foo.com -c 2
app.defProperty('target', 'Address to ping', '-a', {:type => :string})
app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
# Define the OML2 measurement point that this application provides.
# Here we have only one measurement point (MP) named 'ping'. Each measurement
# sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
app.defMeasurement('ping') do |m|

<pre class="code ruby"><code class="ruby">
#Welcome to Experiment 01
#This ED allows experimenters to ping a specified host and collect the output it recieves as measurement points

#Section 1
#Define oml2 application file-paths
#Define experiment parameters and measurement points

defApplication('ping_oml2') do |app|

#Application description and binary path
app.description = 'Simple definition of ping-oml2 application'
app.binary_path = '/usr/bin/ping-oml2'

#Configurable parameters of Experiment
app.defProperty('target', 'Address to ping', '-a', {:type => :string})
app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})


#Define measurement points that application will output
app.defMeasurement('ping') do |m|
m.defMetric('dest_addr',:string)
m.defMetric('ttl',:uint32)
m.defMetric('rtt',:double)
m.defMetric('rtt_unit',:string)
end
end

# B. Define a group of resources which will run the ping-oml2 application
# Here we define only one group (Sender), which has only one resource in it
# (omf6.nicta.node8)
#
defGroup('Sender', 'omf6.nicta.node8') do |g|
# Associate the application ping_oml2 defined above to each resources
# in this group
g.addApplication("ping_oml2") do |app|
# Configure the parameters for the ping_oml2 application
end

#Section 2
#Define resources and nodes used by oml2 application

#Create the group 'Sender' with specified nodes
defGroup('Sender', 'omf.nicta.node9') do |g|

#Associate oml2 application to group (?)
g.addApplication("ping_oml2") do |app|

#Configure target of application (Ping target)
app.setProperty('target', 'www.nicta.com.au')

#Configure amount of times to ping host
app.setProperty('count', 3)
# Request the ping_oml2 application to collect measurement samples
# from the 'ping' measuremnt point (as defined above), and send them
# to an OML2 collection point

#Request application to collect measurement point output data
app.measure('ping', :samples => 1)
end
end
end

#Section 3
#Execution of application events

onEvent(:ALL_UP_AND_INSTALLED) do |event|

# Print information message on commandline
info "Initializing first OMF experiment event"

# Start all the Applications associated to all the Group
allGroups.startApplications

# Wait for 5 sec (allowing time for 3 pings)
after 5

# Stop all the Applications associated to all the Groups
allGroups.stopApplications

# Tell the Experiment Controller to terminate the experiment now
Experiment.done
end
</code>
</pre>



# C. Define the sequence of tasks to perform when the event
# "all resources are up and all applications are install" is being triggered
#
onEvent(:ALL_UP_AND_INSTALLED) do |event|
# Print some information message
info "This is my first OMF experiment"
# Start all the Applications associated to all the Groups
allGroups.startApplications
# Wait for 5 sec
wait 5
# Stop all the Applications associated to all the Groups
allGroups.stopApplications
# Tell the Experiment Controller to terminate the experiment now
Experiment.done
end

### 3a) Application Definition

Expand All @@ -208,7 +225,7 @@ information is provided in the block of instructions defined between the
'do' and 'end' markers following the 'defApplication' commands:

defApplication('ping_oml2') do |app|
app.description = 'Simple Definition for the ping-oml2 application'
app.description = 'Simple definition of ping-oml2 application'
...
end

Expand Down Expand Up @@ -253,13 +270,13 @@ Groups. A named Group can be itself viewed as a resource holding other
resources. A given resource can belong to many groups at the same time, and
a group itself may be part of another group.
In this example, we define a single group named 'Sender', which contains a
single resource 'omf6.nicta.node8'.
single resource 'omf.nicta.node9'.

> **IMPORTANT** When running this experiment using your own resource and testbed
please change 'omf6.nicta.node8' in the ED to the actual name of your
please change 'omf.nicta.node9' in the ED to the actual name of your
own resource.

defGroup('Sender', 'omf6.nicta.node8') do |g|
defGroup('Sender', 'omf.nicta.node9') do |g|
...
end

Expand Down Expand Up @@ -294,7 +311,7 @@ triggered
For example, your experiment might involve 2 events:

- 'when my PC node is ready' and
- 'when my application has finished running'. You would then a
- 'when my application has finished running'.

You would then associate the following tasks to each of these events:

Expand Down Expand Up @@ -329,9 +346,9 @@ The set of consecutive tasks that we define are:
- wait for 5 seconds
- stop all the applications associated with all the groups

info "This is my first OMF experiment"
info "Initializing first OMF experiment event"
allGroups.startApplications
wait 5
after 5
allGroups.stopApplications

As OMF experiment are fully event driven, you have to explicitly tell the OMF
Expand All @@ -356,14 +373,14 @@ section 2, and that you have the EC software installed on your own computer,
then to run your experiment you have to:

- save its description in a file on your computer, thus either
- cut-and-paste the above ED listing into a new file named 'tutorial00.rb'
- cut-and-paste the above ED listing into a new file named 'experiment01.rb'
- download the ED directly:
{file:doc/tutorials/tutorial00.rb tutorial00.rb}
{file:doc/tutorials/experiment01.rb experiment01.rb}

- open a terminal and navigate to the folder/directory where you saved that file
- start the EC software and tell it to execute the experiment described in your ED file, using the command line:

omf_ec -u xmpp://usr:pwd@my_xmpp.com exec --oml_uri tcp:srv:port tutorial00.rb
omf_ec -u xmpp://usr:pwd@my_xmpp.com exec --oml_uri tcp:srv:port experiment01.rb

- **replace** *xmpp://usr:pwd@srv* with the credentials for your user on the
xmpp pubsub server that is used to communicate with the resources
Expand All @@ -376,7 +393,7 @@ furthermore want to use the OML2 server with hostname 'my_oml.com at port
3003 to collect the measurement of your experiment, then you would use the
command:

omf_ec -u xmpp://foo:bar@my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 tutorial00.rb
omf_ec -u xmpp://foo:bar@my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 experiment01.rb

If you would like to know more about the other options of the OMF EC software
please run the commands:
Expand All @@ -394,15 +411,15 @@ similar to this:
INFO Object: Connected
INFO Object: Start experiment: 2013-03-14T03:48:48Z
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a
INFO OmfEc: Subscribed to omf6.nicta.node8
INFO OmfEc: Config omf6.nicta.node8 to join Sender
INFO OmfEc: Newly discovered resource >> omf6dev.node8
INFO OmfEc: Subscribed to omf.nicta.node9
INFO OmfEc: Config omf.nicta.node9 to join Sender
INFO OmfEc: Newly discovered resource >> omfdev.node9
INFO OmfEc: Event triggered: 'ALL_UP'
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a_application
INFO OmfEc: Resource xmpp://[email protected] created
INFO OmfEc: Newly discovered resource >> bd9c68d5-1469-41a0-9a33-4bdba501f7b0
INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
INFO Object: This is my first OMF experiment
INFO Object: Initializing first OMF experiment event
INFO Object: Request from Experiment Script: Wait for 10s....
WARN Object: Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'
INFO OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - msg: env -i /usr/bin/ping-oml2 -a www.nicta.com.au -c 3 --oml-config /tmp/bd9c68d5.xml
Expand All @@ -421,8 +438,8 @@ similar to this:

The above screen output was optained when running the EC on the NICTA testbed,
with the experiment described in
{file:doc/tutorials/tutorial00.rb tutorial00.rb}
and using the resource named 'omf6.nicta.node8'
{file:doc/tutorials/experiment01.rb experiment01.rb}
and using the resource named 'omf.nicta.node9'

### 4c) What does that screen output mean?

Expand All @@ -435,17 +452,17 @@ this experiment (ID, xmpp server used, resource used,...):
INFO Object: Connected
INFO Object: Start experiment: 2013-03-14T03:48:48Z
...
INFO OmfEc: Subscribed to omf6.nicta.node8
INFO OmfEc: Config omf6.nicta.node8 to join Sender
INFO OmfEc: Subscribed to omf.nicta.node9
INFO OmfEc: Config omf.nicta.node9 to join Sender

- It also provides us some feedback about its communication with the xmpp
server and other OMF entities:

...
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a
INFO OmfEc: Subscribed to omf6.nicta.node8
INFO OmfEc: Subscribed to omf.nicta.node9
...
INFO OmfEc: Newly discovered resource >> omf6dev.node8
INFO OmfEc: Newly discovered resource >> omfdev.node9
...
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a_application
...
Expand All @@ -469,7 +486,7 @@ results/outputs:

...
INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
INFO Object: This is my first OMF experiment
INFO Object: Initializing first OMF experiment event
INFO Object: Request from Experiment Script: Wait for 10s....
WARN Object: Calling 'wait' or 'sleep' will block entire ...
INFO OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - ...
Expand Down Expand Up @@ -533,7 +550,7 @@ use that tool, please refer to the [omf_web documentation]
6. What should I do next?
-------------------------

We will soon release more tutorials on how to use all the features of OMF6
We will soon release more tutorials on how to use all the features of omf
from the experimenter's perspective.

In the meantime, you may have a look at the OMF 5.4 documentation, which
Expand Down
Loading