aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2017-04-21 16:06:22 +0200
committerMarco Capitani <m.capitani@nextworks.it>2017-04-21 16:06:22 +0200
commit2da2f7f095dd985e6beb57be4b239f3b0eb87973 (patch)
tree49f1f8f0f5568dc17b28aac6d0f9299aba81139c /rumba/prototypes
parent26e3e22cd6ca6676b7b99624764f8e6f1ae1479d (diff)
parent92e114b4bd567593b43d6a065be52ca265bd13a4 (diff)
downloadrumba-2da2f7f095dd985e6beb57be4b239f3b0eb87973.tar.gz
rumba-2da2f7f095dd985e6beb57be4b239f3b0eb87973.zip
Merge branch 'master' into logging (split merged)
Diffstat (limited to 'rumba/prototypes')
-rw-r--r--rumba/prototypes/irati.py46
-rw-r--r--rumba/prototypes/ouroboros.py17
-rw-r--r--rumba/prototypes/rlite.py43
3 files changed, 63 insertions, 43 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py
index fe9b052..5f6ec52 100644
--- a/rumba/prototypes/irati.py
+++ b/rumba/prototypes/irati.py
@@ -66,23 +66,26 @@ class Experiment(mod.Experiment):
def conf_dir(self, path):
return os.path.join(self._conf_dir, path)
+ 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")
+
+ for node in self.nodes:
+ ssh.execute_commands(self.testbed, node.ssh_config,
+ cmds, time_out=None)
+
def setup(self):
- """Installs IRATI on the vms."""
- setup_irati = False
- if setup_irati:
- 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.append("sudo nohup ipcm &> ipcm.log &")
-
- for node in self.nodes:
- ssh.execute_commands(self.testbed, node.ssh_config,
- cmds, time_out=None)
+ 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"""
@@ -90,7 +93,12 @@ class Experiment(mod.Experiment):
self.process_node(node)
self.enroll_nodes()
- def run_prototype(self):
+ def install_prototype(self):
+ logger.info("irati: installing")
+ self.install()
+ logger.info("irati: done installing")
+
+ def bootstrap_prototype(self):
logger.info("irati: setting up")
self.setup()
logger.info("irati: software initialized on all nodes")
@@ -103,8 +111,8 @@ class Experiment(mod.Experiment):
"""
Installs the configuration and boots up rina on a node
:type node: mod.Node
- :param node:
- :return:
+ :param node:
+ :return:
"""
name = node.name
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 9776c5e..bbf8c75 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -33,18 +33,22 @@ class Experiment(mod.Experiment):
mod.Experiment.__init__(self, testbed, nodes)
def setup_ouroboros(self):
+ for node in self.nodes:
+ ssh.execute_command(self.testbed, node.ssh_config,
+ "sudo nohup irmd > /dev/null &",
+ time_out=None)
+
+ def install_ouroboros(self):
cmds = list()
cmds.append("sudo apt-get update")
cmds.append("sudo apt-get install cmake protobuf-c-compiler git --yes")
cmds.append("sudo rm -r ~/ouroboros/build")
cmds.append("cd ~/ouroboros; sudo ./install_debug.sh /")
- cmds.append("sudo nohup irmd > /dev/null &")
for node in self.nodes:
ssh.execute_commands(self.testbed, node.ssh_config,
cmds, time_out=None)
- return
def bind_names(self):
for node in self.nodes:
@@ -136,8 +140,13 @@ class Experiment(mod.Experiment):
cmds, time_out=None)
time.sleep(2)
- def run_prototype(self):
- logger.info("Setting up Ouroboros...")
+ def install_prototype(self):
+ logger.info("Installing Ouroboros...")
+ self.install_ouroboros()
+ logger.info("Installed on all nodes...")
+
+ def bootstrap_prototype(self):
+ logger.info("Starting IRMd on all nodes...")
self.setup_ouroboros()
logger.info("Binding names...")
self.bind_names()
diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py
index feca5a4..77f59cb 100644
--- a/rumba/prototypes/rlite.py
+++ b/rumba/prototypes/rlite.py
@@ -36,28 +36,17 @@ class Experiment(mod.Experiment):
ssh.execute_commands(self.testbed, node.ssh_config,
cmds, time_out=None)
- def init(self):
- cmds = []
-
- if False: # ubuntu
- cmds.append("apt-get update")
- cmds.append("apt-get install g++ gcc cmake "
- "linux-headers-$(uname -r) "
- "protobuf-compiler libprotobuf-dev git --yes")
- cmds.append("rm -rf ~/rlite")
- cmds.append("cd ~; git clone https://github.com/vmaffione/rlite")
- cmds.append("cd ~/rlite && ./configure && make "
- "&& sudo make install")
+ def init_nodes(self):
+ cmds = ["modprobe rlite",
+ "modprobe rlite-normal",
+ "modprobe rlite-shim-eth",
+ "modprobe rlite-shim-udp4",
+ "modprobe rlite-shim-loopback",
+ "rlite-uipcps -v DBG -k 0 &> uipcp.log &"]
# Load kernel modules
- cmds.append("modprobe rlite")
- cmds.append("modprobe rlite-normal")
- cmds.append("modprobe rlite-shim-eth")
- cmds.append("modprobe rlite-shim-udp4")
- cmds.append("modprobe rlite-shim-loopback")
# Start the uipcps daemon
- cmds.append("rlite-uipcps -v DBG -k 0 &> uipcp.log &")
for node in self.nodes:
self.execute_commands(node, cmds)
@@ -115,9 +104,23 @@ class Experiment(mod.Experiment):
"%(lower_dif)s %(enroller)s" % d
self.execute_commands(e['enrollee'], [cmd])
- def run_prototype(self):
+ def install_prototype(self):
+ logger.info("rlite: installing")
+ cmds = ["apt-get update",
+ "apt-get install g++ gcc cmake "
+ "linux-headers-$(uname -r) "
+ "protobuf-compiler libprotobuf-dev git --yes",
+ "rm -rf ~/rlite",
+ "cd ~; git clone https://github.com/vmaffione/rlite",
+ "cd ~/rlite && ./configure && make && sudo make install"]
+
+ for node in self.nodes:
+ self.execute_commands(node, cmds)
+ logger.info("rlite: installed")
+
+ def bootstrap_prototype(self):
logger.info("rlite: setting up")
- self.init()
+ self.init_nodes()
logger.info("rlite: software initialized on all nodes")
self.create_ipcps()
logger.info("rlite: IPCPs created on all nodes")