]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology: extend Hadoop task to support branches
authorJoe Buck <jbbuck@gmail.com>
Wed, 27 Mar 2013 03:11:21 +0000 (20:11 -0700)
committerJoe Buck <jbbuck@gmail.com>
Thu, 4 Apr 2013 22:57:31 +0000 (15:57 -0700)
Modify the Hadoop task to support branches
being specified for both the Apache and Inktank
Hadoop branches.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewd-by: Sam Lang <sam.lang@inktank.com>
teuthology/task/hadoop.py

index c1c2abef4c183b627c747eb12e94d95d691fad0d..026372406844de25424fbecc1c9eb8fd55348ae1 100644 (file)
@@ -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(