From: Sage Weil Date: Mon, 15 Nov 2021 18:00:52 +0000 (-0600) Subject: qa/tasks/cephadm: pull image to all hosts in parallel X-Git-Tag: v17.1.0~367^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9d50154a93644ae21ccffc278cdc359e7dd5af2c;p=ceph.git qa/tasks/cephadm: pull image to all hosts in parallel This doesn't affect bootstrap, but it does mean we avoid any delay the first time we cephadm.shell on some non-boostrap host. Signed-off-by: Sage Weil --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index edc4aad8521ce..d87c773aab683 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -343,6 +343,28 @@ def ceph_crash(ctx, config): pass +@contextlib.contextmanager +def pull_image(ctx, config): + cluster_name = config['cluster'] + log.info(f'Pulling image {ctx.ceph[cluster_name].image} on all hosts...') + run.wait( + ctx.cluster.run( + args=[ + 'sudo', + ctx.cephadm, + '--image', ctx.ceph[cluster_name].image, + 'pull', + ], + wait=False, + ) + ) + + try: + yield + finally: + pass + + @contextlib.contextmanager def ceph_bootstrap(ctx, config): """ @@ -1493,6 +1515,7 @@ def task(ctx, config): else download_cephadm(ctx=ctx, config=config, ref=ref), lambda: ceph_log(ctx=ctx, config=config), lambda: ceph_crash(ctx=ctx, config=config), + lambda: pull_image(ctx=ctx, config=config), lambda: _bypass() if (ctx.ceph[cluster_name].bootstrapped)\ else ceph_bootstrap(ctx, config), lambda: crush_setup(ctx=ctx, config=config),