Changes between Version 1 and Version 2 of GEC21Agenda/OEDL/Experiment1


Ignore:
Timestamp:
10/16/14 22:42:18 (9 years ago)
Author:
thierry.rakotoarivelo@nicta.com.au
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC21Agenda/OEDL/Experiment1

    v1 v2  
    33
    44
    5 
    6 <!DOCTYPE html> 
    7 <html lang="en">
    8 <head>
    9   <meta charset="utf-8">
    10   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    11   <title>tut_event_state</title>
    12   <meta name="viewport" content="width=device-width, initial-scale=1.0">
    13   <style>
    14 /*
    15 This document has been created with Marked.app <http://markedapp.com>, Copyright 2013 Brett Terpstra
    16 Content is property of the document author
    17 Please leave this notice in place, along with any additional credits below.
    18 ---------------------------------------------------------------
    19 Title: GitHub
    20 Author: Brett Terpstra
    21 Description: Github README style. Includes theme for Pygmentized code blocks.
    22 */
    23 html,body{color:black}*:not('#mkdbuttons'){margin:0;padding:0}#wrapper{font:13.34px helvetica,arial,freesans,clean,sans-serif;-webkit-font-smoothing:subpixel-antialiased;line-height:1.4;padding:3px;background:#fff;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}p{margin:1em 0}a{color:#4183c4;text-decoration:none}#wrapper{background-color:#fff;padding:30px;margin:15px;font-size:14px;line-height:1.6}#wrapper>*:first-child{margin-top:0!important}#wrapper>*:last-child{margin-bottom:0!important}@media screen{#wrapper{box-shadow:0 0 0 1px #cacaca,0 0 0 4px #eee}}h1,h2,h3,h4,h5,h6{margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:subpixel-antialiased;cursor:text}h1{font-size:28px;color:#000}h2{font-size:24px;border-bottom:1px solid #ccc;color:#000}h3{font-size:18px;color:#333}h4{font-size:16px;color:#333}h5{font-size:14px;color:#333}h6{color:#777;font-size:14px}p,blockquote,table,pre{margin:15px 0}ul{padding-left:30px}ol{padding-left:30px}ol li ul:first-of-type{margin-top:0}hr{background:transparent url(data:image/png;base64,iVBORw0K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jdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;border:0 none;color:#ccc;height:4px;padding:0}#wrapper>h2:first-child{margin-top:0;padding-top:0}#wrapper>h1:first-child{margin-top:0;padding-top:0}#wrapper>h1:first-child+h2{margin-top:0;padding-top:0}#wrapper>h3:first-child,#wrapper>h4:first-child,#wrapper>h5:first-child,#wrapper>h6:first-child{margin-top:0;padding-top:0}a:first-child h1,a:first-child h2,a:first-child h3,a:first-child h4,a:first-child h5,a:first-child h6{margin-top:0;padding-top:0}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,ul li>:first-child,ol li>:first-child{margin-top:0}dl{padding:0}dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px}dl dt:first-child{padding:0}dl dt>:first-child{margin-top:0}dl dt>:last-child{margin-bottom:0}dl dd{margin:0 0 15px;padding:0 15px}dl dd>:first-child{margin-top:0}dl dd>:last-child{margin-bottom:0}blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}table{border-collapse:collapse;border-spacing:0;font-size:100%;font:inherit}table th{font-weight:bold;border:1px solid #ccc;padding:6px 13px}table td{border:1px solid #ccc;padding:6px 13px}table tr{border-top:1px solid #ccc;background-color:#fff}table tr:nth-child(2n){background-color:#f8f8f8}img{max-width:100%}code,tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px;font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;color:#333}pre>code{margin:0;padding:0;white-space:pre;border:0;background:transparent}.highlight pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px}pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px}pre code,pre tt{background-color:transparent;border:0}.poetry pre{font-family:Georgia,Garamond,serif!important;font-style:italic;font-size:110%!important;line-height:1.6em;display:block;margin-left:1em}.poetry pre code{font-family:Georgia,Garamond,serif!important;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;white-space:pre-wrap}sup,sub,a.footnote{font-size:1.4ex;height:0;line-height:1;vertical-align:super;position:relative}sub{vertical-align:sub;top:-1px}@media print{body{background:#fff}img,pre,blockquote,table,figure{page-break-inside:avoid}#wrapper{background:#fff;border:0}code{background-color:#fff;color:#333!important;padding:0 .2em;border:1px solid #dedede}pre{background:#fff}pre code{background-color:white!important;overflow:visible}}@media screen{body.inverted{color:#eee!important;border-color:#555;box-shadow:none}.inverted #wrapper,.inverted hr .inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted th,.inverted .math,.inverted caption,.inverted dd,.inverted dt,.inverted blockquote{color:#eee!important;border-color:#555;box-shadow:none}.inverted td,.inverted th{background:#333}.inverted h2{border-color:#555}.inverted hr{border-color:#777;border-width:1px!important}::selection{background:rgba(157,193,200,0.5)}h1::selection{background-color:rgba(45,156,208,0.3)}h2::selection{background-color:rgba(90,182,224,0.3)}h3::selection,h4::selection,h5::selection,h6::selection,li::selection,ol::selection{background-color:rgba(133,201,232,0.3)}code::selection{background-color:rgba(0,0,0,0.7);color:#eee}code span::selection{background-color:rgba(0,0,0,0.7)!important;color:#eee!important}a::selection{background-color:rgba(255,230,102,0.2)}.inverted a::selection{background-color:rgba(255,230,102,0.6)}td::selection,th::selection,caption::selection{background-color:rgba(180,237,95,0.5)}.inverted{background:#0b2531;background:#252a2a}.inverted #wrapper{background:#252a2a}.inverted a{color:#acd1d5}}.highlight .c{color:#998;font-style:italic}.highlight .err{color:#a61717;background-color:#e3d2d2}.highlight .k,.highlight .o{font-weight:bold}.highlight .cm{color:#998;font-style:italic}.highlight .cp{color:#999;font-weight:bold}.highlight .c1{color:#998;font-style:italic}.highlight .cs{color:#999;font-weight:bold;font-style:italic}.highlight .gd{color:#000;background-color:#fdd}.highlight .gd .x{color:#000;background-color:#faa}.highlight .ge{font-style:italic}.highlight .gr{color:#a00}.highlight .gh{color:#999}.highlight .gi{color:#000;background-color:#dfd}.highlight .gi .x{color:#000;background-color:#afa}.highlight .go{color:#888}.highlight .gp{color:#555}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#a00}.highlight .kc,.highlight .kd,.highlight .kn,.highlight .kp,.highlight .kr{font-weight:bold}.highlight .kt{color:#458;font-weight:bold}.highlight .m{color:#099}.highlight .s{color:#d14}.highlight .na{color:#008080}.highlight .nb{color:#0086b3}.highlight .nc{color:#458;font-weight:bold}.highlight .no{color:#008080}.highlight .ni{color:#800080}.highlight .ne,.highlight .nf{color:#900;font-weight:bold}.highlight .nn{color:#555}.highlight .nt{color:#000080}.highlight .nv{color:#008080}.highlight .ow{font-weight:bold}.highlight .w{color:#bbb}.highlight .mf,.highlight .mh,.highlight .mi,.highlight .mo{color:#099}.highlight .sb,.highlight .sc,.highlight .sd,.highlight .s2,.highlight .se,.highlight .sh,.highlight .si,.highlight .sx{color:#d14}.highlight .sr{color:#009926}.highlight .s1{color:#d14}.highlight .ss{color:#990073}.highlight .bp{color:#999}.highlight .vc,.highlight .vg,.highlight .vi{color:#008080}.highlight .il{color:#099}.highlight .gc{color:#999;background-color:#eaf2f5}.type-csharp .highlight .k,.type-csharp .highlight .kt{color:#00F}.type-csharp .highlight .nf{color:#000;font-weight:normal}.type-csharp .highlight .nc{color:#2b91af}.type-csharp .highlight .nn{color:#000}.type-csharp .highlight .s,.type-csharp .highlight .sc{color:#a31515}
    24 </style>
    25 
    26 </head>
    27 <body class="normal">
    28   <div id="wrapper">
    29       <h1 id="gec21-oedltutorial1">GEC21 - OEDL Tutorial 1</h1>
    30 
    31 <h1 id="overview">Overview</h1>
    32 
    33 <p>This first part shows how to design, execute, and view the results of an experiment, which dynamically reacts to a user-defined event.</p>
    34 
    35 <p>This experiment demonstrate OEDL&#8217;s capability to allow user to define events which will trigger based on the state of the used resources. In other words, if one or more resources reaches a specific state, the event will trigger and some user-defined tasks will be executed.</p>
    36 
    37 <p>In this experiment:</p>
    38 
    39 <ul>
    40 <li>we start with 4 resources, i.e. 2 initial &#8216;workers&#8217; and 2 backup ones</li>
    41 <li>all workers have a ping application associated to them</li>
    42 <li>the 2 initial workers starts their ping applications</li>
    43 <li>we define a custom event which will trigger when a running ping application is stopped. The Experiment Controller will periodically monitor the state of all resources to check for this condition</li>
    44 <li>furthermore, we define a set of tasks to execute if the event is triggered. In this case, the task is to start a new ping application on one of the backup resources.</li>
    45 <li>every 20 seconds, we purposely stop the ping application running on one of the initial workers</li>
    46 <li>we display a graph of the ping&#8217;s RTT for each of the 4 resources and observe that a new ping instance starts when a previously running one is stopped</li>
    47 </ul>
    48 
    49 <figure>
    50 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig1.png" alt="Experiment 1 Overview" />
    51 <figcaption>Experiment 1 Overview</figcaption></figure>
    52 
    53 
    54 
    55 <h1 id="step1-designsetup">Step 1 - Design/Setup</h1>
    56 
    57 <p>For specific help on using LabWiki, please refer to the <a href="http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction">LabWiki introduction page</a></p>
    58 
    59 <p><strong>The OEDL experiment description</strong></p>
    60 
    61 <ul>
    62 <li>First, if you have not done it yet, login into LabWiki</li>
    63 <li>Load the &#8216;tut_event_state.oedl&#8217; experiment file in the &#8216;Prepare&#8217; Panel of LabWiki. This file contains the OEDL script for this 1st experiment</li>
    64 <li>If you are not reading this using LabWiki, you can view this OEDL file online at: <a href="http://git.io/xr4pag">http://git.io/xr4pag</a></li>
    65 </ul>
    66 
    67 <figure>
    68 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig2.png" alt="Experiment 1 OEDL Extract" />
    69 <figcaption>Experiment 1 OEDL Extract</figcaption></figure>
    70 
    71 
    72 
    73 <p><strong>Walk-through the OEDL experiment description</strong></p>
    74 
    75 <ol>
    76 <li><p>First, a reminder that all details on OEDL are available in the <a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6">OEDL reference page</a></p></li>
    77 <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#loadOEDL"><strong>loadOEDL</strong></a> (line 12). This command is used to include in your OEDL experiment other external OEDL scripts. In this example, we are loading the definition of a ping application, which has been instrumented with <a href="http://oml.mytestbed.net">OML</a></p></li>
    78 <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defProperty-38-property-38-ensureProperty"><strong>defProperty</strong></a> (line 14&#8211;18). This command is used to define experiment properties (aka variables), you can set the values of these properties as parameters for each experiment trials, and access them throughout the entire experiment run. In this example, we are defining 5 properties, to hold the names of each of the resources that we will use and the target for the ping application.</p></li>
    79 <li><p><strong>Some internal variables</strong> (line 21&#8211;29). These are classic simple Ruby commands that allow us put all our resource in a single list, then split that list into one holding the &#8216;initial&#8217; resources, and one holding the &#8216;backup&#8217; resources. As opposed to the above defProperty variables, these internal variables cannot be set at the start of each experiment trial (without having to change the content of the OEDL script itself)</p></li>
    80 <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>defGroup</strong></a> (line 32&#8211;41). This command is used to define a group of resources which we will use in this experiment. A group may contain many resources or any other group, and a resource may be included in many groups. This commands may also be used to associate a set of configurations and applications to all resources in a group. In this example, we first define 4 groups (e.g. &#8216;Worker_X&#8217;), each with only one resource, then we are associating an instrumented ping to the unique resource in each group. This association is done using the <a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGroup"><strong>addApplication</strong></a>. Furthermore, we also define a final group (&#8216;Initial_Worker&#8217;), which will contain the &#8216;Worker&#8217; groups with the initial resources.</p></li>
    81 <li><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defEvent"><strong>defEvent</strong></a> (line 23&#8211;53). This command defines the name of a user&#8217;s custom event and the block of conditions which will be used to check if this event should be triggered.
    82 
    83 <ul>
    84 <li>Within the condition block we have access to the &#8216;state&#8217; variable, which holds a array. Each element of that array represents a resource and is a hash of key/value pairs corresponding to each properties of that resource.</li>
    85 <li>In this example, in our condition block we check for each resource if it failed before. If not we check if is an application and if it is currently stopped. If so then we add it to the list of failed resource, and we trigger the event.</li>
    86 </ul></li>
    87 <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#onEvent"><strong>onEvent</strong></a> (line 55&#8211;61). This command declares the set of actions to perform when a specific event is triggered. In this example, the event is our previously defined &#8220;APP_EXITED&#8221;. The actions to perform in this case is to select a backup resource and start its ping application. There is another <strong>onEvent</strong> declaration further (line 68&#8211;74), for the event &#8220;APP_UP_AND_INSTALLED&#8221;, i.e. when all resources are ready to receive commands and all applications associated to them are installed. When this event triggers, we start the ping application on the resources within the &#8216;Initial_Worker&#8217; group, then after 60 seconds we stop all applications and terminate the experiment trial.</p></li>
    88 <li><p><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6#defGraph"><strong>defGraph</strong></a> (line 76&#8211;83). This commands defines the graphs that will be displayed while the experiment trial is running. In this example, we define 1 graph showing the RTT values from the ping applications against time for each resources in our experiment. This graph will be drawn using measurements enabled in the previous defGroup blocks.</p></li>
    89 </ol>
    90 
    91 <h1 id="step2-execute">Step 2 - Execute</h1>
    92 
    93 <ul>
    94 <li>After reviewing this OEDL experiment description, drag-and-drop it from the &#8220;Prepare&#8221; panel to the &#8220;Execute&#8221; panel, as described on the <a href="[http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction#Execute">LabWiki introduction page</a></li>
    95 <li>Set the values of the properties &#8216;res1&#8217; to &#8216;res4&#8217; to the names of your allocated resources. Similarly set the &#8216;Slice&#8217; property to your own slice.
    96 (You can optionally decide to give a name to your experiment, if not LabWiki will assign a default unique name to it.)</li>
    97 <li>Click on the &#8220;Start Experiment&#8221; button. You will soon see output messages under the &#8220;Logging&#8221; section. Some of these messages are from the OMF Experiment Controller, which interprets your OEDL experiment description and sends corresponding commands to the resources. Other messages are from the resources themselves (either the VM nodes or the applications), reporting on configuration and command results.</li>
    98 </ul>
    99 
    100 <figure>
    101 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig3.png" alt="Experiment 1 Execute Screenshot" />
    102 <figcaption>Experiment 1 Execute Screenshot</figcaption></figure>
    103 
    104 
    105 
    106 <ul>
    107 <li>Above that &#8220;Logging&#8221; section, you should soon see the graph, which we defined in the OEDL experiment description. It is drawn dynamically as measurements are collected from the resources.</li>
    108 </ul>
    109 
    110 <figure>
    111 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig4.png" alt="Experiment 1 Running Screenshot" />
    112 <figcaption>Experiment 1 Running Screenshot</figcaption></figure>
    113 
    114 
    115 
    116 <h1 id="step3-finish">Step 3 - Finish</h1>
    117 
    118 <ul>
    119 <li>A message in the &#8220;Execute&#8221; panel will appear to inform you that the experiment execution has finished. At this stage, you should have the complete graphs for this experiment in that panel, which should look as follows.</li>
    120 </ul>
    121 
    122 <figure>
    123 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig5.png" alt="Experiment 1 Result Screenshot" />
    124 <figcaption>Experiment 1 Result Screenshot</figcaption></figure>
    125 
    126 
    127 
    128 <ul>
    129 <li><p>You may interact to with these graphs, e.g. tick or un-tick the legend&#8217;s keys to display only results from the first or/and second resource, hover the pointer above a graph point to display the underlying data point, drag-and-drop the graph via its icon to the &#8220;Plan&#8221; panel as described in the <a href="http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction#Execute">LabWiki introduction page</a></p></li>
    130 <li><p>The complete data set holding the measurements collected from this experiment is stored in an SQL database. You can retrieve a copy of that database by clicking on the &#8216;Database Dump&#8217; buttom in the &#8216;Execute&#8217; panel. The format of that copy is depends on your LabWiki&#8217;s deployment configuration. It could be an iRODS dump, a Zipped archive of CSV files, a SQLite3 dump or a PostgreSQL dump. By default, it is a PostgreSQL dump.</p></li>
    131 </ul>
    132 
    133 <figure>
    134 <img src="https://raw.githubusercontent.com/mytestbed/gec_demos_tutorial/master/gec21_oedl_tutorial/wiki/tut_event_state.fig6.png" alt="Database Dump" />
    135 <figcaption>Database Dump</figcaption></figure>
    136 
    137 
    138 
    139 <h1 id="helpadditionalresources">Help &amp; Additional Resources</h1>
    140 
    141 <ul>
    142 <li><a href="http://groups.geni.net/geni/wiki/GEC21Agenda/OEDL/Introduction">LabWiki quick guide</a></li>
    143 <li><a href="http://mytestbed.net/projects/omf6/wiki/OEDLOMF6">OEDL Reference Document</a></li>
    144 <li><a href="http://groups.geni.net/geni/wiki/GEC21Agenda/LabWiki">GEC21 GIMI and Labwiki Tutorial</a></li>
    145 <li><a href="http://mytestbed.net/projects/omf6/wiki/Wiki">OMF6 Documentation</a></li>
    146 <li><a href="http://oml.mytestbed.net/projects/oml/wiki">OML Documentation</a></li>
    147 </ul>
    148     </div>
    149 </body>
    150 </html>
    151 
    152 
    153 
    154 
    1555}}}