From f75a6d9b31479060dd1d1a52102a714ae7c48154 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Thu, 1 Jun 2017 15:17:59 +0200 Subject: model: remove registration and bindings Fixes #7 --- examples/two-layers.py | 4 +--- rumba/model.py | 47 +++---------------------------------------- rumba/prototypes/irati.py | 8 +------- rumba/prototypes/ouroboros.py | 25 ----------------------- 4 files changed, 5 insertions(+), 79 deletions(-) diff --git a/examples/two-layers.py b/examples/two-layers.py index 9d1a6b3..b4e4e64 100755 --- a/examples/two-layers.py +++ b/examples/two-layers.py @@ -32,9 +32,7 @@ e3 = ShimEthDIF("e3") a = Node("a", difs = [n3, n4, n1, e1], - dif_registrations = {n4: [n1], n3: [n1], n1 : [e1]}, - registrations = {"rinaperf.server" : [n3]}, - bindings = {"rinaperf.server" : "/usr/bin/rinaperf"}) + dif_registrations = {n4: [n1], n3: [n1], n1 : [e1]}) b = Node("b", difs = [n1, e1, e2], diff --git a/rumba/model.py b/rumba/model.py index 285d937..9fbda57 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -150,12 +150,10 @@ class SSHConfig: # # @difs: DIFs the node will have an IPCP in # @dif_registrations: Which DIF is registered in which DIF -# @registrations: Registrations of names in DIFs -# @bindings: Binding of names on the processing system # class Node: def __init__(self, name, difs=None, dif_registrations=None, - registrations=None, bindings=None, client=False): + client=False): self.name = name if difs is None: difs = list() @@ -165,12 +163,6 @@ class Node: if dif_registrations is None: dif_registrations = dict() self.dif_registrations = dif_registrations - if registrations is None: - registrations = dict() - self.registrations = registrations - if bindings is None: - bindings = dict() - self.bindings = bindings self.ssh_config = SSHConfig(name) self.ipcps = [] self.client = client @@ -188,17 +180,13 @@ class Node: "to be part of DIF %s" % (self.name, dif.name)) def _validate(self): - # Check that DIFs referenced in self.dif_registrations and - # in self.registrations are part of self.difs + # Check that DIFs referenced in self.dif_registrations + # are part of self.difs for upper in self.dif_registrations: self._undeclared_dif(upper) for lower in self.dif_registrations[upper]: self._undeclared_dif(lower) - for appl in self.registrations: - for dif in self.registrations[appl]: - self._undeclared_dif(dif) - def __repr__(self): s = "Node " + self.name + ":\n" @@ -217,19 +205,6 @@ class Node: s += ", ".join(rl) s += " ]\n" - s += " Name registrations: [ " - for name in self.registrations: - difs = self.registrations[name] - s += "%s => [ " % name - s += ", ".join([dif.name for dif in difs]) - s += " ]" - s += " ]\n" - - s += " Bindings: [ " - s += ", ".join(["'%s' => '%s'" % (ap, self.bindings[ap]) - for ap in self.bindings]) - s += " ]\n" - return s def __hash__(self): @@ -259,22 +234,6 @@ class Node: self.dif_registrations[upper].remove(lower) self._validate() - def add_registration(self, name, dif): - self.dif_registrations[name].append(dif) - self._validate() - - def del_registration(self, name, dif): - self.dif_registrations[name].remove(dif) - self._validate() - - def add_binding(self, name, ap): - self.bindings[name] = ap - self._validate() - - def del_binding(self, name): - del self.bindings[name] - self._validate() - # Base class representing an IPC Process to be created in the experiment # diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index e24dd60..f9c715f 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -228,16 +228,10 @@ class Experiment(mod.Experiment): next_vlan += 10 self.shim2vlan[dif.name] = vlan - # TODO: what format are the mappings registered in? Is this ok? - app_mappings = [] - for node in self.nodes: - app_mappings += [{'name': app, 'dif': self.dif_name(dif)} - for app in node.registrations - for dif in node.registrations[app]] - # If some app directives were specified, use those to build da.map. # Otherwise, assume the standard applications are to be mapped in # the DIF with the highest rank. + app_mappings = [] if len(app_mappings) == 0: if len(self.dif_ordering) > 0: for adm in \ diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index 9c164e7..01b8b72 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -50,27 +50,6 @@ class Experiment(mod.Experiment): ssh.execute_commands(self.testbed, node.ssh_config, cmds, time_out=None) - def bind_names(self): - for node in self.nodes: - cmds = list() - for name, ap in node.bindings.items(): - cmds.append("irm b ap " + ap + " n " + name) - - ssh.execute_commands(self.testbed, node.ssh_config, - cmds, time_out=None) - - def reg_names(self): - for node in self.nodes: - cmds = list() - for name, difs in node.registrations.items(): - cmd = "irm r n " + name - for dif in difs: - cmd += " dif " + dif.name - cmds.append(cmd) - - ssh.execute_commands(self.testbed, node.ssh_config, cmds, - time_out=None) - def create_ipcps(self): for node in self.nodes: cmds = list() @@ -147,12 +126,8 @@ class Experiment(mod.Experiment): def bootstrap_prototype(self): logger.info("Starting IRMd on all nodes...") self.setup_ouroboros() - logger.info("Binding names...") - self.bind_names() logger.info("Creating IPCPs") self.create_ipcps() logger.info("Enrolling IPCPs...") self.enroll_ipcps() - logger.info("Registering names...") - self.reg_names() logger.info("All done, have fun!") -- cgit v1.2.3