From 009c8ff7570105a79278559202fdd46616b83a92 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 20 Apr 2017 17:12:34 +0200 Subject: model: Split experiment run() This splits experiment.run() into 4 different operations: swap_in, install_prototype, bootstrap_prototype and swap_out. --- rumba/prototypes/rlite.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'rumba/prototypes/rlite.py') diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index 9568d7e..4221f2a 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -35,15 +35,6 @@ class Experiment(mod.Experiment): 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") - # Load kernel modules cmds.append("modprobe rlite") cmds.append("modprobe rlite-normal") @@ -57,6 +48,20 @@ class Experiment(mod.Experiment): for node in self.nodes: self.execute_commands(node, cmds) + def install(self): + cmds = [] + + 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") + + for node in self.nodes: + self.execute_commands(node, cmds) + def create_ipcps(self): for node in self.nodes: cmds = [] @@ -109,7 +114,12 @@ class Experiment(mod.Experiment): "%(lower_dif)s %(enroller)s" % d self.execute_commands(e['enrollee'], [cmd]) - def run_prototype(self): + def install_prototype(self): + print("rlite: installing") + self.install() + print("rlite: installed") + + def bootstrap_prototype(self): print("rlite: setting up") self.init() print("rlite: software initialized on all nodes") -- cgit v1.2.3