aboutsummaryrefslogtreecommitdiff
path: root/examples/datacenter.py
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-03-01 11:02:25 +0100
committerDimitri Staessens <dimitri@ouroboros.rocks>2026-03-07 11:29:02 +0100
commit6cbcfb039e608419bd6ced673723918aca6fb278 (patch)
tree172061d95f50cda09c3872d32c5f77e459044cd8 /examples/datacenter.py
parent4e35c6b445d0cfbad9cf15a48f2d341e29dbd806 (diff)
downloadrumba-6cbcfb039e608419bd6ced673723918aca6fb278.tar.gz
rumba-6cbcfb039e608419bd6ced673723918aca6fb278.zip
rumba: Remove irati/rlite, python2 and qemu support
Remove IRATI and rlite prototype plugins, keeping only Ouroboros. Delete .gitlab-ci.yml (only contained an irati test job and a Sphinx pages job). Clean up all irati/rlite imports and references from examples, documentation, and tools. Qemu was tied heavily with rlite and irati. As it's less useful for ouroboros it's removed rather than reworked. Updated README.md and AUTHORS Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Diffstat (limited to 'examples/datacenter.py')
-rwxr-xr-xexamples/datacenter.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/examples/datacenter.py b/examples/datacenter.py
new file mode 100755
index 0000000..ab02a2a
--- /dev/null
+++ b/examples/datacenter.py
@@ -0,0 +1,78 @@
+from rumba.model import Node, UnicastLayer, EthDixLayer
+import rumba.log as log
+# import testbed plugins
+import rumba.testbeds.local as local
+from rumba.storyboard import *
+# import Ouroboros prototype plugin
+import rumba.prototypes.ouroboros as our
+
+
+__all__ = ["local_exp", "name_nodes", "start_net"]
+
+
+log.set_logging_level("DEBUG")
+
+
+def buildRack(nRack, numHosts=2):
+ rack = UnicastLayer(f"rack{nRack}")
+ cables, hosts = [], []
+
+ for n in range(numHosts):
+ cables.append(EthDixLayer(f"e{n}r{nRack}"))
+ hosts.append(
+ Node(
+ f"h{n}r{nRack}",
+ layers=[cables[-1], rack],
+ registrations={rack: [cables[-1]]},
+ )
+ )
+
+ ToR_switch = Node(
+ f"s{nRack}", layers=[*cables, rack], registrations={rack: cables}
+ )
+
+ return [*hosts, ToR_switch] # list of nodes, ToR_switch latest
+
+
+def build(numRacks=2, numHostsPerRack=2):
+ nodes, router_cables = [], []
+
+ for i in range(numRacks):
+ router_cables.append(EthDixLayer(f"router_{i}"))
+ nodes += buildRack(i, numHosts=numHostsPerRack)
+ nodes[-1].add_layer(router_cables[-1])
+ #nodes[-1].add_registration(router_cables[-1])
+
+ Datacenter_router = Node("router", layers=router_cables)
+
+ return [*nodes, Datacenter_router]
+
+
+nodes = build()
+
+name_nodes = list(map(lambda node: node.name, nodes))
+
+local_tb = local.Testbed()
+
+
+local_exp = our.Experiment(local_tb, nodes=nodes)
+
+
+def start_net():
+ local_exp.swap_in()
+ local_exp.install_prototype()
+ local_exp.bootstrap_prototype()
+
+
+def print_network():
+ local_exp.export_connectivity_graph("datacenter_physical.pdf")
+
+ for layer in local_exp.layer_ordering:
+ if not isinstance(layer, EthDixLayer):
+ local_exp.export_layer_graph(f"datacenter_layer_{layer.name}.pdf", layer)
+
+
+if __name__ == '__main__':
+ #start_net()
+ print_network()
+