aboutsummaryrefslogtreecommitdiff
path: root/rumba/model.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-03-14 18:07:32 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-14 18:07:32 +0100
commit9e38155d654e012879a03e784f03a95de4aef64e (patch)
tree1276dc09a3cf2bc21cb5f15e4dd71e7729e9d4a5 /rumba/model.py
parent06d2451f950961072a1dbb92e69944334ec966b2 (diff)
downloadrumba-9e38155d654e012879a03e784f03a95de4aef64e.tar.gz
rumba-9e38155d654e012879a03e784f03a95de4aef64e.zip
prototypes: Add local Ouroboros support
This adds local Ouroboros support in case of a fake testbed (i.e. no resources allocated). A next PR will abstract away the mode of communication with the testbed, since the Docker plugin will also need it. This also adds another function to the model, terminate_prototype, which should clean up the prototype gracefully, or can be skipped depending on the testbed. Currently the ouroboros plugin with the fake testbed needs to be run as root. If there is a way to run the command as root in the background and then clean it up properly, I would be happy to know how.
Diffstat (limited to 'rumba/model.py')
-rw-r--r--rumba/model.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 2749ae7..42112be 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -874,6 +874,10 @@ class Experiment(object):
def prototype_name(self):
raise Exception('prototype_name() method not implemented')
+ @abc.abstractmethod
+ def _terminate_prototype(self):
+ raise Exception('terminate_prototype() method not implemented')
+
def swap_in(self):
# Realize the experiment testbed (testbed-specific)
start = time.time()
@@ -884,6 +888,8 @@ class Experiment(object):
def swap_out(self):
start = time.time()
+ # Terminate prototype gracefully
+ self._terminate_prototype()
for node in self.nodes:
if node.ssh_config.client is not None:
node.ssh_config.client.close()