| 127 | |
| 128 | To get the topdl representation out of the (potentially large and complex) dict that describes it, the simplest mechanism is to just call the topdl.Topology constructor on the dict: |
| 129 | |
| 130 | {{{ |
| 131 | top = topdl.Topology(**request['segmentdescription']['topdldescription']) |
| 132 | }}} |
| 133 | |
| 134 | That is done in all the existing plug-in code. The various plug-ins walk, alter, and write topologies in several ways, and that code is a good guide to them. The [source:fedd/trunk/federation/topdl.py topdl source] is also available. |
| 135 | |
| 136 | The connection information explains how the connectivity is established between the sub-experiments. Now there are two ways to establish connections - ssh tunnels and direct transit connections. The ssh connection implies a portal in this experiment (it will be in the topology description) that will connect to the peer. Generally the port on which to communicate will be a parameter as it is here. Parameters are set using the SetValue interface, which is demonstrated in most existing plug-ins. |
| 137 | |
| 138 | A plug-in should export its connection parameters as soon as it can determine them, and import connection parameters as late as it can in the experiment creation process. |
| 139 | |
| 140 | The service parameters are the same format, and for services exported from this sub-experiment often the same content, as those returned from a !RequestAccess request. |
| 141 | |
| 142 | The connectivity and service information is particularly useful if the service and connectivity set-up is being done using [FeddAbout#TheFederationKit the DETER federation kit]. While other systems for providing this connectivity are fine, the federation kit provides a robust implementation that runs across several Unix based platforms. The [source:fedd/trunk/federation/emulab_access.py Emulab plug-in] is a good place to look at the details of configuring the federation kit. |
| 143 | |
| 144 | In addition to configuring and establishing connectivity, the plug-in must convert the topology description into an embeddable topology. The [source:fedd/trunk/federation/topdl.py topdl source] includes several conversions into different formats, including emulab ns2 and [http://www.protogeni.net/trac/protogeni/wiki/RSpec ProtoGENI RSpecs (v1.0)]. |
| 145 | |
| 146 | While there is considerable support available, !StartSegment is the operation that is the most tricky for the plug-in developer. |
| 147 | |
| 148 | The response has the format: |
| 149 | |
| 150 | {{{ |
| 151 | |
| 152 | response = { |
| 153 | # Same as in the request |
| 154 | 'allocID': { 'fedid': fedid_object }, |
| 155 | 'allocationLog': 'a log of the allocation from the plug-in's perspective. This may be edited or complete.', |
| 156 | 'segmentdescription' : { 'topdldescription': # Topdl description |
| 157 | }, |
| 158 | # Description of the allocation |
| 159 | 'embedding': [ { 'topname': 'name_from_topdl', 'physname': 'testbed_name', 'testbed': 'testbed_id_from_topdl' }, #... |
| 160 | ], |
| 161 | # Generic attribute value pairs, rarely used. |
| 162 | 'fedAttr' : [ { 'attribute': 'a1', 'value': 'v1'}, {'attribute': 'a2', 'value: 'v2' } ], |
| 163 | } |
| 164 | }}} |
| 165 | |
| 166 | The allocation log is a plug-in's eye view of the allocation. It is output by the experiment controller and can be viewed by the user using [FeddCommands#fedd_spewlog.py fedd_spewlog.py]. |
| 167 | |
| 168 | The segment description that is returned may be annotated with more detail about the segment as constructed. For example specifics of the hardware on which an element was instantiated could be filled in. |
| 169 | |
| 170 | The embedding provides a way for the experiment controller to map elements from the global experiment description into a name in the plug-in's name space. Currently this is available to the user from the [FeddCommands#fedd_ftopo.py fedd_ftopo.py] command and is used in ad hoc ways. In a future release this information will be useful in executing remote operations from the experiment controller. |
| 171 | |
| 172 | == !TerminateSegment === |
| 173 | |