rgw: don't use other zone's shard count for forwarded CreateBucket requests
multisite no longer requires shard counts to match between zones. each
zone can configure its own default index shard count, so ignore the shard
counts that come from the metadata master zone
John Mulligan [Fri, 20 Oct 2023 14:52:56 +0000 (10:52 -0400)]
cephadm: move daemon args assignment to a variable
Move the call to _get_daemon_args out of the function call.
This will aid with the next refactoring steps, were the content
of _get_daemon_args will be lifted into get_container.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 20 Oct 2023 14:30:16 +0000 (10:30 -0400)]
cephadm: ensure entrypoint is assigned a string
Ensure that the entrypoint variable is assigned a string. The
custom container class can have None and that can confuse future
refactoring.
The mypy command we're using does not notice this.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 20:25:17 +0000 (16:25 -0400)]
cephadm: make get_daemon_args private
The get_daemon_args function now only has one caller. To double check
that and to prepare for this function's eventual removal we prefix the
name with an underscore to take it private.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 20:22:37 +0000 (16:22 -0400)]
cephadm: use ceph specific get_daemon_args calls
Use the new Ceph class specific get_daemon_args method instead of the
generic get_daemon_args calls that check all sorts of daemon types when
we're running specialized mon containers, which we know for certain are
ceph based.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 18:48:17 +0000 (14:48 -0400)]
cephadm: consolidate if-blocks in get_container function
Instead of having a number of separate if-statement blocks try to
reduce the number of sections so that you can look at one block
and see what the function is doing for that daemon type.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 18:28:46 +0000 (14:28 -0400)]
cephadm: move all pids-limit logic to renamed function
Repurpose set_pids_limit_unlimited as _update_pids_limit, moving the
logic to decide if the daemon should have unlimited pids into the
function. This was the only caller of set_pids_limit_unlimited.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 18:22:49 +0000 (14:22 -0400)]
cephadm: remove get_deployment_container
Remove get_deployment_container replacing all calls to it with calls to
to_deployment_container. Now, callers can inject modifications to the
container object between calls or even have to_deployment_container
update container objects that were constructed in some other way.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 19 Oct 2023 20:33:57 +0000 (16:33 -0400)]
cephadm: fix mistaken call to get_container_mounts_for_type
When this function was refactored two variants were created:
get_container_mounts_for_type and _get_container_mounts_for_type. The
latter doesn't append podman specific mounts so that it can be called
from other functions that do append podman specific mounts.
Unfortunately, I didn't call the correct function from
get_container_mounts and therefore it was redundantly doing the podman
mounts update. This corrects that error.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add Jinja2 and MarkupSafe dependencies to a requirements.txt style file.
This file tracks the dependencies needed to run the cephadm libs
in the unit test framework. The actual dependencies that get added
to the ziapp are managed by build.py but mirrored here.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 17 Jul 2023 13:24:14 +0000 (09:24 -0400)]
cephadm: add more thorough test coverage to unit file generation
Add tests that check the generation of the standard systemd unit
for cephadm services. This test ensures that non trivial changes
to the content of these files are noticed.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adam King [Tue, 10 Oct 2023 18:00:27 +0000 (14:00 -0400)]
cephadm: remove --cleanup-on-failure flag
As discussed in the orch weekly, instead of having the
two flags, we'll just have the --no-cleanup-on-failure
flag on its own. This commit does not change the behavior
at all. It will still do the cleanup if --no-cleanup-on-failure
is not provided and not do the cleanup if it was. This just
removes the additional flag.
John Mulligan [Wed, 1 Nov 2023 22:14:34 +0000 (18:14 -0400)]
cephadm: add tests for build.py script
Add tests that cover the four main distros that ceph is built on (in
the ceph infra). These tests should not be run by automation as they
are slow and have special requirements like a working podman.
Instead, these are provided to be run by a dev when build.py is updated.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 1 Nov 2023 22:14:34 +0000 (18:14 -0400)]
cephadm: update the build.py script to work on multiple distros
Unfortunately, a single simple call to pip does not work on all the
distributions that ceph is built on. In particular, Ubuntu 20.04 and
Ubuntu 22.04 come with pip versions that can not correctly handle
disabling wheels and installing Jinja2 (it tries to use the markupsafe
dependency before it is installed). This can be worked around by using a
virtual env and updating pip before proceeding. However, this is not
enough because CentOS/RHEL 8 uses python 3.6 and there is no version of
pip that supports 3.6 that we can update to that is new enough to fix
the issue with disabling wheels. The workaround in this case is to
install each dependency one at a time through multiple calls to pip.
Because of this extra complexity is it simpler to eschew the use of a
requirements.txt file in build.py entirely. Thus the zipapp is built
using build.py only. Requirements files for cephadm are for setting up
the tox environments *only*.
For completeness a new option is added that gives the caller control
over when build.py uses a virtualenv or not. Thus the build.py script
requires at least one of: a working pip that handles disabling wheels;
or, a virtualenv (venv) and the ability to update to a working version
of pip. If the list of distros ceph supports (and the python versions
they use) ever becomes simpler/newer some of this complexity could be
removed from the build.py script.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 14 Jul 2023 19:41:54 +0000 (15:41 -0400)]
cephadm: disable wheels and C compilers when building cephadm zipapp
We can not rely on any particular python version (py 3.6+ is supported)
and can not assume any particular architecture. So using wheels
based on the build system is pointless. Installing binary .so files
compiled from C/C++ similarly so. Attempt to block the behaviors
when adding dependencies to the zipapp.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adam King [Fri, 29 Sep 2023 20:09:48 +0000 (16:09 -0400)]
qa/cephadm: add teuthology test for host draining
This was a gap in our testing in general, but I'm
adding it here right now specifically to use it
to test the "--rm-crush-entry" flag in a follow
up commit
Adam King [Fri, 29 Sep 2023 18:39:10 +0000 (14:39 -0400)]
mgr/cephadm: add --rm-crush-entry flag to host removal
This will tell cephadm to try and remove the
crush bucket for the host at the end of the host
removal process. If this fails, we still consider the
host as having been successfully remove from
cephadm's POV, but the user will get back an error
message telling them we failed to remove the
host from the crush map
Fixes: https://tracker.ceph.com/issues/63031 Signed-off-by: Adam King <adking@redhat.com>