From 127ef6861c04de7aada5d99279a39c3d1d258a9c Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Wed, 13 Jul 2011 12:34:39 -0700 Subject: [PATCH] Feed locally-created binary tarball to remotes in parallel. This should be faster as long as we have the bandwidth for it. --- teuthology/task/ceph.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 272a2040fc822..f12464b98e1f3 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -171,16 +171,18 @@ def binaries(ctx, config): finally: shutil.rmtree(tmpdir, ignore_errors=True) log.info('Pushing tarball...') - for rem in ctx.cluster.remotes.iterkeys(): - tar_fp.seek(0) - rem.run( - args=[ - 'install', '-d', '-m0755', '--', '/tmp/cephtest/binary', - run.Raw('&&'), - 'tar', '-xzf', '-', '-C', '/tmp/cephtest/binary' - ], - stdin=tar_fp, - ) + tar_fp.seek(0) + writes = ctx.cluster.run( + args=[ + 'install', '-d', '-m0755', '--', '/tmp/cephtest/binary', + run.Raw('&&'), + 'tar', '-xzf', '-', '-C', '/tmp/cephtest/binary' + ], + stdin=run.PIPE, + wait=False, + ) + teuthology.feed_many_stdins_and_close(tar_fp, writes) + run.wait(writes) try: yield -- 2.39.5