aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-06-05 15:54:18 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-06-05 17:32:03 +0200
commita1f2be15e901981efbaeaacc9a331342c1d3911e (patch)
tree0463c6a6b0c3f08413913241950fabb906c4eee5
parent02be7d064fcf121fc455fab5685b97ebec40d733 (diff)
downloadrumba-a1f2be15e901981efbaeaacc9a331342c1d3911e.tar.gz
rumba-a1f2be15e901981efbaeaacc9a331342c1d3911e.zip
storyboard: Bind and register server name for Ouroboros
In case the experiment is done with the Ouroboros prototype, the name needs to be bound and registered on the node.
-rw-r--r--rumba/prototypes/ouroboros.py28
-rw-r--r--rumba/storyboard.py6
2 files changed, 34 insertions, 0 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 653f564..51f3629 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -248,6 +248,34 @@ class Experiment(mod.Experiment):
logger.info("Killing IRMd...")
subprocess.check_call('sudo killall -15 irmd'.split())
+ def bind_program(self, node, program, name):
+ """
+ Bind a program to a certain name on a certain node.
+
+ :param node: The node
+ :param program: The binary name
+ :param name: Name to bind to
+ """
+ node.execute_command('irm b prog %s name %s' % (program, name))
+
+ def register_name(self, node, name, layers):
+ """
+ Bind a program to a certain name on a certain node.
+
+ :param node: The node
+ :param name: Name to register
+ :param layers: Layers to register in. If it is None,
+ then it registers in all layers.
+ """
+ cmd = 'irm r n %s ' % name
+ if layers is None:
+ cmd += 'layer \'*\''
+ else:
+ for layer in layers:
+ cmd += 'layer %s ' % layer
+
+ node.execute_command(cmd)
+
def destroy_dif(self, dif):
for ipcp in dif.ipcps:
ipcp.node.execute_command('irm i d n ' + ipcp.name)
diff --git a/rumba/storyboard.py b/rumba/storyboard.py
index 2f88f16..2f1c6de 100644
--- a/rumba/storyboard.py
+++ b/rumba/storyboard.py
@@ -41,6 +41,7 @@ import uuid
import rumba.model as model
import rumba.ssh_support as ssh_support
import rumba.log as log
+import rumba.prototypes.ouroboros as our
try:
from io import StringIO
@@ -478,6 +479,10 @@ class Server(_SBEntity):
def run(self):
"""Starts this server"""
for node in self.nodes:
+ if isinstance(self.experiment, our.Experiment):
+ self.experiment.bind_program(node, self.ap, self.id)
+ self.experiment.register_name(node, self.id, None)
+
run_cmd = self.ap + (
(" " + self.options) if self.options is not None else ""
)
@@ -591,6 +596,7 @@ class StoryBoard(_SBEntity):
'not in experiment.' % (node.name,))
self.server_apps[s.id] = s
self._build_nodes_lists()
+ s.experiment = self.experiment
def set_experiment(self, experiment):
"""