diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-11-07 11:40:54 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-11-15 18:59:11 +0100 |
commit | 2da15caf24a8b2da70d755e065a5dc3d770c6454 (patch) | |
tree | 292456db4acc4ab8f4afffad50113cc7e219b6cd /rumba/prototypes | |
parent | 2e91ca33f90f7c74887013e08c95bb00cdd4fc00 (diff) | |
download | rumba-2da15caf24a8b2da70d755e065a5dc3d770c6454.tar.gz rumba-2da15caf24a8b2da70d755e065a5dc3d770c6454.zip |
prototypes: Add parallel installation for IRATI
This adds parallel installation for IRATI, it also adds support for
multithread/multiprocess logging. Furthermore prototype-agnostic
utilities for multiprocessing have been added. Caching of clients has
been re-enabled for the ssh connections.
Diffstat (limited to 'rumba/prototypes')
-rw-r--r-- | rumba/prototypes/irati.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index 3a64ede..0f2d69e 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -22,25 +22,30 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., http://www.fsf.org/about/contact/. # - import copy import json - import os import time import rumba.ssh_support as ssh import rumba.model as mod +import rumba.multiprocessing_utils as m_processing import rumba.prototypes.irati_templates as irati_templates import rumba.log as log - logger = log.get_logger(__name__) # An experiment over the IRATI implementation class Experiment(mod.Experiment): + @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 'irati' @@ -90,11 +95,17 @@ class Experiment(mod.Experiment): "cd ~; git clone -b arcfire https://github.com/IRATI/stack", "cd ~/stack && " + self.sudo("./configure && ") + self.sudo("make install")] - + names = [] + executors = [] + args = [] for node in self.nodes: - ssh.aptitude_install(self.testbed, node, packages) - ssh.execute_proxy_commands(self.testbed, node.ssh_config, - cmds, time_out=None) + + 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) def bootstrap_network(self): """Creates the network by enrolling and configuring the nodes""" |