From 4824dafb3cf6c6b0bc9aaa14b2e7e75d8ebcda1f Mon Sep 17 00:00:00 2001 From: Joe Buck Date: Tue, 26 Mar 2013 20:11:21 -0700 Subject: [PATCH] teuthology: extend Hadoop task to support branches Modify the Hadoop task to support branches being specified for both the Apache and Inktank Hadoop branches. Signed-off-by: Joe Buck Reviewd-by: Sam Lang --- teuthology/task/hadoop.py | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/teuthology/task/hadoop.py b/teuthology/task/hadoop.py index c1c2abef4c183..026372406844d 100644 --- a/teuthology/task/hadoop.py +++ b/teuthology/task/hadoop.py @@ -379,6 +379,9 @@ def binaries(ctx, config): log.info('inktank_hadoop_bindir_url %s' % (inktank_hadoop_bindir_url)) ctx.summary['inktank-hadoop-sha1'] = inktank_sha1 + else: + raise Exception("The hadoop task does not support the path argument at present") + with parallel() as p: hadoopNodes = ctx.cluster.only(teuthology.is_type('hadoop')) # these can happen independently @@ -472,18 +475,38 @@ def task(ctx, config): - {tdir}/hadoop/bin/hadoop jar {tdir}/hadoop/build/hadoop-example*jar wordcount wordcount_input wordcount_output - rm -rf /tmp/hadoop_input """.format(tdir=teuthology.get_testdir(ctx)) - dist = 'precise' - format = 'jar' - arch = 'x86_64' - flavor = 'basic' - apache_branch = 'branch-1.0' # hadoop branch to acquire - inktank_branch = 'cephfs_branch-1.0' # hadoop branch to acquire if config is None: config = {} assert isinstance(config, dict), \ "task hadoop only supports a dictionary for configuration" + dist = 'precise' + format = 'jar' + arch = 'x86_64' + flavor = config.get('flavor', 'basic') + + ctx.summary['flavor'] = flavor + + overrides = ctx.config.get('overrides', {}) + teuthology.deep_merge(config, overrides.get('hadoop', {})) + + apache_branch = None + if config.get('apache_hadoop_branch') is not None: + apache_branch = config.get('apache_hadoop_branch') + else: + apache_branch = 'branch-1.0' # hadoop branch to acquire + + inktank_branch = None + if config.get('inktank_hadoop_branch') is not None: + inktank_branch = config.get('inktank_hadoop_branch') + else: + inktank_branch = 'cephfs/branch-1.0' # default branch name + + # replace any '/' with a '_' to match the artifact paths + inktank_branch = inktank_branch.replace('/','_') + apache_branch = apache_branch.replace('/','_') + with contextutil.nested( lambda: validate_config(ctx=ctx, config=config), lambda: binaries(ctx=ctx, config=dict( -- 2.39.5