]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Feed locally-created binary tarball to remotes in parallel.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Wed, 13 Jul 2011 19:34:39 +0000 (12:34 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Wed, 13 Jul 2011 19:34:39 +0000 (12:34 -0700)
This should be faster as long as we have the bandwidth for it.

teuthology/task/ceph.py

index 272a2040fc822112b9c83a81e74c5a03cef4db2c..f12464b98e1f3e4243a0f139c523f044b97e82fc 100644 (file)
@@ -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