aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexamples/scalingtime.py137
-rw-r--r--rumba/prototypes/ouroboros.py16
-rw-r--r--rumba/testbeds/dockertb.py2
-rw-r--r--rumba/testbeds/local.py3
-rw-r--r--rumba/testbeds/qemu.py2
5 files changed, 141 insertions, 19 deletions
diff --git a/examples/scalingtime.py b/examples/scalingtime.py
index cb1ba4f..bf4a739 100755
--- a/examples/scalingtime.py
+++ b/examples/scalingtime.py
@@ -7,6 +7,8 @@ from rumba.utils import *
import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
import rumba.testbeds.qemu as qemu
+import rumba.testbeds.local as local
+import rumba.testbeds.dockertb as docker
# import prototype plugins
import rumba.prototypes.ouroboros as our
@@ -20,16 +22,81 @@ import sys
description = "Script to create the demo from the Rumba paper"
argparser = argparse.ArgumentParser(description = description)
-argparser.add_argument('-m', '--metro', type = int, default = '2',
+
+# Parameters to set the experiment size
+argparser.add_argument('--metro-networks', type = int, default = '2',
help = "Number of metro networks")
-argparser.add_argument('-n', '--metro-nodes', type = int, default = '5',
+argparser.add_argument('--metro-nodes', type = int, default = '5',
help = "Number of nodes per metro")
-argparser.add_argument('-e', '--end-nodes', type = int, default = '2',
+argparser.add_argument('--end-nodes', type = int, default = '2',
help = "Number of nodes connected to each metro")
+# Other parameters
+argparser.add_argument('--verbosity', metavar='VERBOSITY', type=str,
+ default='INFO',
+ choices=['DEBUG', 'INFO', 'WARNING',
+ 'ERROR', 'CRITICAL'],
+ help='Logging verbosity level')
+argparser.add_argument('--prototype', type=str, required=True,
+ choices=['irati', 'ouroboros', 'rlite'],
+ help='The kind of prototype plugin to use to run'
+ ' the experiment.')
+
+subparsers = argparser.add_subparsers(dest='testbed')
+emulab_p = subparsers.add_parser('emulab', help='Use emulab testbed')
+jfed_p = subparsers.add_parser('jfed', help='Use jfed testbed')
+qemu_p = subparsers.add_parser('qemu', help='Use qemu testbed')
+local_p = subparsers.add_parser('local', help='Use local testbed')
+docker_p = subparsers.add_parser('docker', help='Use Docker testbed')
+
+qemu_p.add_argument('--bzimage', metavar='BZIMAGE', type=str,
+ help='path to the bzImage file to use')
+qemu_p.add_argument('--initramfs', metavar='INITRAMFS', type=str,
+ help='path to the initramfs file to use')
+qemu_p.add_argument('--use_vhost', action='store_true',
+ default=False, help='Use vhost')
+qemu_p.add_argument('--qemu_logs_dir', metavar='QEMU_LOGS', type=str,
+ default=None, help='path to the folder for qemu logs')
+qemu_p.add_argument('--username', type = str, help = "Username")
+qemu_p.add_argument('--password', type = str, help = "Password")
+
+emulab_p.add_argument('--url', metavar='URL', type=str,
+ default="wall2.ilabt.iminds.be",
+ help='Url')
+emulab_p.add_argument('--image', metavar='IMG', type=str,
+ default="UBUNTU14-64-STD",
+ help='Ubuntu image')
+emulab_p.add_argument('--username', type = str, required=True,
+ help = "Username")
+emulab_p.add_argument('--password', type = str, help = "Password")
+emulab_p.add_argument('--exp-name', type = str, required=True,
+ help = "Name of the experiment")
+
+jfed_p.add_argument('--cert-file', type = str,
+ required=True,
+ help = "Absolute path to certificate (.pem) file"
+ " to be used with jFed")
+jfed_p.add_argument('--authority', type = str, default = 'exogeni.net',
+ help = "jFed testbed to use")
+jfed_p.add_argument('--image', metavar='IMAGE', type=str,
+ default=None,
+ help='Image to be used')
+jfed_p.add_argument('--exp-hours', metavar='HOURS', type=str,
+ default="2", help='Experiment hours')
+jfed_p.add_argument('--username', type = str, required=True,
+ help = "Username")
+jfed_p.add_argument('--exp-name', type = str, required=True,
+ help = "Name of the experiment")
+
+docker_p.add_argument('--base-image', metavar='DOCKIMAGE', type=str,
+ default=None, required=True,
+ help='Docker image to be used')
+docker_p.add_argument('--use-ovs', action='store_true',
+ default=False, help='Use ovs switch')
+
args = argparser.parse_args()
-log.set_logging_level('DEBUG')
+log.set_logging_level(args.verbosity)
pi = NormalDIF("pi")
pi.dt_strategy = 'minimal'
@@ -40,7 +107,7 @@ nodes = []
core_nodes = []
-for i in range(0, args.metro):
+for i in range(0, args.metro_networks):
m = NormalDIF("m-" + str(i))
e_prev = None
m1 = None
@@ -120,14 +187,60 @@ for i in range(0, args.metro):
core_nodes.append(c1)
core_nodes.append(c2)
-tb = jfed.Testbed(exp_name = "metro2",
- cert_file = '/home/sander/cert.pem',
- authority = 'exogeni.net:umassvmsite',
- username = 'sander')
-
-exp = our.Experiment(tb, nodes = nodes)
+if args.testbed == 'emulab':
+ test_class = emulab.Testbed
+ testbed_args = {a.dest: getattr(args, a.dest)
+ for a in emulab_p._actions
+ if a.dest != 'help'
+ and getattr(args, a.dest) is not None}
+elif args.testbed == 'jfed':
+ test_class = jfed.Testbed
+ testbed_args = {a.dest: getattr(args, a.dest)
+ for a in jfed_p._actions
+ if a.dest != 'help'
+ and getattr(args, a.dest) is not None}
+elif args.testbed == 'qemu':
+ test_class = qemu.Testbed
+ testbed_args = {a.dest: getattr(args, a.dest)
+ for a in qemu_p._actions
+ if a.dest != 'help'
+ and getattr(args, a.dest) is not None}
+elif args.testbed == 'local':
+ test_class = local.Testbed
+ testbed_args = {a.dest: getattr(args, a.dest)
+ for a in local_p._actions
+ if a.dest != 'help'
+ and getattr(args, a.dest) is not None}
+elif args.testbed == 'docker':
+ test_class = docker.Testbed
+ testbed_args = {a.dest: getattr(args, a.dest)
+ for a in docker_p._actions
+ if a.dest != 'help'
+ and getattr(args, a.dest) is not None}
+elif args.testbed is None:
+ print('Testbed type must be specified!')
+ print(argparser.format_help())
+ exit(1)
+
+testbed = test_class(**testbed_args)
+
+if args.prototype == 'irati':
+ exp_class = irati.Experiment
+elif args.prototype == 'ouroboros':
+ exp_class = our.Experiment
+elif args.prototype == 'rlite':
+ exp_class = rl.Experiment
+else:
+ print('Unexpected prototype!')
+ print(argparser.format_help())
+ exit(1)
+
+exp = exp_class(testbed, nodes = nodes)
with ExperimentManager(exp, swap_out_strategy=PAUSE_SWAPOUT):
exp.swap_in()
- exp.install_prototype()
+ if not isinstance(testbed, docker.Testbed) \
+ and not isinstance(testbed, qemu.Testbed) \
+ and not isinstance(testbed, local.Testbed):
+ exp.install_prototype()
exp.bootstrap_prototype()
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 573e336..e72bcf1 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -150,11 +150,15 @@ class Experiment(mod.Experiment):
cmd2 = "irm r n " + ipcp.name
for dif_b in node.dif_registrations[ipcp.dif]:
- cmd2 += " layer " + dif_b.name
+ for ipcp_b in node.ipcps:
+ if ipcp_b in dif_b.ipcps:
+ cmd2 += " ipcp " + ipcp_b.name
cmds2.append(cmd2)
cmd2 = "irm r n " + ipcp.dif.name
for dif_b in node.dif_registrations[ipcp.dif]:
- cmd2 += " layer " + dif_b.name
+ for ipcp_b in node.ipcps:
+ if ipcp_b in dif_b.ipcps:
+ cmd2 += " ipcp " + ipcp_b.name
cmds2.append(cmd2)
elif isinstance(ipcp.dif, mod.ShimUDPDIF):
# FIXME: Will fail, since we don't keep IPs yet
@@ -183,14 +187,18 @@ class Experiment(mod.Experiment):
cmd = "irm r n " + ipcp.name
for dif_b in e['enrollee'].node.dif_registrations[ipcp.dif]:
- cmd += " layer " + dif_b.name
+ for ipcp_b in e['enrollee'].node.ipcps:
+ if ipcp_b in dif_b.ipcps:
+ cmd += " ipcp " + ipcp_b.name
cmds.append(cmd)
cmd = "irm i e n " + ipcp.name + " layer " + e['dif'].name + \
" autobind"
cmds.append(cmd)
cmd = "irm r n " + ipcp.dif.name
for dif_b in e['enrollee'].node.dif_registrations[ipcp.dif]:
- cmd += " layer " + dif_b.name
+ for ipcp_b in e['enrollee'].node.ipcps:
+ if ipcp_b in dif_b.ipcps:
+ cmd += " ipcp " + ipcp_b.name
cmds.append(cmd)
e['enrollee'].node.execute_commands(cmds, time_out=None)
diff --git a/rumba/testbeds/dockertb.py b/rumba/testbeds/dockertb.py
index dca2b86..4079ffe 100644
--- a/rumba/testbeds/dockertb.py
+++ b/rumba/testbeds/dockertb.py
@@ -39,7 +39,7 @@ class Testbed(mod.Testbed):
"""
Represents a docker testbed.
"""
- def __init__(self, exp_name, base_image, pull_image=True,
+ def __init__(self, base_image, exp_name='foo', pull_image=True,
use_ovs=False):
"""
Initializes the testbed class.
diff --git a/rumba/testbeds/local.py b/rumba/testbeds/local.py
index a3f4570..8b57ed2 100644
--- a/rumba/testbeds/local.py
+++ b/rumba/testbeds/local.py
@@ -38,7 +38,8 @@ class Testbed(mod.Testbed):
processes locally. Also useful for debugging in the other plugins.
"""
- def __init__(self, exp_name, username, proj_name="ARCFIRE", password=""):
+ def __init__(self, exp_name='foo', username='bar',
+ proj_name="ARCFIRE", password=""):
"""
Initializes the parent class.
diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py
index a09229b..2a42472 100644
--- a/rumba/testbeds/qemu.py
+++ b/rumba/testbeds/qemu.py
@@ -53,7 +53,7 @@ class Testbed(mod.Testbed):
"""
Represents a QEMU testbed.
"""
- def __init__(self, exp_name, bzimage_path=None, initramfs_path=None,
+ def __init__(self, exp_name='foo', bzimage_path=None, initramfs_path=None,
proj_name="ARCFIRE", password="root", username="root",
public_key_path=os.path.join(USER_HOME, '.ssh', 'id_rsa.pub'),
use_vhost=True):