From: Sage Weil Date: Mon, 29 Dec 2014 20:39:26 +0000 (-0800) Subject: Revert "Move output in task/s3readwrite" X-Git-Tag: v0.94.10~27^2^2~187^2~3^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76967993285acd6c619b99f2a11eb5a02be7cec6;p=ceph.git Revert "Move output in task/s3readwrite" This reverts commit 26a33c3a5aa2aedb52eb5ce140c76503f099b253. This is tryign to create the archive dir on the remote host: 2014-12-29T12:15:30.213 INFO:teuthology.orchestra.run.plana31:Running: 'mkdir -p /var/lib/teuthworker/archive/sage-2014-12-29_11:40:52-rgw-next---basic-multi/683052' 2014-12-29T12:15:30.231 ERROR:teuthology.contextutil:Saw exception from nested tasks Traceback (most recent call last): File "/home/teuthworker/src/teuthology_master/teuthology/contextutil.py", line 28, in nested vars.append(enter()) File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/var/lib/teuthworker/src/ceph-qa-suite_next/tasks/s3readwrite.py", line 241, in run_tests ctx.cluster.only(client).run(args=['mkdir', '-p', archive_dir]) File "/home/teuthworker/src/teuthology_master/teuthology/orchestra/cluster.py", line 64, in run return [remote.run(**kwargs) for remote in remotes] File "/home/teuthworker/src/teuthology_master/teuthology/orchestra/remote.py", line 128, in run r = self._runner(client=self.ssh, name=self.shortname, **kwargs) File "/home/teuthworker/src/teuthology_master/teuthology/orchestra/run.py", line 368, in run r.wait() File "/home/teuthworker/src/teuthology_master/teuthology/orchestra/run.py", line 106, in wait exitstatus=status, node=self.hostname) CommandFailedError: Command failed on plana31 with status 1: 'mkdir -p /var/lib/teuthworker/archive/sage-2014-12-29_11:40:52-rgw-next---basic-multi/683052' ...but it should only be on the local host. (cherry picked from commit 3960530b7decc360c72d4670475806c04f218bfa) --- diff --git a/tasks/s3readwrite.py b/tasks/s3readwrite.py index 2f7b109a1ffb..9f1507ef8167 100644 --- a/tasks/s3readwrite.py +++ b/tasks/s3readwrite.py @@ -9,7 +9,6 @@ import os import random import string import yaml -from datetime import datetime from teuthology import misc as teuthology from teuthology import contextutil @@ -89,11 +88,6 @@ def create_users(ctx, config): testdir = teuthology.get_testdir(ctx) users = {'s3': 'foo'} cached_client_user_names = dict() - try: - archive_dir = ctx.archive - except AttributeError: - archive_dir = '/tmp' - arch_file = os.sep.join([archive_dir, 's3readwrite-{site}-{time}']) for client in config['clients']: cached_client_user_names[client] = dict() s3tests_conf = config['s3tests_conf'][client] @@ -103,11 +97,6 @@ def create_users(ctx, config): s3tests_conf['readwrite'].setdefault('writers', 3) s3tests_conf['readwrite'].setdefault('duration', 300) s3tests_conf['readwrite'].setdefault('files', {}) - timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S') - s3tests_conf['readwrite'].setdefault('output', - arch_file.format(site=client, time=timestamp)) - s3tests_conf['readwrite'].setdefault('archive_dir', archive_dir) - s3tests_conf['readwrite'].setdefault('verbose', False) rwconf = s3tests_conf['readwrite'] rwconf['files'].setdefault('num', 10) rwconf['files'].setdefault('size', 2000) @@ -226,8 +215,7 @@ def run_tests(ctx, config): """ assert isinstance(config, dict) testdir = teuthology.get_testdir(ctx) - rem_file_list = [] - for client, client_config in config['clients'].iteritems(): + for client, client_config in config.iteritems(): (remote,) = ctx.cluster.only(client).remotes.keys() conf = teuthology.get_file(remote, '{tdir}/archive/s3readwrite.{client}.config.yaml'.format(tdir=testdir, client=client)) args = [ @@ -235,19 +223,12 @@ def run_tests(ctx, config): ] if client_config is not None and 'extra_args' in client_config: args.extend(client_config['extra_args']) - output_file = client_config['readwrite']['output'] - archive_dir = client_config['readwrite']['archive_dir'] - log.info('Output generated by s3readwrite test has been saved in %s' % output_file) - ctx.cluster.only(client).run(args=['mkdir', '-p', archive_dir]) - args.extend([run.Raw('>'), output_file]) - rem_file_list.append((remote, client, output_file, archive_dir)) - ctx.cluster.only(client).run(args=args, stdin=StringIO(conf)) - try: - yield - finally: - for remote_info in rem_file_list: - teuthology.pull_directory(remote_info[0], remote_info[3], remote_info[3]) - ctx.cluster.only(remote_info[1]).run(args=['rm', '-f', remote_info[2]]) + + ctx.cluster.only(client).run( + args=args, + stdin=conf, + ) + yield @contextlib.contextmanager @@ -290,8 +271,6 @@ def task(ctx, config): readers: 10 writers: 3 duration: 600 - output: /tmp/output - verbose: True files: num: 10 size: 2000 @@ -313,8 +292,6 @@ def task(ctx, config): access_key: myaccesskey secret_key: mysecretkey - This test writes results to the file specified in the output line under s3readwrite. - If no output is specified, the results are saved in a temporary file. """ assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ @@ -363,10 +340,7 @@ def task(ctx, config): clients=config, s3tests_conf=s3tests_conf, )), - lambda: run_tests(ctx=ctx, config=dict( - clients=config, - s3tests_conf=s3tests_conf, - )), + lambda: run_tests(ctx=ctx, config=config), ): pass yield