From f6bf94ed0502a5812aaf72cfe8af0ef3471dadc7 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Thu, 3 May 2018 14:20:27 +0200 Subject: tools: update democonf2rumba fixes #53 --- rumba/testbeds/jfed.py | 4 ++-- tools/democonf2rumba.py | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index a651b63..0bb8cd3 100644 --- a/rumba/testbeds/jfed.py +++ b/rumba/testbeds/jfed.py @@ -98,9 +98,9 @@ class Testbed(mod.Testbed): if use_physical_machines is None: if "wall" in authority or "cloudlab" in authority: - self.use_physical_machines=True + self.use_physical_machines = True else: - self.use_physical_machines=False + self.use_physical_machines = False if image is not None: if image_owner is None: diff --git a/tools/democonf2rumba.py b/tools/democonf2rumba.py index e398308..795cf22 100755 --- a/tools/democonf2rumba.py +++ b/tools/democonf2rumba.py @@ -106,8 +106,10 @@ def make_experiment(filename, experiment_class, experiment_kwargs, parsed_difs = {} for shim_name, shim in shims.items(): - parsed_difs[shim_name] = (mod.ShimEthDIF(shim_name, - link_speed=shim['speed'])) + parsed_difs[shim_name] = (mod.ShimEthDIF( + shim_name, + link_quality=mod.LinkQuality(rate=shim['speed'])) + ) for dif_name, dif in difs.items(): parsed_difs[dif_name] = (mod.NormalDIF(dif_name)) @@ -177,7 +179,7 @@ if __name__ == '__main__': '--verbosity', metavar='VERBOSITY', type=str, default='INFO', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], - help='Path to the config file to parse') + help='Rumba output verbosity') subparsers = parser.add_subparsers(dest='testbed') emulab_p = subparsers.add_parser('emulab', help='Use emulab testbed') @@ -188,16 +190,18 @@ if __name__ == '__main__': for t in [emulab_p, jfed_p, qemu_p, fake_p]: setup_testbed_common_args(t) - qemu_p.add_argument('-B', '--bzimage', metavar='BZIMAGE', type=str, + qemu_p.add_argument('-B', '--bzimage-path', metavar='BZIMAGE', type=str, required=True, help='path to the bzImage file to use') - qemu_p.add_argument('-I', '--initramfs', metavar='INITRAMFS', type=str, + qemu_p.add_argument('-I', '--initramfs-path', metavar='INITRAMFS', type=str, required=True, help='path to the initramfs file to use') qemu_p.add_argument('-V', '--use_vhost', action='store_true', default=False, help='Use vhost') qemu_p.add_argument('-Q', '--qemu_logs_dir', metavar='QEMU_LOGS', type=str, default=None, help='path to the folder for qemu logs') + qemu_p.add_argument('--public-key-path', metavar='PATH', type=str, + default=None, help='path to the user ssh public key.') emulab_p.add_argument('-R', '--url', metavar='URL', type=str, default="wall2.ilabt.iminds.be", @@ -217,6 +221,15 @@ if __name__ == '__main__': jfed_p.add_argument('-I', '--image', metavar='IMAGE', type=str, default=None, help='Image to be used') + jfed_p.add_argument('--image-custom', metavar='I_CUSTOM', type=bool, + default=False, + help='Is the image a custom one?') + jfed_p.add_argument('--image-owner', metavar='I_OWNER', type=str, + default=None, + help='Creator of the image') + jfed_p.add_argument('--use-physical-machines', metavar='USE_PM', type=bool, + default=None, + help='Try to allocate physical machines if True') args = parser.parse_args() -- cgit v1.2.3 From 2e8cd8b8754384bef611efaadb18e1a977c5b30e Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Tue, 8 May 2018 11:03:05 +0200 Subject: elements: Experiment: add missing enrollment_strategy argument This is necessary to enable scripts to use full-mesh or manual enrollment strategies. Fixes #54. --- rumba/elements/experimentation.py | 10 ++++++++-- rumba/prototypes/irati.py | 7 +++++-- rumba/prototypes/ouroboros.py | 6 ++++-- rumba/prototypes/rlite.py | 6 ++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/rumba/elements/experimentation.py b/rumba/elements/experimentation.py index da81c6c..990f285 100644 --- a/rumba/elements/experimentation.py +++ b/rumba/elements/experimentation.py @@ -115,7 +115,8 @@ class Experiment(object): git_repo=None, git_branch=None, log_dir=None, - prototype_logs=None): + prototype_logs=None, + enrollment_strategy='minimal'): """ :param testbed: The testbed of the experiment. :param nodes: The list of nodes in the experiment. @@ -123,6 +124,7 @@ class Experiment(object): :param git_branch: The git branch of the repository. :param log_dir: Where to log output of the experiment. :param prototype_logs: Where the prototype logs its output. + :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. """ if nodes is None: nodes = list() @@ -132,7 +134,7 @@ class Experiment(object): self.testbed = testbed # the strategy employed for completing the enrollment phase in # the different DIFs - self.enrollment_strategy = 'minimal' # 'full-mesh', 'manual' + self.enrollment_strategy = enrollment_strategy # 'full-mesh', 'manual' # the strategy employed for setting up the data transfer # networks in the DIFs after enrollment self.dt_strategy = 'full-mesh' # 'minimal', 'manual' @@ -141,6 +143,10 @@ class Experiment(object): self.dt_flows = [] # a list of per-DIF lists of data transfer flows self.mgmt_flows = [] # a list of per-DIF lists of management flows + if self.enrollment_strategy not in ['full-mesh', 'minimal', 'manual']: + raise Exception('Unknown enrollment strategy "%s"' + % enrollment_strategy) + # Determine log directory if log_dir is None: # If it is None, use /tmp/rumba/{project} diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index 1967278..ec3e53d 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -67,7 +67,8 @@ class Experiment(mod.Experiment): git_branch='arcfire', installpath=None, varpath=None, - app_mappings=None): + app_mappings=None, + enrollment_strategy='minimal'): """ Initializes the experiment class. @@ -81,13 +82,15 @@ class Experiment(mod.Experiment): all application which will register to any given dif. :type app_mappings: `List[(str, str)]` + :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. """ mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch, - prototype_logs=['/tmp/ipcmstart.log']) + prototype_logs=['/tmp/ipcmstart.log'], + enrollment_strategy=enrollment_strategy) if installpath is None: installpath = '/usr' if varpath is None: diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index e72bcf1..f415160 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -44,7 +44,7 @@ class Experiment(mod.Experiment): """ def __init__(self, testbed, nodes=None, git_repo='git://ouroboros.ilabt.imec.be/ouroboros', - git_branch='master'): + git_branch='master', enrollment_strategy='minimal'): """ Initializes the experiment class. @@ -52,8 +52,10 @@ class Experiment(mod.Experiment): :param nodes: The list of nodes. :param git_repo: The git repository to use for installation. :param git_branch: The branch of the git repository to use. + :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. """ - mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch) + mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch, + enrollment_strategy=enrollment_strategy) self.r_ipcps = dict() self.set_startup_command("irmd") diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index 32b7df7..1595336 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -42,7 +42,7 @@ class Experiment(mod.Experiment): def __init__(self, testbed, nodes=None, git_repo='https://github.com/vmaffione/rlite', - git_branch='master'): + git_branch='master', enrollment_strategy='minimal'): """ Initializes the experiment class. @@ -50,9 +50,11 @@ class Experiment(mod.Experiment): :param nodes: The list of nodes. :param git_repo: The git repository to use for installation. :param git_branch: The branch of the git repository to use. + :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. """ mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch, - prototype_logs=['/tmp/uipcp.log']) + prototype_logs=['/tmp/uipcp.log'], + enrollment_strategy=enrollment_strategy) @staticmethod def make_executor(node, packages, testbed): -- cgit v1.2.3 From e7e81f30d8a6054e142cf7c77459532247a644d2 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Tue, 8 May 2018 11:32:19 +0200 Subject: elements: Experiment: add missing dt_strategy argument --- rumba/elements/experimentation.py | 13 +++++++++---- rumba/prototypes/ouroboros.py | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/rumba/elements/experimentation.py b/rumba/elements/experimentation.py index 990f285..9890975 100644 --- a/rumba/elements/experimentation.py +++ b/rumba/elements/experimentation.py @@ -116,7 +116,8 @@ class Experiment(object): git_branch=None, log_dir=None, prototype_logs=None, - enrollment_strategy='minimal'): + enrollment_strategy='minimal', + dt_strategy='full-mesh'): """ :param testbed: The testbed of the experiment. :param nodes: The list of nodes in the experiment. @@ -125,6 +126,7 @@ class Experiment(object): :param log_dir: Where to log output of the experiment. :param prototype_logs: Where the prototype logs its output. :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. + :param dt_strategy: For data flows, 'full-mesh', 'minimal' or 'manual'. """ if nodes is None: nodes = list() @@ -136,8 +138,8 @@ class Experiment(object): # the different DIFs self.enrollment_strategy = enrollment_strategy # 'full-mesh', 'manual' # the strategy employed for setting up the data transfer - # networks in the DIFs after enrollment - self.dt_strategy = 'full-mesh' # 'minimal', 'manual' + # network in the DIFs after enrollment + self.dt_strategy = dt_strategy self.dif_ordering = [] self.enrollments = [] # a list of per-DIF lists of enrollments self.dt_flows = [] # a list of per-DIF lists of data transfer flows @@ -145,7 +147,10 @@ class Experiment(object): if self.enrollment_strategy not in ['full-mesh', 'minimal', 'manual']: raise Exception('Unknown enrollment strategy "%s"' - % enrollment_strategy) + % self.enrollment_strategy) + if self.dt_strategy not in ['full-mesh', 'minimal', 'manual']: + raise Exception('Unknown dt strategy "%s"' + % self.dt_strategy) # Determine log directory if log_dir is None: diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index f415160..016183e 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -44,7 +44,8 @@ class Experiment(mod.Experiment): """ def __init__(self, testbed, nodes=None, git_repo='git://ouroboros.ilabt.imec.be/ouroboros', - git_branch='master', enrollment_strategy='minimal'): + git_branch='master', enrollment_strategy='minimal', + dt_strategy='full-mesh'): """ Initializes the experiment class. @@ -53,9 +54,11 @@ class Experiment(mod.Experiment): :param git_repo: The git repository to use for installation. :param git_branch: The branch of the git repository to use. :param enrollment_strategy: Can be 'full-mesh', 'minimal' or 'manual'. + :param dt_strategy: For data flows, 'full-mesh', 'minimal' or 'manual'. """ mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch, - enrollment_strategy=enrollment_strategy) + enrollment_strategy=enrollment_strategy, + dt_strategy=dt_strategy) self.r_ipcps = dict() self.set_startup_command("irmd") -- cgit v1.2.3