Zac Dover [Tue, 15 Aug 2023 03:28:00 +0000 (13:28 +1000)]
doc: improve submodule update command - README.md
Improve the portion of README.md that directs the reader to update the
submodules. Previously, the text assumed that the reader knew that they
should cd into the ceph directory. Now the text is explicit about the
necessity of this action.
Venky Shankar [Mon, 14 Aug 2023 12:22:47 +0000 (17:52 +0530)]
Merge PR #52547 into main
* refs/pull/52547/head:
qa: add test cases for vanilla ops commands
mds: dump locks when printing mutation ops
common/TrackedOp: support overriding the _dump method
mds: remove op field obsoleted by more usable "reqid"
mds: dump metareq_t instead of full op
mds: add lock type to formatter dump of SimpleLock
mds: mark print methods const
mds: drop MDRequestImpl::msg_lock
mds: lock TrackedOp when dumping
mds: avoid recursive locks dumping state
common/TrackedOp: fix race updating description with proper lock
common/Formatter: add support for dumping null
common/Formatter: refactor generating xml name
Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
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>
Yuval Lifshitz [Thu, 22 Jun 2023 09:06:21 +0000 (09:06 +0000)]
rgw/lua: allow metatable fields to be cached
this is by making metatable names fully qualified names
that contain the entire "path" for reaching them and not
just the name of the object they point to.
with the fix, the code would either create a new metatable,
as in this case:
local o1 = Request.Object
-- new metatable is created to represent the Object in Request.Object
local o2 = Request.CopyFrom.Object
-- new metatable (with different upvalues) is created to represent Request.CopyFrom.Object
print(o1.Name)
print(o2.Name)
or, will reuse an existing metatable, as in this case:
local o1 = Request.Object
-- new metatable is created to represent the Object in Request.Object
local o2 = Request.Object
-- reuse the same metatable
print(o1.Name)
print(o2.Name)
Patrick Donnelly [Wed, 26 Jul 2023 17:14:46 +0000 (13:14 -0400)]
common/TrackedOp: support overriding the _dump method
When dumping an op, it may be desirable to alter how it is dumped depending on
which locks are held. As it happens, I plan to dump extra information if the
mds_lock is held!
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Patrick Donnelly [Fri, 21 Jul 2023 16:56:27 +0000 (12:56 -0400)]
mds: lock TrackedOp when dumping
The MDS does not generally bother locking a Mutation before changing
anything so this lock provides weak protection. In any case, try to
improve on that...
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>