From 32b2ded8dcecddac8e95a422bfbec8ce717ec0d9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 13 Feb 2020 13:47:23 -0600 Subject: [PATCH] qa/tasks/cephadm: deploy rgw daemons too Signed-off-by: Sage Weil --- qa/suites/rados/cephadm/smoke/fixed-2.yaml | 2 +- qa/tasks/cephadm.py | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/qa/suites/rados/cephadm/smoke/fixed-2.yaml b/qa/suites/rados/cephadm/smoke/fixed-2.yaml index ca92a8ff1881..b96ba15a06cc 100644 --- a/qa/suites/rados/cephadm/smoke/fixed-2.yaml +++ b/qa/suites/rados/cephadm/smoke/fixed-2.yaml @@ -1,5 +1,5 @@ roles: -- [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0] +- [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0, ceph.rgw.r.z.a] - [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a] openstack: - volumes: # attached to each instance diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 0b19dfeba17e..ad1bf9c81376 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -675,6 +675,46 @@ def ceph_prometheus(ctx, config): yield +@contextlib.contextmanager +def ceph_rgw(ctx, config): + """ + Deploy rgw + """ + cluster_name = config['cluster'] + fsid = ctx.ceph[cluster_name].fsid + + nodes = {} + daemons = {} + for remote, roles in ctx.cluster.remotes.items(): + for role in [r for r in roles + if teuthology.is_type('rgw', cluster_name)(r)]: + c_, _, id_ = teuthology.split_role(role) + log.info('Adding %s on %s' % (role, remote.shortname)) + realmzone = '.'.join(id_.split('.')[0:2]) + if realmzone not in nodes: + nodes[realmzone] = [] + nodes[realmzone].append(remote.shortname + '=' + id_) + daemons[role] = (remote, id_) + for realmzone, nodes in nodes.items(): + (realm, zone) = realmzone.split('.', 1) + _shell(ctx, cluster_name, remote, [ + 'ceph', 'orch', 'apply', 'rgw', + realm, zone, + str(len(nodes))] + nodes + ) + for role, i in daemons.items(): + remote, id_ = i + ctx.daemons.register_daemon( + remote, 'rgw', id_, + cluster=cluster_name, + fsid=fsid, + logger=log.getChild(role), + wait=False, + started=True, + ) + + yield + @contextlib.contextmanager def ceph_clients(ctx, config): cluster_name = config['cluster'] @@ -989,6 +1029,7 @@ def task(ctx, config): lambda: ceph_mgrs(ctx=ctx, config=config), lambda: ceph_osds(ctx=ctx, config=config), lambda: ceph_mdss(ctx=ctx, config=config), + lambda: ceph_rgw(ctx=ctx, config=config), lambda: ceph_prometheus(ctx=ctx, config=config), lambda: ceph_clients(ctx=ctx, config=config), lambda: distribute_config_and_admin_keyring(ctx=ctx, config=config), -- 2.47.3