| 1 | [[TOC(Tutorials/a0Basic*)]] |
| 2 | |
| 3 | == !WiSHFUL Tutorial: Basic Controller-Agent Interaction == |
| 4 | |
| 5 | === Prerequisites === |
| 6 | |
| 7 | This tutorial series assumes you have an [http://www.orbit-lab.org/userManagement/register ORBIT account], have [https://www.orbit-lab.org/schedule/ scheduled a session] on the ORBIT testbed, are familiar with [http://en.wikipedia.org/wiki/Secure_Shell SSH]'ing [http://www.orbit-lab.org/wiki/Tutorial/HelloWorld#a4.RunningtheHelloWorldexperiment into the testbed itself, and are familiar with the basics of running ORBIT experiments]. If you have not done these things yet, you may wish to do so before taking a look at this slightly more advanced experiment. If you are unfamiliar with or are entirely new to ORBIT, you may wish to start [http://www.orbit-lab.org/ here]. |
| 8 | |
| 9 | === About This Experiment === |
| 10 | |
| 11 | This tutorial illustartes use of WiSHFUL framework for experiment orchestration. In this experiment script, we'll use a WiSHFUL Controller and Agent. This experiment assumes usinge reference WiSHFUL image that is available as '''wishful.ndz''' and is design for use in SB4. |
| 12 | |
| 13 | === Experiment Script === |
| 14 | |
| 15 | The experiment script. |
| 16 | |
| 17 | * [attachment:wishful_simple.rb Experiment Script] |
| 18 | |
| 19 | Relevant sections of the script code are: |
| 20 | |
| 21 | '''1. Define the set of nodes and path for the WiSHFUL directory: |
| 22 | ''' |
| 23 | '''2. Define WiSSHFUL Controller and Agent application that will run on nodes:''' |
| 24 | |
| 25 | We use ''defApplication'' to create two reference application names: ''controller'' and ''agent'' that are used later in the script to actually execute corresponding WiSHFUL components. |
| 26 | {{{ |
| 27 | defApplication('iperf', 'iperf-oml2') do |app| |
| 28 | }}} |
| 29 | |
| 30 | The actual path to the applications in the node is defined as follows. |
| 31 | {{{ |
| 32 | app.path = |
| 33 | }}} |
| 34 | |
| 35 | |
| 36 | The actual experiment has the 10 second delay before the call to ''startApplications'' (to "warm up" nodes) that is followed by 60 seconds of run-time during which WiSHFUL controller manages corresponding agerm. Finally all applications are stopped and the experiment exits out. |
| 37 | |
| 38 | |
| 39 | === Executing the Experiment Script === |
| 40 | An overview on running experiment scripts on the ORBIT testbed can be found on the [wiki:Documentation/CGettingStarted Getting Started Page]. |
| 41 | |
| 42 | In order to run this experiment script, connect to the console of the SB4 for which you have an active and approved reservation for and load the ''wishfull.ndz'' image onto experiment nodes. |
| 43 | {{{ |
| 44 | user@console:~$ omf load -i wishful.ndz -t node1-1,node2-1 |
| 45 | }}} |
| 46 | |
| 47 | After the nodes have finished imaging, turn the nodes on. The topology used here is ''system:topo:imaged'' which selects the prior set of nodes that were successfully imaged. |
| 48 | {{{ |
| 49 | user@console:~$ omf tell -a on -t system:topo:imaged |
| 50 | }}} |
| 51 | Wait about 1 minute before proceeding to allow the nodes time to boot up. |
| 52 | |
| 53 | Run the experiment:{{{ |
| 54 | user@console:~$ omf exec wishful_simple.rb --duration 60 |
| 55 | }}} |
| 56 | |
| 57 | The output of this script should be similar to the following: |
| 58 | {{{ |
| 59 | user@console.sb4:~# omf exec wishful_simple.rb |
| 60 | |
| 61 | INFO NodeHandler: OMF Experiment Controller 5.4 (git 861d645) |
| 62 | INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml |
| 63 | INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/ |
| 64 | INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/ |
| 65 | INFO NodeHandler: Add domain http - http://internal2dmz.orbit-lab.org:5054/ |
| 66 | INFO NodeHandler: Add domain http - http://external1.orbit-lab.org:5054/ |
| 67 | INFO NodeHandler: Slice ID: default_slice (default) |
| 68 | INFO NodeHandler: Experiment ID: default_slice-2016-06-10t04.50.48.026-04.00 |
| 69 | INFO NodeHandler: Message authentication is disabled |
| 70 | INFO Experiment: load system:exp:stdlib |
| 71 | INFO property.resetDelay: resetDelay = 230 (Fixnum) |
| 72 | INFO property.resetTries: resetTries = 1 (Fixnum) |
| 73 | INFO Experiment: load system:exp:eventlib |
| 74 | INFO Experiment: load system:exp:winlib |
| 75 | INFO Experiment: load wishful_simple.rb |
| 76 | INFO property.contr: contr = "node2-1" (String) |
| 77 | INFO property.agent: agent = "node1-1" (String) |
| 78 | INFO ALL_UP_AND_INSTALLED: Event triggered. Starting the associated tasks. |
| 79 | INFO exp: Wait for all nodes to come up |
| 80 | INFO exp: Request from Experiment Script: Wait for 10s.... |
| 81 | INFO BRING_UP: Event triggered. Starting the associated tasks. |
| 82 | INFO Experiment: Bringing up resources |
| 83 | INFO exp: Both controller and agent are started... |
| 84 | INFO exp: Request from Experiment Script: Wait for 60s.... |
| 85 | INFO exp: Both controller and agent are stopped... |
| 86 | INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks. |
| 87 | INFO NodeHandler: |
| 88 | INFO NodeHandler: Shutting down experiment, please wait... |
| 89 | INFO NodeHandler: |
| 90 | INFO run: Experiment default_slice-2016-06-10t04.50.48.026-04.00 finished after 1:20 |
| 91 | }}} |
| 92 | |
| 93 | === Retrieving Results === |
| 94 | |
| 95 | This particular experiment does not generate any data but rather illustrates how to run WiSHFUL based experiment. The primary observable output from both experiment script execution as well as output of the controller/agent interraction are aggregated on the console in a log file: /tmp/''<Experiment ID>''.log |
| 96 | |
| 97 | For this example, this log file is: /tmp/default_slice-2016-06-10t04.50.48.026-04.00.log |
| 98 | |
| 99 | Partial contents of this file is: |
| 100 | {{{ |
| 101 | 2016-06-10 04:51:13 DEBUG nodeHandler::AppContext: Starting application 'controller#1' |
| 102 | 2016-06-10 04:51:13 DEBUG nodeHandler::set::Controllers: Send ('Controllers') - '<EXECUTE><TARGET>Controllers</TARGET><APPID>controller#1< |
| 103 | /APPID><PATH>/root/wishful/examples/simple/wishful_simple_controller</PATH><ENV></ENV><CMDLINEARGS>--config /root/wishful/examples/simple/ |
| 104 | controller_config.yaml</CMDLINEARGS></EXECUTE>' |
| 105 | 2016-06-10 04:51:13 DEBUG nodeHandler::set::Agents: Start all applications |
| 106 | 2016-06-10 04:51:13 DEBUG nodeHandler::AppContext: Starting application 'agent#1' |
| 107 | 2016-06-10 04:51:13 DEBUG nodeHandler::set::Agents: Send ('Agents') - '<EXECUTE><TARGET>Agents</TARGET><APPID>agent#1</APPID><PATH>/root/w |
| 108 | ishful/examples/simple/wishful_simple_agent</PATH><ENV></ENV><CMDLINEARGS>--config /root/wishful/examples/simple/agent_config.yaml</CMDLIN |
| 109 | EARGS></EXECUTE>' |
| 110 | 2016-06-10 04:51:13 DEBUG nodeHandler::AgentCommands: APP_EVENT STARTED from: 'controller#1' (node2-1.sb4.orbit-lab.org) - msg: '' |
| 111 | 2016-06-10 04:51:13 INFO nodeHandler::exp: Both controller and agent are started... |
| 112 | 2016-06-10 04:51:13 INFO nodeHandler::exp: Request from Experiment Script: Wait for 50s.... |
| 113 | 2016-06-10 04:51:13 DEBUG nodeHandler::AgentCommands: APP_EVENT STARTED from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '' |
| 114 | 2016-06-10 04:51:14 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 115 | 1:14,022 - SimpleModule2.myFunc_1() - INFO - This function is executed on agent start' |
| 116 | 2016-06-10 04:51:15 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 117 | 1:15,711 - pyre_discovery_module.main.discovery_task() - INFO - Discovered Controller DL-tcp://10.14.2.1:8990, UL-tcp://10.14.2.1:8989' |
| 118 | 2016-06-10 04:51:17 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 119 | 1:17,724 - pyre_discovery_module.main.discovery_task() - INFO - Discovered Controller DL-tcp://10.14.2.1:8990, UL-tcp://10.14.2.1:8989' |
| 120 | 2016-06-10 04:51:18 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 121 | 1:18,052 - SimpleModule2.myFunc_3() - INFO - This function is executed on connection to global controller' |
| 122 | 2016-06-10 04:51:23 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 123 | 1:23,712 - SimpleModule2.myFunc_5() - INFO - This function is executed before first UPI call to module' |
| 124 | 2016-06-10 04:51:23 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 125 | 1:23,719 - SimpleModule2.send_to_module() - WARNING - Exception: function radio.clean_per_flow_tx_power_table was not correctly executed; |
| 126 | error msg: wrong' |
| 127 | 2016-06-10 04:51:26 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 128 | 1:26,471 - SimpleModule2.before_set_channel() - INFO - This function is executed before set_channel' |
| 129 | 2016-06-10 04:51:26 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 130 | 1:26,471 - SimpleModule2.set_channel() - INFO - Simple Module sets channel: 4 on interface: wlan1' |
| 131 | 2016-06-10 04:51:26 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 132 | 1:26,471 - SimpleModule2.after_set_channel() - INFO - This function is executed after set_channel' |
| 133 | 2016-06-10 04:51:33 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 134 | 1:33,735 - SimpleModule2.send_to_module() - WARNING - Exception: function radio.clean_per_flow_tx_power_table was not correctly executed; |
| 135 | error msg: wrong' |
| 136 | 2016-06-10 04:51:36 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:5 |
| 137 | 1:36,487 - SimpleModule2.before_set_channel() - INFO - This function is executed before set_channel' |
| 138 | 2016-06-10 04:51:36 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:36,487 - SimpleMod |
| 139 | ule2.set_channel() - INFO - Simple Module sets channel: 4 on interface: wlan1' |
| 140 | 2016-06-10 04:51:36 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:36,487 - SimpleMod |
| 141 | ule2.after_set_channel() - INFO - This function is executed after set_channel' |
| 142 | 2016-06-10 04:51:43 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:43,743 - SimpleMod |
| 143 | ule2.send_to_module() - WARNING - Exception: function radio.clean_per_flow_tx_power_table was not correctly executed; error msg: wrong' |
| 144 | 2016-06-10 04:51:46 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:46,495 - SimpleMod |
| 145 | ule2.before_set_channel() - INFO - This function is executed before set_channel' |
| 146 | 2016-06-10 04:51:46 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:46,496 - SimpleMod |
| 147 | ule2.set_channel() - INFO - Simple Module sets channel: 4 on interface: wlan1' |
| 148 | 2016-06-10 04:51:46 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:46,496 - SimpleMod |
| 149 | ule2.after_set_channel() - INFO - This function is executed after set_channel' |
| 150 | 2016-06-10 04:51:53 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:53,756 - SimpleMod |
| 151 | ule2.send_to_module() - WARNING - Exception: function radio.clean_per_flow_tx_power_table was not correctly executed; error msg: wrong' |
| 152 | 2016-06-10 04:51:56 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:56,508 - SimpleMod |
| 153 | ule2.before_set_channel() - INFO - This function is executed before set_channel' |
| 154 | 2016-06-10 04:51:56 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:56,508 - SimpleMod |
| 155 | ule2.set_channel() - INFO - Simple Module sets channel: 4 on interface: wlan1' |
| 156 | 2016-06-10 04:51:56 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'agent#1' (node1-1.sb4.orbit-lab.org) - msg: '2016-06-10 04:51:56,508 - SimpleMod |
| 157 | ule2.after_set_channel() - INFO - This function is executed after set_channel' |
| 158 | |
| 159 | }}} |