]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: pull image to all hosts in parallel 43936/head
authorSage Weil <sage@newdream.net>
Mon, 15 Nov 2021 18:00:52 +0000 (12:00 -0600)
committerSage Weil <sage@newdream.net>
Thu, 25 Nov 2021 13:52:56 +0000 (07:52 -0600)
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 <sage@newdream.net>
qa/tasks/cephadm.py

index edc4aad8521cef7a70dfc8a089e688184af54751..d87c773aab6835962d065d6fe6716dd4cd19dfb8 100644 (file)
@@ -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),