aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/rlite.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-20 17:12:34 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-21 11:28:35 +0200
commit009c8ff7570105a79278559202fdd46616b83a92 (patch)
tree06fc2bafc26683c82795db750187ff7cefdcc43e /rumba/prototypes/rlite.py
parent06b3694633bd8315d55b5d75a2ca6c20afc54651 (diff)
downloadrumba-009c8ff7570105a79278559202fdd46616b83a92.tar.gz
rumba-009c8ff7570105a79278559202fdd46616b83a92.zip
model: Split experiment run()
This splits experiment.run() into 4 different operations: swap_in, install_prototype, bootstrap_prototype and swap_out.
Diffstat (limited to 'rumba/prototypes/rlite.py')
-rw-r--r--rumba/prototypes/rlite.py30
1 files changed, 20 insertions, 10 deletions
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")