John Mulligan [Tue, 3 Oct 2023 20:51:49 +0000 (16:51 -0400)]
cephadm: mock os.path.listdir in daemon forms test
Prevent classes that want to check the filesystem from breaking the
simple daemon forms instantiation test case. A better future fix would
be avoiding checking the file system during __init__ of the class but
that is left for future improvements.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 3 Oct 2023 20:43:59 +0000 (16:43 -0400)]
cephadm: stop directly using Ceph.daemons property
The Ceph.daemons property has two unfortunate behaviors: most important,
it includes ceph-exporter which causes the other CephExporter class to
be over-shadowed the DaemonForms mechanism. Second, it couples all
functions that want to know the names of ceph daemon types to the Ceph
class preventing future refactoring of that class.
Break the existing coupling by adding a new `ceph_daemons` function
similar to `get_supported_daemons` but returning the same value that
Ceph.daemons used to provide. This will permit future fixes and
improvements.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 28 Sep 2023 18:15:55 +0000 (14:15 -0400)]
cephadm: eliminate _dispatch_deploy function
Eliminate the _dispatch_deploy function, folding it into the
_common_deploy function, because the mass of if-elif lines have
been replaced and keeping it as a separate function no longer
serves much of a useful purpose.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 28 Sep 2023 15:02:37 +0000 (11:02 -0400)]
cephadm: update test to avoid using exception handling as an assertion
The use of an exception as an assertion mostly works but has the side
effect of hiding other errors. Hiding these errors can make it hard to
debug problems in this code path, as it did for me recently. Update the
test to use a standard assertion as well as asserting that the assertion
must have been called.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 3 Oct 2023 20:33:46 +0000 (16:33 -0400)]
cephadm: remove gateways property from Ceph type
The gateways list property of the Ceph type was used in exactly one
place. In order to provide a clearer structure to the classes in
cephadm, remove this property and simply list the daemon types
specifically where they are needed.
In the future, I hope to see these handled in a class/object based
manner but this is still better for now.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
vstart: exclude default route during cluster setup
"ip route list" may list default route, and that needs to be excluded
while doing cluster setup
Typical o/p of ip route list:
$ ip route list
default via 10.8.159.254 dev eno1 proto dhcp src 10.8.152.13 metric 100
10.8.152.0/21 dev eno1 proto kernel scope link src 10.8.152.13 metric 100
John Mulligan [Wed, 4 Oct 2023 17:43:47 +0000 (13:43 -0400)]
cephadm: convert cephadm agent to a daemon form
The cephadm agent is a bit special in that it will not be converted
to a ContainerDaemonForm (it is not containerized) but we still want
to have it registered as a DeamonForm so that the deamon_type can be
passed to create and have it resolve correctly.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 23 Sep 2023 19:26:03 +0000 (15:26 -0400)]
cephadm: add func to deploy any generic ContainerDaemonForm
While there are no ContainerDaemonForms implemented yet, add a function
that uses the ContainerDaemonForm methods to construct a deployment
for the container based daemons.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 23 Sep 2023 19:23:42 +0000 (15:23 -0400)]
cephadm: add ContainerDaemonForm
Add a supplemental DaemonForm subclass that helps deploy container
based daemons in a standard fashion. Most of these methods are
optional and should have sensible defaults.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 21 Sep 2023 21:57:43 +0000 (17:57 -0400)]
cephadm: remove direct daemon-type deps from sysctl
Using the appropriate daemon form we can break the direct dependency
that the sysctl setup function has on particular classes and use
a generic interface.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 20 Sep 2023 14:17:29 +0000 (10:17 -0400)]
cephadm: introduce daemon forms to cephadm.py
Introduce the DeamonForm base class to cephadm.py and make various
daemon-type classes into fully fleged deamon form classes.
Some classes already had a semi-standard `init` classmethod for
instantiation. In these cases the new `create` classmethod is a thin
wrapper over the existing method. In cases where the class was not
already being instantiated a minimal set of methods are added.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 21 Sep 2023 20:21:00 +0000 (16:21 -0400)]
cephadm: add daemon_form.py: bases and funcs for daemon forms
Create daemon_form.py containing the DaemonForm class and a few
subclasses and utility functions for working with DaemonForms.
In a future commit, DaemonForm will become the base class for
the current assortment of classes named after the daemon or
family of daemon they help manage.
A daemon form, think "form" as in "template" or "mold", assists
in setting up, creating, and managing daemons controlled with
cephadm. Because cephadm supports a variety of services the
DaemonForm is an abstract base class and the module also supports
additional ABCs that may be used by DaemonForms to implement
optional features.
The daemon forms that are expected to be used directly must be
registered using the provided decorator. This is an explicit extra
step so that common bases that inherit from DaemonForm can be
implemented. Plus explicit is better than implicit. :-)
All DeamonForm subclasses are expected to provide a small set
of standard methods so that the types can be chosen, instantiated,
and used a common manner.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Nizamudeen A [Tue, 19 Sep 2023 06:42:36 +0000 (12:12 +0530)]
mgr/dashboard: fix the landing page layout issues
We were following a row-col grid layout for the landing page.
First row includes Details, Status and Capacity
Second row for Inventory and Cluster Utilization
So if one of the item in the first row increases, it pushes the entire
second row downwards.
To fix this, I made a col-row grid.
First col has Details and Inventory in two rows.
Second col has Status and Capacity as a col and Cluster Utilization as a
single row
Fixes: https://tracker.ceph.com/issues/62961 Signed-off-by: Nizamudeen A <nia@redhat.com> Co-authored-by: cloudbehl <cloudbehl@gmail.com>
/home/pdonnell/ceph/src/osd/OSD.cc: In member function ‘void OSD::ShardedOpWQ::stop_for_fast_shutdown()’:
/home/pdonnell/ceph/src/osd/OSD.cc:11143:41: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
11143 | for (int shard_index = 0; shard_index < osd->num_shards; shard_index++) {
Fixes: https://tracker.ceph.com/issues/62851 Fixes: 210dbd4ff19ea66fd2f0109cc15aad53349be52f Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Adam King [Wed, 27 Sep 2023 19:49:37 +0000 (15:49 -0400)]
cephadm: start ssh.py in cephadmlib
As part of the cephadm refactoring process
to split cephadm into multiple python files,
start "ssh.py" that includes some functions used
for setting up and testing ssh connections,
primarily as part of bootstrap.