diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-11-15 23:24:19 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-11-15 23:24:19 +0100 |
commit | cfe6c9ce5fd91ade2444b5babd5eed2512c3859a (patch) | |
tree | f3415c6a4ad3b327f150525b560e5a74e4bd3dac | |
parent | ed00e77fee22535169f151cac728a44d4cb6c28d (diff) | |
download | rumba-cfe6c9ce5fd91ade2444b5babd5eed2512c3859a.tar.gz rumba-cfe6c9ce5fd91ade2444b5babd5eed2512c3859a.zip |
prototypes: Add parallel install for rlite
This adds parallel install for rlite, and speeds it up even more by
passing the number of cores to make.
-rw-r--r-- | rumba/prototypes/rlite.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index b66bd69..6a9d6ef 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -27,6 +27,7 @@ import rumba.ssh_support as ssh import rumba.model as mod import rumba.log as log +import rumba.multiprocess as m_processing import time @@ -40,6 +41,13 @@ class Experiment(mod.Experiment): def __init__(self, testbed, nodes=None): mod.Experiment.__init__(self, testbed, nodes) + @staticmethod + def make_executor(node, packages, testbed): + def executor(commands): + ssh.aptitude_install(testbed, node, packages) + node.execute_commands(commands, time_out=None, use_proxy=True) + return executor + def prototype_name(self): return 'rlite' @@ -140,12 +148,20 @@ class Experiment(mod.Experiment): cmds = ["rm -rf ~/rlite", "cd ~; git clone https://github.com/vmaffione/rlite", - "cd ~/rlite && ./configure && make && sudo make install", + "cd ~/rlite && ./configure && make -j${nproc} " + + "&& sudo make install", "cd ~/rlite && sudo make depmod"] + names = [] + executors = [] + args = [] + for node in self.nodes: - ssh.aptitude_install(self.testbed, node, packages) - self.execute_proxy_commands(node, cmds) + executor = self.make_executor(node, packages, self.testbed) + names.append(node.name) + executors.append(executor) + args.append(cmds) + m_processing.call_in_parallel(names, args, executors) logger.info("installation complete") def bootstrap_prototype(self): |