John Mulligan [Sun, 5 Nov 2023 17:57:45 +0000 (12:57 -0500)]
cephadm: eliminate the _update_pids_limit function
Eliminate the _update_pids_limit function by moving the logic into the
various daemon type classes `customize_container_args` functions allow
each class to decide if it needs to run with unlimited-pids or not.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:44:48 +0000 (11:44 -0500)]
cephadm: use class methods when setting up ceph based daemon containers
Now that the ceph and ceph exporter classes have all the necessary
methods, rework the get_container function to use those class methods
in a common manner.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 21 Oct 2023 00:18:36 +0000 (20:18 -0400)]
cephadm: add container envs methods to ceph and ceph exporter classes
These, currently unused, methods will be used in a subsequent change to
move logic for setting up containers out of the get_containers function
into the daemon type classes in a common way.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:12:54 +0000 (11:12 -0500)]
cephadm: add methods to ceph daemon type class
Add unused methods to the ceph class in order to prepare for moving
the logic for setting up the various ceph deaemon types to be
handled by the class.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:09:27 +0000 (11:09 -0500)]
cephadm: add more ContainerDeamonForm methods to the monitoring class
Add methods customize_{container_args,process_args} & default_entrypoint
to the monitoring daemon type class. Use those methods in the
get_container function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:00:54 +0000 (11:00 -0500)]
cephadm: add more ContainerDeamonForm methods to the tracing class
Add methods customize_{container_envs,process_args} & default_entrypoint
to the tracing daemon type class. Use those methods in the get_container
function.
This change tries to adapt to, but not fix, the rather strange
set_configuration static method that side-effects the class's(!)
property.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 13:09:10 +0000 (08:09 -0500)]
cephadm: add more ContainerDeamonForm methods to the nfs class
Add methods customize_{container_envs,process_args} & default_entrypoint
to the nfs daemon type class. Use those methods in the get_container
function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 12:18:55 +0000 (07:18 -0500)]
cephadm: add more ContainerDeamonForm methods to the custom container class
Add methods customize_{process_args,container_envs,container_args} and
default_entrypoint to the custom container daemon type class. Use those
methods in the get_container function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 7 Nov 2023 22:57:43 +0000 (17:57 -0500)]
cephadm: update additional container daemon form base class methods
Fix the function signature for the previously added stub
customize_container_args.
Add methods for customize_process_args and customize_container_envs.
The "process args" are args passed to the daemon process / entrypoint.
Container args are passed to the container engine.
Add a default_entrypoint method to return the default entrypoint for
a particular daemon-in-container.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Ramana Raja [Thu, 2 Nov 2023 21:44:10 +0000 (17:44 -0400)]
pybind/mgr: remove __del__() of mgr modules
It's strongly recommended for objects that have references to
external resources (e.g., files) to explicitly release them.
Python doesn't guarantee garbage collection of objects and hence
doesn't guarantee freeing of external resources that occur on
garbage collection.
The __del__() methods in the python mgr modules may not even be
called since garbage collection of objects is not guaranteed in python.
And some of the __del__() methods try to cleanup that seem redundant.
- In volumes/module.py, vc.shutdown() is called in Module.shutdown().
No need to call it again in Module.__del__()
- In telegraf/basesocket.py, BaseSocker.close() is called in
BaseSocket.__exit__(). No need to call it again in
BaseSocket.__del__().
- In mgr_module.py, MgrModuleLoggingMixin._unconfigure_logging() is
called in MgrModule.__init__() and MgrStandbyModule.__init__(). No
need to call it in MgrModule.__del__() and
MgrStandbyModule.__del__().|
- In dashboard/services/cephfs.py, the libcephfs mount is not
shutdown explicitly by the mgr module. However, the cython libcephfs
bindings has a LibCephFS.__dealloc__() finalizer method that calls
LibCephFS.shutdown(). This should unmount and cleanup the ceph mount
handle.
Remove the __del__() of the python mgr modules.
Fixes: https://tracker.ceph.com/issues/63421 Signed-off-by: Ramana Raja <rraja@redhat.com>
Zac Dover [Mon, 13 Nov 2023 10:57:07 +0000 (20:57 +1000)]
doc/rados: format "initial troubleshooting"
Format the steps in the "Initial Troubleshooting" section of
doc/rados/troubleshooting/troubleshooting-mon.rst. A near-future PR (not
this one) will add context to this section and explain that the steps
described here are the first steps that you should undertake when you
determine that you have an unresponsive or down Monitor. This PR is
merely for formatting.
The operation's id and future returned when starting SnapTrimObjSubEvent
is emplaced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed `op` to go out of scope and lose all its references
(and get deleted) before exiting.
Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.
Zac Dover [Sun, 12 Nov 2023 10:52:09 +0000 (20:52 +1000)]
doc/rados: parallelize t-mon headings
Give parallel structure to the questions in the Q&A section of the "The
Cluster Has Quorum But At Least One Monitor Is Down" subsection of the
"Most Common Monitor Issues" section of
doc/rados/troubleshooting/troubleshooting-mon.rst.
Zac Dover [Sun, 12 Nov 2023 10:21:41 +0000 (20:21 +1000)]
doc/config: edit "ceph-conf.rst"
Edit the first section of doc/rados/configuration/ceph-conf.rst.
Initially I just wanted to change "series" to "set", but once I got my
hands dirty I ended up simplifying some sentences.
John Mulligan [Sat, 4 Nov 2023 23:41:25 +0000 (19:41 -0400)]
cephadm: change ceph & exporter to customize_container_mounts method
Unlike the other types Ceph and CephExporter share the underlying
method. There was no other use of get_container_mounts on the class
so it could be converted to be customize_container_mounts.
Because there's an extra arg that passes from get_container_mounts
top-level function to Ceph.get_ceph_mounts, that function was not
changed.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 4 Nov 2023 22:39:07 +0000 (18:39 -0400)]
cephadm: move volume mounts assignment to a variable
Move the call to get_container_mounts out of the function call block.
This will aid with the next refactoring steps, so that the uses
of get_container_mounts can be brought into the get_container call
directly.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
As part of the Zipper project generic back-end code is being teased
apart from rados-specific back-end code. This is a work in progress,
so currently generic code and other subclasses of StoreDriver (and
related high-level classes) depend on the rados-specific declarations.
Some of these dependencies are not always obvious since
src/rgw/driver/rados was put on the include path. That is now removed,
so any includes needing files from that subclass have to give a more
fully specified path.
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
John Mulligan [Fri, 20 Oct 2023 18:22:40 +0000 (14:22 -0400)]
cephadm: convert get_container_binds to use class based approach
Since all types affected by get_container_binds now have the common
customize_container_binds, use a generic class-based approach by
creating an instance of ContainerDaemonForm and calling the method.
All other classes have a customize_container_binds that is a no-op.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 20 Oct 2023 17:56:31 +0000 (13:56 -0400)]
cephadm: only call get_container_binds on types that have binds
This is a step towards not calling get_container_binds in get_container.
A future commit will replace uses of get_container_binds with direct
uses of common class methods.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 20 Oct 2023 17:49:50 +0000 (13:49 -0400)]
cephadm: move bind mounts assignment to a variable
Move the call to get_container_binds out of the function call.
This will aid with the next refactoring steps, so that the uses
of get_container_binds can be brought into the get_container call
directly.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 4 Nov 2023 20:59:33 +0000 (16:59 -0400)]
cephadm: always pass ctx to customize_container_{binds,mounts}
These functions often derive the binds and/or mounts from the context
variable. Thus we should have the base class method accept the context.
Not all subclassess will use it but it will be there for those that do.
Also, fix the type for customize_container_mounts - it should be a dict
not a list.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adam King [Mon, 6 Nov 2023 16:19:09 +0000 (11:19 -0500)]
qa/cephadm: adjust host drain test to handle explicit placement warning
Since we're adding a warning if any host is listed explicitly
in the placement of any service when removing the host,
we need to adjust the host drain test that removes a host
without the --force flag to not have the explicit hostname
in the placement for the mon service.
and then you run `ceph orch host drain host3`, cephadm will remove
the daemon from that host and the placement would now match nothing.
This is definitely an issue that should be able to be bypassed as
it generally isn't serious, but it would be good to let users
know they have the host listed explicitly in placements like this
when they want to drain it.
Fixes: https://tracker.ceph.com/issues/63220 Signed-off-by: Adam King <adking@redhat.com>