aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/irati.py
diff options
context:
space:
mode:
Diffstat (limited to 'rumba/prototypes/irati.py')
-rw-r--r--rumba/prototypes/irati.py52
1 files changed, 24 insertions, 28 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py
index b2f54d9..42afe3b 100644
--- a/rumba/prototypes/irati.py
+++ b/rumba/prototypes/irati.py
@@ -21,8 +21,6 @@
import copy
import json
-import subprocess
-
import os
import time
@@ -38,6 +36,9 @@ logger = log.get_logger(__name__)
# An experiment over the IRATI implementation
class Experiment(mod.Experiment):
+ def prototype_name(self):
+ return 'irati'
+
@staticmethod
def real_sudo(s):
return 'sudo ' + s
@@ -69,25 +70,24 @@ class Experiment(mod.Experiment):
def install(self):
"""Installs IRATI on the nodes."""
- cmds = list()
-
- cmds.append("sudo apt-get update")
- cmds.append("sudo apt-get install g++ gcc "
- "protobuf-compiler libprotobuf-dev git --yes")
- cmds.append("sudo rm -rf ~/irati")
- cmds.append("cd && git clone https://github.com/IRATI/stack irati")
- cmds.append("cd ~/irati && sudo ./install-from-scratch")
+ cmds = [self.sudo("apt-get update"),
+ "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; "
+ + self.sudo("apt-get install g++ gcc "
+ "protobuf-compiler libprotobuf-dev git --yes "
+ "pkg-config "
+ "libnl-3-dev libnl-genl-3-dev"),
+ self.sudo("rm -rf ~/irati"),
+ "cd ~; "
+ "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; "
+ + "git clone https://github.com/IRATI/stack irati",
+ "cd ~/irati && git checkout arcfire",
+ "cd ~/irati && "
+ + self.sudo("./install-from-scratch")]
for node in self.nodes:
- ssh.execute_commands(self.testbed, node.ssh_config,
+ ssh.execute_proxy_commands(self.testbed, node.ssh_config,
cmds, time_out=None)
- def setup(self):
- for node in self.nodes:
- ssh.execute_command(self.testbed, node.ssh_config,
- "sudo nohup ipcm &> ipcm.log &",
- time_out=None)
-
def bootstrap_network(self):
"""Creates the network by enrolling and configuring the nodes"""
for node in self.nodes:
@@ -101,8 +101,6 @@ class Experiment(mod.Experiment):
def bootstrap_prototype(self):
logger.info("setting up")
- self.setup()
- logger.info("software initialized on all nodes")
self.conf_files = self.write_conf()
logger.info("configuration files generated for all nodes")
self.bootstrap_network()
@@ -144,7 +142,6 @@ class Experiment(mod.Experiment):
'genfiles': gen_files,
'genfilesconf': ' '.join(gen_files_conf),
'genfilesbin': gen_files_bin,
- 'installpath': '/usr',
'verb': 'DBG',
'ipcmcomps': ipcm_components}
@@ -155,13 +152,16 @@ class Experiment(mod.Experiment):
'')
cmds = [self.sudo('hostname %(name)s' % format_args),
+ self.sudo('modprobe rina-irati-core'),
self.sudo('chmod a+rw /dev/irati'),
self.sudo('mv %(genfilesconf)s /etc' % format_args),
self.sudo('mv %(genfilesbin)s /usr/bin') % format_args,
self.sudo('chmod a+x /usr/bin/enroll.py') % format_args]
cmds += [self.sudo('modprobe rina-default-plugin'),
- self.sudo('%(installpath)s/bin/ipcm -a \"%(ipcmcomps)s\" '
+ self.sudo('modprobe shim-eth-vlan'),
+ self.sudo('modprobe normal-ipcp'),
+ self.sudo('ipcm -a \"%(ipcmcomps)s\" '
'-c /etc/%(name)s.ipcm.conf -l %(verb)s &> log &'
% format_args)]
@@ -170,6 +170,8 @@ class Experiment(mod.Experiment):
def enroll_nodes(self):
"""Runs the enrollments one by one, respecting dependencies"""
+ logger.info("Waiting 5 seconds for the ipcm to start.")
+ time.sleep(5)
for enrollment_list in self.enrollments:
for e in enrollment_list:
logger.info(
@@ -225,16 +227,10 @@ class Experiment(mod.Experiment):
next_vlan += 10
self.shim2vlan[dif.name] = vlan
- # TODO: what format are the mappings registered in? Is this ok?
- app_mappings = []
- for node in self.nodes:
- app_mappings += [{'name': app, 'dif': self.dif_name(dif)}
- for app in node.registrations
- for dif in node.registrations[app]]
-
# If some app directives were specified, use those to build da.map.
# Otherwise, assume the standard applications are to be mapped in
# the DIF with the highest rank.
+ app_mappings = []
if len(app_mappings) == 0:
if len(self.dif_ordering) > 0:
for adm in \