John Mulligan [Tue, 25 Jul 2023 17:16:13 +0000 (13:16 -0400)]
qa/cephadm: add test case to verify custom container init_containers
Add a 2nd custom container yaml to the test_extra_daemon_features.yaml
file that uses two init containers. Add verification that the init
containers (and primary) ran successfully.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 23 Jun 2023 18:06:45 +0000 (14:06 -0400)]
python-common: add InitContainerSpec type
The InitContainerSpec type will be used to define explicit "init
containers" - containers that are expected to run and then exit
and are executed prior to running a primary container.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 14 Jun 2023 16:01:23 +0000 (12:01 -0400)]
cephadm: add a test case to cover generating init containers
Add a test case that covers the act of setting init_containers in
the deploy config on a custom container instance. This test executes
custom containers that both specify custom volume_mounts and not,
which are expected to "inherit" the volume_mounts of the primary
container's config.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 14 Jun 2023 16:02:20 +0000 (12:02 -0400)]
cephadm: support deploying with explicit init containers
Complete the deployment functions so that any custom containers defined
with "init_containers" will add said init containers to the commands
to be executed.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 14 Jun 2023 16:02:10 +0000 (12:02 -0400)]
cephadm: add get_deployment_init_containers
Add get_deployment_init_containers to extract any init containers from
the deploy configuration context. Currently, all init containers are to
be explicitly defined, not inferred from the service type.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 14 Jun 2023 16:02:00 +0000 (12:02 -0400)]
cephadm: add function to write init container commands
Add functions that write commands to clean up and execute init
containers. These init containers will be executed before the
main container as part of unit.run files (for now).
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 7 Jun 2023 13:46:07 +0000 (09:46 -0400)]
cephadm: add an InitContainer class
Add a new InitContainer class that is similar to CephContainer but
will not assume certain defaults and is expected to run for a "short"
period before exiting. These init containers will be used to preform
tasks before a long running container is started.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Thu, 22 Jun 2023 20:18:03 +0000 (16:18 -0400)]
cephadm: add identity field to CephContainer
Add an optional identity field based on the new DaemonIdentity type
to help name/identify the CephContainers. I would have preferred to make
this field mandatory but there are so many places in the code that
call CephContainer now, I didn't want to have to touch them all at once.
CephContainer objects created using the for_daemon classmethod *will*
all have DaemonIdentity set.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 23 Jun 2023 15:49:57 +0000 (11:49 -0400)]
cephadm: add DaemonIdentity type
It's an extremely common pattern in cephadm to need a triple of
(fsid, daemon_type, daemon_id). These triples are used to generate
various names and paths etc. Add a new type, DaemonIdentity, that
can represent these values in a more convient package. It has an
additional optional field "subcomponent" that can represent a
part of a daemon/service.
It is expected to be used in an immutable manner like a namedtuple,
but I didn't end using a namedtuple because cephadm doesn't make
much use of them and the syntax to combine namedtuple and type hints
is awkward.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 21 Jun 2023 18:08:03 +0000 (14:08 -0400)]
cephadm: move common parts of CephContainer into BasicContainer
Move a bunch of logic out of CephContainer and into BasicContainer.
BasicContainer needs to be more general than CephContainer so it
adds a few parameters that don't exist in CephContainer and
CephContainer will provide defaults for those values.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 21 Jun 2023 18:05:18 +0000 (14:05 -0400)]
cephadm: add BasicContainer stub class
Add a BasicContainer class that will act as a base class for
CephContainer and any future XyzContainer classes. The class
is currently a stub that provides no functionality.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 21:16:08 +0000 (17:16 -0400)]
cephadm: break up deploy_daemon_units into more functions
Break up deploy_daemon_units which had a lot of various "sub-tasks"
implemented within the main body of the function. Splitting up
the function makes each function's scope smaller, more readily testable
and more readable.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 20:48:00 +0000 (16:48 -0400)]
cephadm: refactor _write_container_cmd_to_bash function
Refactor the _write_container_cmd_to_bash such that it now uses a
new _bash_cmd helper function and tries to avoid non-DRY repetition
of the same pattern of shell command expression.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 6 Jun 2023 20:17:57 +0000 (16:17 -0400)]
cephadm: rename argument to container from c
Rename argument to "container" from "c" because a one character
variable at a large function's scope (or anywhere outside of a
comprehension) is a understanding/readability issue (IMO).
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Ville Ojamo [Sat, 5 Aug 2023 05:18:58 +0000 (12:18 +0700)]
doc/radosgw: Improve language and formatting in config-ref.rst
The "Topic persistency settings" section includes convoluted
and incomplete sentences so attempt to improve the
language. The section lacks context so add a link to the
relevant documentation about Notifications.
The "Garbage Collection settings" note includes a sentence
that looks incomplete so try to improve the language.
Don't capitalize "Ops" in "RGW Ops" especially when the
same sentence talks about "op queue" with lower case "o".
Also improve formatting: indentation of a note and wrap
several very long lines.
Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
Casey Bodley [Wed, 28 Jun 2023 21:14:16 +0000 (17:14 -0400)]
rgw: fetch_remote_obj() preserves original part lengths for BlockDecrypt
because multisite replicates multipart objects as a single part, we lose
information about the part sizes from the original manifest that is
necessary to correctly decrypt across those part boundaries
on replication, parse the part lengths out of the source object's
manifest, and store them in a separate RGW_ATTR_CRYPT_PARTS for use on
decryption