From: Sage Weil Date: Thu, 13 Feb 2020 19:44:08 +0000 (-0600) Subject: qa/suites/rados/cephadm: deploy prometheus.a X-Git-Tag: v15.1.1~412^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29c5cce96821ee8aad6c4a46338a9303a35db58a;p=ceph.git qa/suites/rados/cephadm: deploy prometheus.a Signed-off-by: Sage Weil --- diff --git a/qa/clusters/fixed-2.yaml b/qa/clusters/fixed-2.yaml index 5d5fcca9c950..ca92a8ff1881 100644 --- a/qa/clusters/fixed-2.yaml +++ b/qa/clusters/fixed-2.yaml @@ -1,6 +1,6 @@ roles: - [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0] -- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1] +- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a] openstack: - volumes: # attached to each instance count: 4 diff --git a/qa/suites/rados/cephadm/smoke/fixed-2.yaml b/qa/suites/rados/cephadm/smoke/fixed-2.yaml index 5d5fcca9c950..ca92a8ff1881 100644 --- a/qa/suites/rados/cephadm/smoke/fixed-2.yaml +++ b/qa/suites/rados/cephadm/smoke/fixed-2.yaml @@ -1,6 +1,6 @@ roles: - [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0] -- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1] +- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a] openstack: - volumes: # attached to each instance count: 4 diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index b97edb52e0b2..0b19dfeba17e 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -640,6 +640,41 @@ def ceph_mdss(ctx, config): yield +@contextlib.contextmanager +def ceph_prometheus(ctx, config): + """ + Deploy prometheus + """ + 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('prometheus', cluster_name)(r)]: + c_, _, id_ = teuthology.split_role(role) + log.info('Adding %s on %s' % (role, remote.shortname)) + nodes.append(remote.shortname + '=' + id_) + daemons[role] = (remote, id_) + if nodes: + _shell(ctx, cluster_name, remote, [ + 'ceph', 'orch', 'apply', 'prometheus', + str(len(nodes))] + nodes + ) + for role, i in daemons.items(): + remote, id_ = i + ctx.daemons.register_daemon( + remote, 'prometheus', 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'] @@ -954,6 +989,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_prometheus(ctx=ctx, config=config), lambda: ceph_clients(ctx=ctx, config=config), lambda: distribute_config_and_admin_keyring(ctx=ctx, config=config), ):