Skip to content

cephadm: reorganize the remaining container setup methods - #54403

Merged
adk3798 merged 15 commits into
ceph:mainfrom
phlogistonjohn:jjm-cephadm-reorg-ctr-setup-methods
Nov 17, 2023
Merged

adk3798 merged 15 commits into
ceph:mainfrom
phlogistonjohn:jjm-cephadm-reorg-ctr-setup-methods

Conversation

@phlogistonjohn

@phlogistonjohn phlogistonjohn commented Nov 7, 2023 •

Copy link
Copy Markdown
Contributor

Depends on #54399

Continuing on with the refactoring work in #54399 and previous PRs, this series of patches aims to complete the conversion of code for setting up container params (args, env vars, and the like) from chunks of logic in the get_container method to regular (as in regulated) methods tied to the classes that handle the various daemon types. Most of these are simple enough... but of course tracing, monitoring, and ceph are less so.

At the end of this PR the get_container function should still be fairly long but much more pattern based than before. Future PRs will finish up this conversion making get_container based on the common base class & helper methods that do not need to live in cephadm.py [watch this space].

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket refactoring
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@github-actions

github-actions Bot commented Nov 9, 2023

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@phlogistonjohn
phlogistonjohn force-pushed the jjm-cephadm-reorg-ctr-setup-methods branch from c7c8e23 to 94d3b5e Compare November 9, 2023 20:48
@phlogistonjohn
phlogistonjohn force-pushed the jjm-cephadm-reorg-ctr-setup-methods branch from 94d3b5e to c6f8d66 Compare November 11, 2023 13:14
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

Found an issue related to the ceph crash daemon. This will remain 'draft' until I fix it & retest locally.

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 <[email protected]>
Add methods customize_{container,process}_args to the snmp gateway
daemon type class. Use those methods in the get_container function.

Signed-off-by: John Mulligan <[email protected]>
… 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 <[email protected]>
Add method default_entrypoint to the iscsi daemon type class. Use that
method in the get_container function.

Signed-off-by: John Mulligan <[email protected]>
Add method customize_container_args to the nvmeof daemon type class. Use
that method in the get_container function.

Signed-off-by: John Mulligan <[email protected]>
Add methods customize_{container_args,container_envs} to the keepalived
daemon type class. Use those methods in the get_container function.

Signed-off-by: John Mulligan <[email protected]>
Add methods customize_{container_args,process_args} to the haproxy
daemon type class. Use those methods in the get_container function.

Signed-off-by: John Mulligan <[email protected]>
Add methods customize_process_args & default_entrypoint to the ceph
exporter daemon type class. Use those methods in the get_container
function.

Signed-off-by: John Mulligan <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@phlogistonjohn
phlogistonjohn force-pushed the jjm-cephadm-reorg-ctr-setup-methods branch from c6f8d66 to 57b7344 Compare November 14, 2023 21:05
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

I have fixed the issue and rebased.

@phlogistonjohn
phlogistonjohn marked this pull request as ready for review November 14, 2023 21:21
@phlogistonjohn
phlogistonjohn requested a review from a team as a code owner November 14, 2023 21:21
@adk3798

adk3798 commented Nov 17, 2023

Copy link
Copy Markdown
Contributor

@adk3798
adk3798 merged commit c37fd85 into ceph:main Nov 17, 2023
@phlogistonjohn
phlogistonjohn deleted the jjm-cephadm-reorg-ctr-setup-methods branch November 17, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants