2 # -*- coding: utf-8 -*-
6 from constants import TESTBED_ID, TESTBED_VERSION
7 from nepi.core import metadata
8 from nepi.core.metadata import Parallel
9 from nepi.core.attributes import Attribute
10 from nepi.util import tags, validation
11 from nepi.util.constants import ApplicationStatus as AS, \
12 FactoryCategories as FC, \
13 ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP, \
14 DeploymentConfiguration as DC
22 NODEIFACE = "NodeInterface"
23 TUNIFACE = "TunInterface"
24 TAPIFACE = "TapInterface"
25 APPLICATION = "Application"
26 DEPENDENCY = "Dependency"
27 NEPIDEPENDENCY = "NepiDependency"
28 NS3DEPENDENCY = "NS3Dependency"
31 TUNFILTER = "TunFilter"
32 CLASSQUEUEFILTER = "ClassQueueFilter"
33 TOSQUEUEFILTER = "TosQueueFilter"
35 TUNFILTERS = (TUNFILTER, CLASSQUEUEFILTER, TOSQUEUEFILTER)
36 TAPFILTERS = (TUNFILTER, )
37 ALLFILTERS = (TUNFILTER, CLASSQUEUEFILTER, TOSQUEUEFILTER)
39 PL_TESTBED_ID = "planetlab"
42 ### Custom validation functions ###
43 def is_addrlist(attribute, value):
44 if not validation.is_string(attribute, value):
51 components = value.split(',')
53 for component in components:
55 addr, mask = component.split('/',1)
57 addr, mask = component, '32'
59 if mask is not None and not (mask and mask.isdigit()):
60 # No empty or nonnumeric masks
63 if not validation.is_ip4_address(attribute, addr):
64 # Address part must be ipv4
69 def is_portlist(attribute, value):
70 if not validation.is_string(attribute, value):
77 components = value.split(',')
79 for component in components:
81 pfrom, pto = component.split('-',1)
83 pfrom = pto = component
85 if not pfrom or not pto or not pfrom.isdigit() or not pto.isdigit():
86 # No empty or nonnumeric ports
92 ### Connection functions ####
94 def connect_node_iface_node(testbed_instance, node_guid, iface_guid):
95 node = testbed_instance._elements[node_guid]
96 iface = testbed_instance._elements[iface_guid]
99 def connect_node_iface_inet(testbed_instance, iface_guid, inet_guid):
100 iface = testbed_instance._elements[iface_guid]
101 iface.has_internet = True
103 def connect_tun_iface_node(testbed_instance, node_guid, iface_guid):
104 node = testbed_instance._elements[node_guid]
105 iface = testbed_instance._elements[iface_guid]
107 node.required_vsys.update(('fd_tuntap', 'vif_up', 'vif_down'))
108 node.required_packages.update(('python', 'python-crypto', 'python-setuptools', 'gcc'))
110 def connect_tun_iface_peer(proto, testbed_instance, iface_guid, peer_iface_guid):
111 iface = testbed_instance._elements[iface_guid]
112 peer_iface = testbed_instance._elements[peer_iface_guid]
113 iface.peer_iface = peer_iface
114 peer_iface.peer_iface = iface
117 peer_iface.peer_proto = \
118 peer_iface.tun_proto = proto
119 iface.tun_key = peer_iface.tun_key
121 def connect_tun_iface_filter(testbed_instance, iface_guid, filter_guid):
122 iface = testbed_instance._elements[iface_guid]
123 filt = testbed_instance._elements[filter_guid]
124 iface.filter_module = filt
125 filt.iface_guid = iface_guid
126 filt.iface = weakref.ref(iface)
128 connect_tun_iface_peer(filt.peer_proto, testbed_instance, filt.iface_guid, filt.peer_guid)
130 def connect_filter_peer(proto, testbed_instance, filter_guid, peer_guid):
131 peer = testbed_instance._elements[peer_guid]
132 filt = testbed_instance._elements[filter_guid]
133 filt.peer_proto = proto
134 filt.peer_guid = peer_guid
136 connect_tun_iface_peer(filt.peer_proto, testbed_instance, filt.iface_guid, filt.peer_guid)
138 def connect_filter_filter(proto, testbed_instance, filter_guid, peer_guid):
139 peer = testbed_instance._elements[peer_guid]
140 filt = testbed_instance._elements[filter_guid]
141 filt.peer_proto = proto
142 peer.peer_proto = proto
144 peer.peer_guid = filt.iface_guid
146 filt.peer_guid = peer.iface_guid
147 if filt.iface_guid and filt.peer_guid:
148 connect_tun_iface_peer(filt.peer_proto, testbed_instance, filt.iface_guid, filt.peer_guid)
150 def crossconnect_tun_iface_peer_init(proto, testbed_instance, iface_guid, peer_iface_data):
151 iface = testbed_instance._elements[iface_guid]
152 iface.peer_iface = None
153 iface.peer_addr = peer_iface_data.get("tun_addr")
154 iface.peer_proto = peer_iface_data.get("tun_proto") or proto
155 iface.peer_port = peer_iface_data.get("tun_port")
156 iface.peer_cipher = peer_iface_data.get("tun_cipher")
157 iface.tun_key = min(iface.tun_key, peer_iface_data.get("tun_key"))
158 iface.tun_proto = proto
160 preconfigure_tuniface(testbed_instance, iface_guid)
162 def crossconnect_tun_iface_peer_compl(proto, testbed_instance, iface_guid, peer_iface_data):
163 # refresh (refreshable) attributes for second-phase
164 iface = testbed_instance._elements[iface_guid]
165 iface.peer_addr = peer_iface_data.get("tun_addr")
166 iface.peer_proto = peer_iface_data.get("tun_proto") or proto
167 iface.peer_port = peer_iface_data.get("tun_port")
168 iface.peer_cipher = peer_iface_data.get("tun_cipher")
170 postconfigure_tuniface(testbed_instance, iface_guid)
172 def crossconnect_tun_iface_peer_both(proto, testbed_instance, iface_guid, peer_iface_data):
173 crossconnect_tun_iface_peer_init(proto, testbed_instance, iface_guid, peer_iface_data)
174 crossconnect_tun_iface_peer_compl(proto, testbed_instance, iface_guid, peer_iface_data)
176 def crossconnect_filter_peer_init(proto, testbed_instance, filter_guid, peer_data):
177 filt = testbed_instance._elements[filter_guid]
178 filt.peer_proto = proto
179 crossconnect_tun_iface_peer_init(filt.peer_proto, testbed_instance, filt.iface_guid, peer_data)
181 def crossconnect_filter_peer_compl(proto, testbed_instance, filter_guid, peer_data):
182 filt = testbed_instance._elements[filter_guid]
183 filt.peer_proto = proto
184 crossconnect_tun_iface_peer_compl(filt.peer_proto, testbed_instance, filt.iface_guid, peer_data)
186 def crossconnect_filter_peer_both(proto, testbed_instance, filter_guid, peer_data):
187 crossconnect_filter_peer_init(proto, testbed_instance, iface_guid, peer_iface_data)
188 crossconnect_filter_peer_compl(proto, testbed_instance, iface_guid, peer_iface_data)
191 def connect_dep(testbed_instance, node_guid, app_guid):
192 node = testbed_instance._elements[node_guid]
193 app = testbed_instance._elements[app_guid]
197 node.required_packages.update(set(
198 app.depends.split() ))
201 if app.home_path and app.home_path not in node.pythonpath:
202 node.pythonpath.append(app.home_path)
205 for envkey, envval in app.env.iteritems():
206 envval = app._replace_paths(envval)
207 node.env[envkey].append(envval)
210 node.rpmFusion = True
212 def connect_node_netpipe(testbed_instance, node_guid, netpipe_guid):
213 node = testbed_instance._elements[node_guid]
214 netpipe = testbed_instance._elements[netpipe_guid]
216 node.required_vsys.add('ipfw-be')
217 node.required_packages.add('ipfwslice')
220 ### Creation functions ###
222 def create_node(testbed_instance, guid):
223 parameters = testbed_instance._get_parameters(guid)
225 # create element with basic attributes
226 element = testbed_instance._make_node(parameters)
228 # add constraint on number of (real) interfaces
229 # by counting connected devices
230 dev_guids = testbed_instance.get_connected(guid, "devs", "node")
231 num_open_ifaces = sum( # count True values
232 NODEIFACE == testbed_instance._get_factory_id(guid)
233 for guid in dev_guids )
234 element.min_num_external_ifaces = num_open_ifaces
236 # require vroute vsys if we have routes to set up
237 routes = testbed_instance._add_route.get(guid)
239 vsys = element.routing_method(routes,
240 testbed_instance.vsys_vnet)
241 element.required_vsys.add(vsys)
243 testbed_instance.elements[guid] = element
245 def create_nodeiface(testbed_instance, guid):
246 parameters = testbed_instance._get_parameters(guid)
247 element = testbed_instance._make_node_iface(parameters)
248 testbed_instance.elements[guid] = element
250 def create_tuniface(testbed_instance, guid):
251 parameters = testbed_instance._get_parameters(guid)
252 element = testbed_instance._make_tun_iface(parameters)
254 # Set custom addresses, if there are any already
255 # Setting this early helps set up P2P links
256 if guid in testbed_instance._add_address and not (element.address or element.netmask or element.netprefix):
257 addresses = testbed_instance._add_address[guid]
258 for address in addresses:
259 (address, netprefix, broadcast) = address
260 element.add_address(address, netprefix, broadcast)
262 testbed_instance.elements[guid] = element
264 def create_tapiface(testbed_instance, guid):
265 parameters = testbed_instance._get_parameters(guid)
266 element = testbed_instance._make_tap_iface(parameters)
268 # Set custom addresses, if there are any already
269 # Setting this early helps set up P2P links
270 if guid in testbed_instance._add_address and not (element.address or element.netmask or element.netprefix):
271 addresses = testbed_instance._add_address[guid]
272 for address in addresses:
273 (address, netprefix, broadcast) = address
274 element.add_address(address, netprefix, broadcast)
276 testbed_instance.elements[guid] = element
278 def create_tunfilter(testbed_instance, guid):
279 parameters = testbed_instance._get_parameters(guid)
280 element = testbed_instance._make_tun_filter(parameters)
281 testbed_instance.elements[guid] = element
283 def create_classqueuefilter(testbed_instance, guid):
284 element = create_tunfilter(testbed_instance, guid)
285 element.module = "classqueue.py"
287 def create_tosqueuefilter(testbed_instance, guid):
288 element = create_tunfilter(testbed_instance, guid)
289 element.module = "tosqueue.py"
292 def create_application(testbed_instance, guid):
293 parameters = testbed_instance._get_parameters(guid)
294 element = testbed_instance._make_application(parameters)
296 # Just inject configuration stuff
297 element.home_path = "nepi-app-%s" % (guid,)
299 testbed_instance.elements[guid] = element
301 def create_dependency(testbed_instance, guid):
302 parameters = testbed_instance._get_parameters(guid)
303 element = testbed_instance._make_dependency(parameters)
305 # Just inject configuration stuff
306 element.home_path = "nepi-dep-%s" % (guid,)
308 testbed_instance.elements[guid] = element
310 def create_nepi_dependency(testbed_instance, guid):
311 parameters = testbed_instance._get_parameters(guid)
312 element = testbed_instance._make_nepi_dependency(parameters)
314 # Just inject configuration stuff
315 element.home_path = "nepi-nepi-%s" % (guid,)
317 testbed_instance.elements[guid] = element
319 def create_ns3_dependency(testbed_instance, guid):
320 parameters = testbed_instance._get_parameters(guid)
321 element = testbed_instance._make_ns3_dependency(parameters)
323 # Just inject configuration stuff
324 element.home_path = "nepi-ns3-%s" % (guid,)
326 testbed_instance.elements[guid] = element
328 def create_internet(testbed_instance, guid):
329 parameters = testbed_instance._get_parameters(guid)
330 element = testbed_instance._make_internet(parameters)
331 testbed_instance.elements[guid] = element
333 def create_netpipe(testbed_instance, guid):
334 parameters = testbed_instance._get_parameters(guid)
335 element = testbed_instance._make_netpipe(parameters)
336 testbed_instance.elements[guid] = element
338 ### Start/Stop functions ###
340 def start_application(testbed_instance, guid):
341 parameters = testbed_instance._get_parameters(guid)
342 traces = testbed_instance._get_traces(guid)
343 app = testbed_instance.elements[guid]
345 app.stdout = "stdout" in traces
346 app.stderr = "stderr" in traces
347 app.buildlog = "buildlog" in traces
348 app.outout = "output" in traces
352 def stop_application(testbed_instance, guid):
353 app = testbed_instance.elements[guid]
356 ### Status functions ###
358 def status_application(testbed_instance, guid):
359 if guid not in testbed_instance.elements.keys():
360 return AS.STATUS_NOT_STARTED
362 app = testbed_instance.elements[guid]
365 ### Configure functions ###
367 def configure_nodeiface(testbed_instance, guid):
368 element = testbed_instance._elements[guid]
370 # Cannot explicitly configure addresses
371 if guid in testbed_instance._add_address:
372 raise ValueError, "Cannot explicitly set address of public PlanetLab interface"
375 node_guid = testbed_instance.get_connected(guid, "node", "devs")[0]
376 dev_guids = testbed_instance.get_connected(node_guid, "node", "devs")
377 siblings = [ self._element[dev_guid]
378 for dev_guid in dev_guids
379 if dev_guid != guid ]
381 # Fetch address from PLC api
382 element.pick_iface(siblings)
384 # Do some validations
387 def preconfigure_tuniface(testbed_instance, guid):
388 element = testbed_instance._elements[guid]
390 # Set custom addresses if any, and if not set already
391 if guid in testbed_instance._add_address and not (element.address or element.netmask or element.netprefix):
392 addresses = testbed_instance._add_address[guid]
393 for address in addresses:
394 (address, netprefix, broadcast) = address
395 element.add_address(address, netprefix, broadcast)
397 # Link to external interface, if any
398 for iface in testbed_instance._elements.itervalues():
399 if isinstance(iface, testbed_instance._interfaces.NodeIface) and iface.node is element.node and iface.has_internet:
400 element.external_iface = iface
403 # Set standard TUN attributes
404 if (not element.tun_addr or not element.tun_port) and element.external_iface:
405 element.tun_addr = element.external_iface.address
406 element.tun_port = testbed_instance.tapPortBase + int(guid)
409 traces = testbed_instance._get_traces(guid)
410 for capmode in ('pcap', 'packets'):
411 if capmode in traces:
412 element.capture = capmode
415 element.capture = False
417 # Do some validations
421 if element.peer_proto:
422 if element.peer_iface and isinstance(element.peer_iface, testbed_instance._interfaces.TunIface):
424 listening = id(element) < id(element.peer_iface)
427 if not element.tun_addr or not element.tun_port:
429 elif not element.peer_addr or not element.peer_port:
432 # both have addresses...
433 # ...the one with the lesser address listens
434 listening = element.tun_addr < element.peer_addr
439 def postconfigure_tuniface(testbed_instance, guid):
440 element = testbed_instance._elements[guid]
445 def wait_tuniface(testbed_instance, guid):
446 element = testbed_instance._elements[guid]
449 element.async_launch_wait()
452 def configure_node(testbed_instance, guid):
453 node = testbed_instance._elements[guid]
455 # Just inject configuration stuff
456 node.home_path = "nepi-node-%s" % (guid,)
457 node.ident_path = testbed_instance.sliceSSHKey
458 node.slicename = testbed_instance.slicename
460 # Do some validations
463 # this will be done in parallel in all nodes
464 # this call only spawns the process
465 node.install_dependencies()
467 def configure_node_routes(testbed_instance, guid):
468 node = testbed_instance._elements[guid]
469 routes = testbed_instance._add_route.get(guid)
473 for dev_guid in testbed_instance.get_connected(guid, "devs", "node")
474 for dev in ( testbed_instance._elements.get(dev_guid) ,)
475 if dev and isinstance(dev, testbed_instance._interfaces.TunIface) ]
477 vsys = testbed_instance.vsys_vnet
479 node.configure_routes(routes, devs, vsys)
481 def configure_application(testbed_instance, guid):
482 app = testbed_instance._elements[guid]
484 # Do some validations
487 # Wait for dependencies
488 app.node.wait_dependencies()
493 def configure_dependency(testbed_instance, guid):
494 dep = testbed_instance._elements[guid]
496 # Do some validations
499 # Wait for dependencies
500 dep.node.wait_dependencies()
505 def configure_netpipe(testbed_instance, guid):
506 netpipe = testbed_instance._elements[guid]
508 # Do some validations
511 # Wait for dependencies
512 netpipe.node.wait_dependencies()
517 ### Factory information ###
519 connector_types = dict({
521 "help": "Connector from node to applications",
527 "help": "Connector from node to network interfaces",
533 "help": "Connector from node to application dependencies "
534 "(packages and applications that need to be installed)",
540 "help": "Connector from network interfaces to the internet",
546 "help": "Connector to a Node",
552 "help": "Connector to a NetPipe",
559 "help": "ip-ip tunneling over TCP link",
565 "help": "ip-ip tunneling over UDP datagrams",
571 "help": "IP or Ethernet tunneling using the GRE protocol",
577 "help": "TUN device file descriptor provider",
583 "help": "TUN device file descriptor slot",
592 "from": (TESTBED_ID, NODE, "devs"),
593 "to": (TESTBED_ID, NODEIFACE, "node"),
594 "init_code": connect_node_iface_node,
598 "from": (TESTBED_ID, NODE, "devs"),
599 "to": (TESTBED_ID, TUNIFACE, "node"),
600 "init_code": connect_tun_iface_node,
604 "from": (TESTBED_ID, NODE, "devs"),
605 "to": (TESTBED_ID, TAPIFACE, "node"),
606 "init_code": connect_tun_iface_node,
610 "from": (TESTBED_ID, NODEIFACE, "inet"),
611 "to": (TESTBED_ID, INTERNET, "devs"),
612 "init_code": connect_node_iface_inet,
616 "from": (TESTBED_ID, NODE, "apps"),
617 "to": (TESTBED_ID, APPLICATION, "node"),
618 "init_code": connect_dep,
622 "from": (TESTBED_ID, NODE, "deps"),
623 "to": (TESTBED_ID, DEPENDENCY, "node"),
624 "init_code": connect_dep,
628 "from": (TESTBED_ID, NODE, "deps"),
629 "to": (TESTBED_ID, NEPIDEPENDENCY, "node"),
630 "init_code": connect_dep,
634 "from": (TESTBED_ID, NODE, "deps"),
635 "to": (TESTBED_ID, NS3DEPENDENCY, "node"),
636 "init_code": connect_dep,
640 "from": (TESTBED_ID, NODE, "pipes"),
641 "to": (TESTBED_ID, NETPIPE, "node"),
642 "init_code": connect_node_netpipe,
646 "from": (TESTBED_ID, TUNIFACE, "tcp"),
647 "to": (TESTBED_ID, TUNIFACE, "tcp"),
648 "init_code": functools.partial(connect_tun_iface_peer,"tcp"),
652 "from": (TESTBED_ID, TUNIFACE, "udp"),
653 "to": (TESTBED_ID, TUNIFACE, "udp"),
654 "init_code": functools.partial(connect_tun_iface_peer,"udp"),
658 "from": (TESTBED_ID, TUNIFACE, "gre"),
659 "to": (TESTBED_ID, TUNIFACE, "gre"),
660 "init_code": functools.partial(connect_tun_iface_peer,"gre"),
664 "from": (TESTBED_ID, TUNIFACE, "fd->"),
665 "to": (TESTBED_ID, TUNFILTERS, "->fd"),
666 "init_code": connect_tun_iface_filter,
670 "from": (TESTBED_ID, TUNFILTERS, "tcp"),
671 "to": (TESTBED_ID, TUNIFACE, "tcp"),
672 "init_code": functools.partial(connect_filter_peer,"tcp"),
676 "from": (TESTBED_ID, TUNFILTERS, "udp"),
677 "to": (TESTBED_ID, TUNIFACE, "udp"),
678 "init_code": functools.partial(connect_filter_peer,"udp"),
682 "from": (TESTBED_ID, TAPIFACE, "tcp"),
683 "to": (TESTBED_ID, TAPIFACE, "tcp"),
684 "init_code": functools.partial(connect_tun_iface_peer,"tcp"),
688 "from": (TESTBED_ID, TAPIFACE, "udp"),
689 "to": (TESTBED_ID, TAPIFACE, "udp"),
690 "init_code": functools.partial(connect_tun_iface_peer,"udp"),
694 "from": (TESTBED_ID, TAPIFACE, "gre"),
695 "to": (TESTBED_ID, TAPIFACE, "gre"),
696 "init_code": functools.partial(connect_tun_iface_peer,"gre"),
700 "from": (TESTBED_ID, TAPIFACE, "fd->"),
701 "to": (TESTBED_ID, TAPFILTERS, "->fd"),
702 "init_code": connect_tun_iface_filter,
706 "from": (TESTBED_ID, TAPFILTERS, "tcp"),
707 "to": (TESTBED_ID, TAPIFACE, "tcp"),
708 "init_code": functools.partial(connect_filter_peer,"tcp"),
712 "from": (TESTBED_ID, TAPFILTERS, "udp"),
713 "to": (TESTBED_ID, TAPIFACE, "udp"),
714 "init_code": functools.partial(connect_filter_peer,"udp"),
718 "from": (TESTBED_ID, TUNFILTERS, "tcp"),
719 "to": (TESTBED_ID, TUNFILTERS, "tcp"),
720 "init_code": functools.partial(connect_filter_filter,"tcp"),
724 "from": (TESTBED_ID, TUNFILTERS, "udp"),
725 "to": (TESTBED_ID, TUNFILTERS, "udp"),
726 "init_code": functools.partial(connect_filter_filter,"udp"),
730 "from": (TESTBED_ID, TAPFILTERS, "tcp"),
731 "to": (TESTBED_ID, TAPFILTERS, "tcp"),
732 "init_code": functools.partial(connect_filter_filter,"tcp"),
736 "from": (TESTBED_ID, TAPFILTERS, "udp"),
737 "to": (TESTBED_ID, TAPFILTERS, "udp"),
738 "init_code": functools.partial(connect_filter_filter,"udp"),
742 "from": (TESTBED_ID, TUNIFACE, "tcp"),
743 "to": (None, None, "tcp"),
744 "init_code": functools.partial(crossconnect_tun_iface_peer_init,"tcp"),
745 "compl_code": functools.partial(crossconnect_tun_iface_peer_compl,"tcp"),
749 "from": (TESTBED_ID, TUNIFACE, "udp"),
750 "to": (None, None, "udp"),
751 "init_code": functools.partial(crossconnect_tun_iface_peer_init,"udp"),
752 "compl_code": functools.partial(crossconnect_tun_iface_peer_compl,"udp"),
756 "from": (TESTBED_ID, TUNIFACE, "fd->"),
757 "to": (None, None, "->fd"),
758 "compl_code": functools.partial(crossconnect_tun_iface_peer_both,"fd"),
762 "from": (TESTBED_ID, TUNIFACE, "gre"),
763 "to": (None, None, "gre"),
764 "compl_code": functools.partial(crossconnect_tun_iface_peer_both,"gre"),
768 "from": (TESTBED_ID, TAPIFACE, "tcp"),
769 "to": (None, None, "tcp"),
770 "init_code": functools.partial(crossconnect_tun_iface_peer_init,"tcp"),
771 "compl_code": functools.partial(crossconnect_tun_iface_peer_compl,"tcp"),
775 "from": (TESTBED_ID, TAPIFACE, "udp"),
776 "to": (None, None, "udp"),
777 "init_code": functools.partial(crossconnect_tun_iface_peer_init,"udp"),
778 "compl_code": functools.partial(crossconnect_tun_iface_peer_compl,"udp"),
782 "from": (TESTBED_ID, TAPIFACE, "fd->"),
783 "to": (None, None, "->fd"),
784 "compl_code": functools.partial(crossconnect_tun_iface_peer_both,"fd"),
787 # EGRE is an extension of PlanetLab, so we can't connect externally
788 # if the other testbed isn't another PlanetLab
790 "from": (TESTBED_ID, TAPIFACE, "gre"),
791 "to": (TESTBED_ID, None, "gre"),
792 "compl_code": functools.partial(crossconnect_tun_iface_peer_both,"gre"),
796 "from": (TESTBED_ID, ALLFILTERS, "tcp"),
797 "to": (None, None, "tcp"),
798 "init_code": functools.partial(crossconnect_filter_peer_init,"tcp"),
799 "compl_code": functools.partial(crossconnect_filter_peer_compl,"tcp"),
803 "from": (TESTBED_ID, ALLFILTERS, "udp"),
804 "to": (None, None, "udp"),
805 "init_code": functools.partial(crossconnect_filter_peer_init,"udp"),
806 "compl_code": functools.partial(crossconnect_filter_peer_compl,"udp"),
812 "forward_X11": dict({
813 "name": "forward_X11",
814 "help": "Forward x11 from main namespace to the node",
815 "type": Attribute.BOOL,
817 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
818 "validation_function": validation.is_bool,
822 "help": "Constrain hostname during resource discovery. May use wildcards.",
823 "type": Attribute.STRING,
824 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
825 "validation_function": validation.is_string,
829 "help": "Constrain location (city) during resource discovery. May use wildcards.",
830 "type": Attribute.STRING,
831 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
832 "validation_function": validation.is_string,
836 "help": "Constrain location (country) during resource discovery. May use wildcards.",
837 "type": Attribute.STRING,
838 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
839 "validation_function": validation.is_string,
843 "help": "Constrain location (region) during resource discovery. May use wildcards.",
844 "type": Attribute.STRING,
845 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
846 "validation_function": validation.is_string,
848 "architecture": dict({
849 "name": "architecture",
850 "help": "Constrain architexture during resource discovery.",
851 "type": Attribute.ENUM,
852 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
853 "allowed": ["x86_64",
855 "validation_function": validation.is_enum,
857 "operating_system": dict({
858 "name": "operatingSystem",
859 "help": "Constrain operating system during resource discovery.",
860 "type": Attribute.ENUM,
861 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
867 "validation_function": validation.is_enum,
871 "help": "Constrain the PlanetLab site this node should reside on.",
872 "type": Attribute.ENUM,
873 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
877 "validation_function": validation.is_enum,
879 "min_reliability": dict({
880 "name": "minReliability",
881 "help": "Constrain reliability while picking PlanetLab nodes. Specifies a lower acceptable bound.",
882 "type": Attribute.DOUBLE,
884 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
885 "validation_function": validation.is_number,
887 "max_reliability": dict({
888 "name": "maxReliability",
889 "help": "Constrain reliability while picking PlanetLab nodes. Specifies an upper acceptable bound.",
890 "type": Attribute.DOUBLE,
892 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
893 "validation_function": validation.is_number,
895 "min_bandwidth": dict({
896 "name": "minBandwidth",
897 "help": "Constrain available bandwidth while picking PlanetLab nodes. Specifies a lower acceptable bound.",
898 "type": Attribute.DOUBLE,
900 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
901 "validation_function": validation.is_number,
903 "max_bandwidth": dict({
904 "name": "maxBandwidth",
905 "help": "Constrain available bandwidth while picking PlanetLab nodes. Specifies an upper acceptable bound.",
906 "type": Attribute.DOUBLE,
908 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
909 "validation_function": validation.is_number,
913 "help": "Constrain node load average while picking PlanetLab nodes. Specifies a lower acceptable bound.",
914 "type": Attribute.DOUBLE,
916 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
917 "validation_function": validation.is_number,
921 "help": "Constrain node load average while picking PlanetLab nodes. Specifies an upper acceptable bound.",
922 "type": Attribute.DOUBLE,
924 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
925 "validation_function": validation.is_number,
929 "help": "Constrain available cpu time while picking PlanetLab nodes. Specifies a lower acceptable bound.",
930 "type": Attribute.DOUBLE,
932 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
933 "validation_function": validation.is_number,
937 "help": "Constrain available cpu time while picking PlanetLab nodes. Specifies an upper acceptable bound.",
938 "type": Attribute.DOUBLE,
940 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
941 "validation_function": validation.is_number,
947 "type": Attribute.BOOL,
949 "validation_function": validation.is_bool
953 "help": "This is the primary interface for the attached node",
954 "type": Attribute.BOOL,
956 "validation_function": validation.is_bool
960 "help": "Device name",
961 "type": Attribute.STRING,
962 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
963 "validation_function": validation.is_string
967 "help": "Maximum transmition unit for device",
968 "type": Attribute.INTEGER,
970 "validation_function": validation.is_integer_range(0,1500)
974 "help": "Network mask for the device (eg: 24 for /24 network)",
975 "type": Attribute.INTEGER,
976 "validation_function": validation.is_integer_range(8,24)
980 "help": "Enable SNAT (source NAT to the internet) no this device",
981 "type": Attribute.BOOL,
983 "validation_function": validation.is_bool
985 "pointopoint": dict({
986 "name": "pointopoint",
987 "help": "If the interface is a P2P link, the remote endpoint's IP "
988 "should be set on this attribute.",
989 "type": Attribute.STRING,
990 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
991 "validation_function": validation.is_string
994 "name": "txqueuelen",
995 "help": "Transmission queue length (in packets)",
996 "type": Attribute.INTEGER,
998 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1000 "validation_function": validation.is_integer
1005 "help": "Command line string",
1006 "type": Attribute.STRING,
1007 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1008 "validation_function": validation.is_string
1012 "help": "Run with root privileges",
1013 "type": Attribute.BOOL,
1014 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1016 "validation_function": validation.is_bool
1020 "help": "Standard input",
1021 "type": Attribute.STRING,
1022 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1023 "validation_function": validation.is_string
1028 "help": "Space-separated list of packages required to run the application",
1029 "type": Attribute.STRING,
1030 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1031 "validation_function": validation.is_string
1033 "build-depends": dict({
1034 "name": "buildDepends",
1035 "help": "Space-separated list of packages required to build the application",
1036 "type": Attribute.STRING,
1037 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1038 "validation_function": validation.is_string
1040 "rpm-fusion": dict({
1041 "name": "rpmFusion",
1042 "help": "True if required packages can be found in the RpmFusion repository",
1043 "type": Attribute.BOOL,
1044 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1046 "validation_function": validation.is_bool
1050 "help": "Space-separated list of regular files to be deployed in the working path prior to building. "
1051 "Archives won't be expanded automatically.",
1052 "type": Attribute.STRING,
1053 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1054 "validation_function": validation.is_string
1058 "help": "Build commands to execute after deploying the sources. "
1059 "Sources will be in the ${SOURCES} folder. "
1060 "Example: tar xzf ${SOURCES}/my-app.tgz && cd my-app && ./configure && make && make clean.\n"
1061 "Try to make the commands return with a nonzero exit code on error.\n"
1062 "Also, do not install any programs here, use the 'install' attribute. This will "
1063 "help keep the built files constrained to the build folder (which may "
1064 "not be the home folder), and will result in faster deployment. Also, "
1065 "make sure to clean up temporary files, to reduce bandwidth usage between "
1066 "nodes when transferring built packages.",
1067 "type": Attribute.STRING,
1068 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1069 "validation_function": validation.is_string
1073 "help": "Commands to transfer built files to their final destinations. "
1074 "Sources will be in the initial working folder, and a special "
1075 "tag ${SOURCES} can be used to reference the experiment's "
1076 "home folder (where the application commands will run).\n"
1077 "ALL sources and targets needed for execution must be copied there, "
1078 "if building has been enabled.\n"
1079 "That is, 'slave' nodes will not automatically get any source files. "
1080 "'slave' nodes don't get build dependencies either, so if you need "
1081 "make and other tools to install, be sure to provide them as "
1082 "actual dependencies instead.",
1083 "type": Attribute.STRING,
1084 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1085 "validation_function": validation.is_string
1088 "netpipe_mode": dict({
1090 "help": "Link mode:\n"
1091 " * SERVER: applies to incoming connections\n"
1092 " * CLIENT: applies to outgoing connections\n"
1093 " * SERVICE: applies to both",
1094 "type": Attribute.ENUM,
1095 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1096 "allowed": ["SERVER",
1099 "validation_function": validation.is_enum,
1103 "help": "Port list or range. Eg: '22', '22,23,27', '20-2000'",
1104 "type": Attribute.STRING,
1105 "validation_function": is_portlist,
1109 "help": "Address list or range. Eg: '127.0.0.1', '127.0.0.1,127.0.1.1', '127.0.0.1/8'",
1110 "type": Attribute.STRING,
1111 "validation_function": is_addrlist,
1115 "help": "Inbound bandwidth limit (in Mbit/s)",
1116 "type": Attribute.DOUBLE,
1117 "validation_function": validation.is_number,
1121 "help": "Outbound bandwidth limit (in Mbit/s)",
1122 "type": Attribute.DOUBLE,
1123 "validation_function": validation.is_number,
1127 "help": "Inbound packet loss rate (0 = no loss, 1 = 100% loss)",
1128 "type": Attribute.DOUBLE,
1129 "validation_function": validation.is_number,
1133 "help": "Outbound packet loss rate (0 = no loss, 1 = 100% loss)",
1134 "type": Attribute.DOUBLE,
1135 "validation_function": validation.is_number,
1139 "help": "Inbound packet delay (in milliseconds)",
1140 "type": Attribute.INTEGER,
1142 "validation_function": validation.is_integer,
1146 "help": "Outbound packet delay (in milliseconds)",
1147 "type": Attribute.INTEGER,
1149 "validation_function": validation.is_integer,
1153 "help": "Path to a .c or .py source for a filter module, or a binary .so",
1154 "type": Attribute.STRING,
1155 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1156 "validation_function": validation.is_string
1160 "help": "Module arguments - comma-separated list of name=value pairs",
1161 "type": Attribute.STRING,
1162 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1163 "validation_function": validation.is_string
1170 "help": "Standard output stream"
1174 "help": "Application standard error",
1178 "help": "Output of the build process",
1181 "netpipe_stats": dict({
1182 "name": "netpipeStats",
1183 "help": "Information about rule match counters, packets dropped, etc.",
1188 "help": "Detailled log of all packets going through the interface",
1192 "help": "PCAP trace of all packets going through the interface",
1196 "help": "Extra output trace for applications. When activated this trace can be referenced with wildcard a reference from an Application command line. Ex: command: 'tcpdump -w {#[elemet-label].trace[trace-id].[name|path]#}' ",
1200 create_order = [ INTERNET, NODE, NODEIFACE, TUNFILTER, TAPIFACE, TUNIFACE, NETPIPE, NEPIDEPENDENCY, NS3DEPENDENCY, DEPENDENCY, APPLICATION ]
1202 configure_order = [ INTERNET, Parallel(NODE), NODEIFACE, Parallel(TAPIFACE), Parallel(TUNIFACE), NETPIPE, Parallel(NEPIDEPENDENCY), Parallel(NS3DEPENDENCY), Parallel(DEPENDENCY), Parallel(APPLICATION) ]
1204 # Start (and prestart) node after ifaces, because the node needs the ifaces in order to set up routes
1205 start_order = [ INTERNET, NODEIFACE, Parallel(TAPIFACE), Parallel(TUNIFACE), Parallel(NODE), NETPIPE, Parallel(NEPIDEPENDENCY), Parallel(NS3DEPENDENCY), Parallel(DEPENDENCY), Parallel(APPLICATION) ]
1208 shutdown_order = [ Parallel(APPLICATION), Parallel(TAPIFACE), Parallel(TUNIFACE), Parallel(NETPIPE), Parallel(NEPIDEPENDENCY), Parallel(NS3DEPENDENCY), Parallel(DEPENDENCY), NODEIFACE, Parallel(NODE) ]
1210 factories_info = dict({
1212 "help": "Virtualized Node (V-Server style)",
1213 "category": FC.CATEGORY_NODES,
1214 "create_function": create_node,
1215 "preconfigure_function": configure_node,
1216 "prestart_function": configure_node_routes,
1228 # NEPI-in-NEPI attributes
1229 ATTR_NEPI_TESTBED_ENVIRONMENT_SETUP,
1231 "connector_types": ["devs", "apps", "pipes", "deps"],
1232 "tags": [tags.NODE, tags.ALLOW_ROUTES],
1235 "help": "External network interface - they cannot be brought up or down, and they MUST be connected to the internet.",
1236 "category": FC.CATEGORY_DEVICES,
1237 "create_function": create_nodeiface,
1238 "preconfigure_function": configure_nodeiface,
1239 "box_attributes": [ ],
1240 "connector_types": ["node", "inet"],
1241 "tags": [tags.INTERFACE, tags.HAS_ADDRESSES],
1244 "help": "Virtual TUN network interface (layer 3)",
1245 "category": FC.CATEGORY_DEVICES,
1246 "create_function": create_tuniface,
1247 "preconfigure_function": preconfigure_tuniface,
1248 "configure_function": postconfigure_tuniface,
1249 "prestart_function": wait_tuniface,
1251 "up", "if_name", "mtu", "snat", "pointopoint",
1253 "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher",
1255 "traces": ["packets", "pcap"],
1256 "connector_types": ["node","udp","tcp","fd->","gre"],
1257 "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
1260 "help": "Virtual TAP network interface (layer 2)",
1261 "category": FC.CATEGORY_DEVICES,
1262 "create_function": create_tapiface,
1263 "preconfigure_function": preconfigure_tuniface,
1264 "configure_function": postconfigure_tuniface,
1265 "prestart_function": wait_tuniface,
1267 "up", "if_name", "mtu", "snat", "pointopoint",
1269 "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher",
1271 "traces": ["packets", "pcap"],
1272 "connector_types": ["node","udp","tcp","fd->","gre"],
1273 "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
1276 "help": "TUN/TAP stream filter\n\n"
1277 "If specified, it should be either a .py or .so module. "
1278 "It will be loaded, and all incoming and outgoing packets "
1279 "will be routed through it. The filter will not be responsible "
1280 "for buffering, packet queueing is performed in tun_connect "
1281 "already, so it should not concern itself with it. It should "
1282 "not, however, block in one direction if the other is congested.\n"
1284 "Modules are expected to have the following methods:\n"
1286 "\t\tIf arguments are given, this method will be called with the\n"
1287 "\t\tgiven arguments (as keyword args in python modules, or a single\n"
1288 "\taccept_packet(packet, direction):\n"
1289 "\t\tDecide whether to drop the packet. Direction is 0 for packets "
1290 "coming from the local side to the remote, and 1 is for packets "
1291 "coming from the remote side to the local. Return a boolean, "
1292 "true if the packet is not to be dropped.\n"
1293 "\tfilter_init():\n"
1294 "\t\tInitializes a filtering pipe (filter_run). It should "
1295 "return two file descriptors to use as a bidirectional "
1296 "pipe: local and remote. 'local' is where packets from the "
1297 "local side will be written to. After filtering, those packets "
1298 "should be written to 'remote', where tun_connect will read "
1299 "from, and it will forward them to the remote peer. "
1300 "Packets from the remote peer will be written to 'remote', "
1301 "where the filter is expected to read from, and eventually "
1302 "forward them to the local side. If the file descriptors are "
1303 "not nonblocking, they will be set to nonblocking. So it's "
1304 "better to set them from the start like that.\n"
1305 "\tfilter_run(local, remote):\n"
1306 "\t\tIf filter_init is provided, it will be called repeatedly, "
1307 "in a separate thread until the process is killed. It should "
1308 "sleep at most for a second.\n"
1309 "\tfilter_close(local, remote):\n"
1310 "\t\tCalled then the process is killed, if filter_init was provided. "
1311 "It should, among other things, close the file descriptors.\n"
1313 "Python modules are expected to return a tuple in filter_init, "
1314 "either of file descriptors or file objects, while native ones "
1315 "will receive two int*.\n"
1317 "Python modules can additionally contain a custom queue class "
1318 "that will replace the FIFO used by default. The class should "
1319 "be named 'queueclass' and contain an interface compatible with "
1320 "collections.deque. That is, indexing (especiall for q[0]), "
1321 "bool(q), popleft, appendleft, pop (right), append (right), "
1322 "len(q) and clear.",
1323 "category": FC.CATEGORY_CHANNELS,
1324 "create_function": create_tunfilter,
1327 "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher",
1329 "connector_types": ["->fd","udp","tcp"],
1331 CLASSQUEUEFILTER : dict({
1332 "help": "TUN classfull queue, uses a separate queue for each user-definable class.\n\n"
1333 "It takes two arguments, both of which have sensible defaults:\n"
1334 "\tsize: the base size of each class' queue\n"
1335 "\tclasses: the class definitions, which follow the following syntax:\n"
1336 '\t <CLASSLIST> ::= <CLASS> ":" CLASSLIST\n'
1338 '\t <CLASS> ::= <PROTOLIST> "*" <PRIORITYSPEC>\n'
1339 '\t | <DFLTCLASS>\n'
1340 '\t <DFLTCLASS> ::= "*" <PRIORITYSPEC>\n'
1341 '\t <PROTOLIST> ::= <PROTO> "." <PROTOLIST>\n'
1343 '\t <PROTO> ::= <NAME> | <NUMBER>\n'
1344 '\t <NAME> ::= --see http://en.wikipedia.org/wiki/List_of_IP_protocol_numbers --\n'
1345 '\t --only in lowercase, with special characters removed--\n'
1346 '\t --or see below--\n'
1347 '\t <NUMBER> ::= [0-9]+\n'
1348 '\t <PRIORITYSPEC> ::= <THOUGHPUT> [ "#" <SIZE> ] [ "p" <PRIORITY> ]\n'
1349 '\t <THOUGHPUT> ::= NUMBER -- default 1\n'
1350 '\t <PRIORITY> ::= NUMBER -- default 0\n'
1351 '\t <SIZE> ::= NUMBER -- default 1\n'
1353 "Size, thoughput and priority are all relative terms. "
1354 "Sizes are multipliers for the size argument, thoughput "
1355 "is applied relative to other classes and the same with "
1357 "category": FC.CATEGORY_CHANNELS,
1358 "create_function": create_classqueuefilter,
1361 "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher",
1363 "connector_types": ["->fd","udp","tcp"],
1365 TOSQUEUEFILTER : dict({
1366 "help": "TUN classfull queue that classifies according to the TOS (RFC 791) IP field.\n\n"
1367 "It takes a size argument that specifies the size of each class. As TOS is a "
1368 "subset of DiffServ, this queue half-implements DiffServ.",
1369 "category": FC.CATEGORY_CHANNELS,
1370 "create_function": create_tosqueuefilter,
1373 "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher",
1375 "connector_types": ["->fd","udp","tcp"],
1379 "help": "Generic executable command line application",
1380 "category": FC.CATEGORY_APPLICATIONS,
1381 "create_function": create_application,
1382 "start_function": start_application,
1383 "status_function": status_application,
1384 "stop_function": stop_application,
1385 "configure_function": configure_application,
1386 "box_attributes": ["command", "sudo", "stdin",
1387 "depends", "build-depends", "build", "install",
1388 "sources", "rpm-fusion" ],
1389 "connector_types": ["node"],
1390 "traces": ["stdout", "stderr", "buildlog", "output"],
1391 "tags": [tags.APPLICATION],
1394 "help": "Requirement for package or application to be installed on some node",
1395 "category": FC.CATEGORY_APPLICATIONS,
1396 "create_function": create_dependency,
1397 "preconfigure_function": configure_dependency,
1398 "box_attributes": ["depends", "build-depends", "build", "install",
1399 "sources", "rpm-fusion" ],
1400 "connector_types": ["node"],
1401 "traces": ["buildlog"],
1403 NEPIDEPENDENCY: dict({
1404 "help": "Requirement for NEPI inside NEPI - required to run testbed instances inside a node",
1405 "category": FC.CATEGORY_APPLICATIONS,
1406 "create_function": create_nepi_dependency,
1407 "preconfigure_function": configure_dependency,
1408 "box_attributes": [],
1409 "connector_types": ["node"],
1410 "traces": ["buildlog"],
1412 NS3DEPENDENCY: dict({
1413 "help": "Requirement for NS3 inside NEPI - required to run NS3 testbed instances inside a node. It also needs NepiDependency.",
1414 "category": FC.CATEGORY_APPLICATIONS,
1415 "create_function": create_ns3_dependency,
1416 "preconfigure_function": configure_dependency,
1417 "box_attributes": [ ],
1418 "connector_types": ["node"],
1419 "traces": ["buildlog"],
1422 "help": "Internet routing",
1423 "category": FC.CATEGORY_CHANNELS,
1424 "create_function": create_internet,
1425 "connector_types": ["devs"],
1426 "tags": [tags.INTERNET],
1429 "help": "Link emulation",
1430 "category": FC.CATEGORY_CHANNELS,
1431 "create_function": create_netpipe,
1432 "configure_function": configure_netpipe,
1433 "box_attributes": ["netpipe_mode",
1434 "addr_list", "port_list",
1435 "bw_in","plr_in","delay_in",
1436 "bw_out","plr_out","delay_out"],
1437 "connector_types": ["node"],
1438 "traces": ["netpipe_stats"],
1442 testbed_attributes = dict({
1445 "help": "The name of the PlanetLab slice to use",
1446 "type": Attribute.STRING,
1447 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable | Attribute.NoDefaultValue,
1448 "validation_function": validation.is_string
1452 "help": "The name of the PlanetLab user to use for API calls - it must have at least a User role.",
1453 "type": Attribute.STRING,
1454 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable | Attribute.NoDefaultValue,
1455 "validation_function": validation.is_string
1459 "help": "The PlanetLab user's password.",
1460 "type": Attribute.STRING,
1461 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable | Attribute.NoDefaultValue,
1462 "validation_function": validation.is_string
1466 "help": "The PlanetLab PLC API host",
1467 "type": Attribute.STRING,
1468 "value": "www.planet-lab.eu",
1469 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1470 "validation_function": validation.is_string
1474 "help": "The PlanetLab PLC API url pattern - %(hostname)s is replaced by plcHost.",
1475 "type": Attribute.STRING,
1476 "value": "https://%(hostname)s:443/PLCAPI/",
1477 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1478 "validation_function": validation.is_string
1480 "p2p_deployment": dict({
1481 "name": "p2pDeployment",
1482 "help": "Enable peer-to-peer deployment of applications and dependencies. "
1483 "When enabled, dependency packages and applications are "
1484 "deployed in a P2P fashion, picking a single node to do "
1485 "the building or repo download, while all the others "
1486 "cooperatively exchange resulting binaries or rpms. "
1487 "When deploying to many nodes, this is a far more efficient "
1488 "use of resources. It does require re-encrypting and distributing "
1489 "the slice's private key. Though it is implemented in a secure "
1490 "fashion, if they key's sole purpose is not PlanetLab, then this "
1491 "feature should be disabled.",
1492 "type": Attribute.BOOL,
1494 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1495 "validation_function": validation.is_bool
1497 "slice_ssh_key": dict({
1498 "name": "sliceSSHKey",
1499 "help": "The controller-local path to the slice user's ssh private key. "
1500 "It is the user's responsability to deploy this file where the controller "
1501 "will run, it won't be done automatically because it's sensitive information. "
1502 "It is recommended that a NEPI-specific user be created for this purpose and "
1503 "this purpose alone.",
1504 "type": Attribute.STRING,
1505 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable | Attribute.NoDefaultValue,
1506 "validation_function": validation.is_string
1508 "pl_log_level": dict({
1509 "name": "plLogLevel",
1510 "help": "Verbosity of logging of planetlab events.",
1512 "type": Attribute.ENUM,
1513 "allowed": ["DEBUG",
1518 "validation_function": validation.is_enum,
1520 "tap_port_base": dict({
1521 "name": "tapPortBase",
1522 "help": "Base port to use when connecting TUN/TAPs. Effective port will be BASE + GUID.",
1523 "type": Attribute.INTEGER,
1525 "range": (2000,30000),
1526 "validation_function": validation.is_integer_range(2000,30000)
1528 "dedicated_slice": dict({
1529 "name": "dedicatedSlice",
1530 "help": "Set to True if the slice will be dedicated to this experiment. "
1531 "NEPI will perform node and slice cleanup, making sure slices are "
1532 "in a clean, repeatable state before running the experiment.",
1533 "type": Attribute.BOOL,
1535 "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable,
1536 "validation_function": validation.is_bool
1540 supported_recovery_policies = [
1546 class MetadataInfo(metadata.MetadataInfo):
1548 def connector_types(self):
1549 return connector_types
1552 def connections(self):
1556 def attributes(self):
1564 def create_order(self):
1568 def configure_order(self):
1569 return configure_order
1572 def prestart_order(self):
1576 def start_order(self):
1580 def factories_info(self):
1581 return factories_info
1584 def testbed_attributes(self):
1585 return testbed_attributes
1588 def testbed_id(self):
1592 def testbed_version(self):
1593 return TESTBED_VERSION
1596 def supported_recovery_policies(self):
1597 return supported_recovery_policies