Skip to content

cephadm: implement smb daemon core deployment - #54817

Closed
phlogistonjohn wants to merge 9 commits into
ceph:mainfrom
phlogistonjohn:jjm-cephadm-smb-core
Closed

phlogistonjohn wants to merge 9 commits into
ceph:mainfrom
phlogistonjohn:jjm-cephadm-smb-core

Conversation

@phlogistonjohn

@phlogistonjohn phlogistonjohn commented Dec 6, 2023 •

Copy link
Copy Markdown
Contributor

Depends on #54722

Add an incomplete but largely viable SMB/Samba container daemon form
implementation to cephadm. Currently difficult to use as there's no mgr support - but I have tested it by hand rolling some JSON to feed to the ceph _orch deploy command.

See #55068 for some architectural description

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
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
    • Docs to be updated later
  • 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 Dec 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

@github-actions

github-actions Bot commented Jan 5, 2024

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 changed the title [WIP] cephadm: implement smb daemon core deployment cephadm: implement smb daemon core deployment Jan 5, 2024
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@adk3798 adk3798 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still in draft, so not sure if you intended it to be reviewed, but I've done a pass over anyway. Didn't see anything that stuck out as an issue.

Comment on lines 632 to 633

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it we need to do this twice when the arg has no value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a list representing arguments like so:
a1 = ['--foo', '--speed=88', '--location=home', '--enable-flux']

Let's say we want to remove the --speed argument. If so we need to remove it's value too. idx first gets set to the position of an arg starting with --speed if speed is followed by the = OR if we do not expect the argument to have a value (has_value is false). We only need to remove the element at position idx

Thus a1 becomes:

idx = 1
a1 = ['--foo', '--speed=88', '--location=home', '--enable-flux']
del a1[idx]
# idx is now  ['--foo', '--speed=88', '--location=home', '--enable-flux']

Now consider a2:
a2 = ['--foo', '--speed', '88', '--location=home', '--enable-flux']
In this case we actually want to remove --speed and 88 because 88 is the argument to speed but found in a seperate list value.

So therefore:

idx = 2
a2 = ['--foo', '--speed', '88', '--location=home', '--enable-flux']
del a2[idx]
del a2[idx]
# a2 is now ['--foo', '--speed', '--enable-flux']

I will try to add some comments on this to make it clearer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be a lot clearer if I change it to use slices instead. So I'll look into that too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see what you mean. I was only thinking in terms of args using an "=" or that didn't have values at all. I was thinking how you would differentiate between something like --boolean-flag-with-no-value --other-flag and --flag-with-value <value>, but I guess the fact that you're replacing a specific flag that MUST have an = if it has a value (at least the replacement version of it, which is coming from us so can be controlled) then you know beforehand whether the flag will have a value and the issue goes away.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT conatiner -> container

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. (I finally remembered to this this one)

Comment thread src/cephadm/cephadmlib/daemons/smb.py Resolved
Comment thread src/cephadm/cephadmlib/daemons/smb.py Resolved
Comment thread src/cephadm/cephadmlib/daemons/smb.py Outdated
Comment on lines 316 to 337

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to just be setting the /etc/hosts mount that we started doing to avoid name resolution issues caused by podman inserting its own stuff there. It definitely caused issues for things like iscsi and grafana, but not sure for smb.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, plus I don't know if it needs to be replicated for the various sidecars or not.

Comment thread src/cephadm/cephadmlib/daemons/smb.py Resolved
Comment thread src/cephadm/cephadmlib/daemons/smb.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there plans to make this configurable later? Seems the only place this gets set to an actual value that I can find is here where it's set to 6. I don't see it picking this up from the provided json or anything.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This needs to be changed at some point.

@github-actions

Copy link
Copy Markdown

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

Update the type annotations to allow passing pathlib.Path objects to the
makedirs function. All the calls makedirs uses already can accept Path
objects. This causes mypy to accept calling makedirs with a Path
argument and Paths are nice.

Signed-off-by: John Mulligan <[email protected]>
The prepare_data_dir method is a general way for classes to prepare the
data dir (e.g. `/var/lib/ceph/$FSID/$DAEMON_TYPE.$DAEMON_ID`) before
containers will use it.

Signed-off-by: John Mulligan <[email protected]>
Instead of always climbing through an "if ladder" based on daemon type
variables we will have the option of using the common method provided
by container daemon form classes. This will initially be used by the
smb daemon. I don't have the energy to refactor all the existing stuff
at the moment.

Signed-off-by: John Mulligan <[email protected]>
In the future, some sidecar containers will need to share namespaces
with the primary container (or each other). Make it easy to set this up
by creating a enable_shared_namespaces function and Namespace enum.

Signed-off-by: John Mulligan <[email protected]>
Add an incomplete but largely viable SMB/Samba container daemon form
implementation to cephadm. Currently unused but it lays out some of the
basics needed to create smb sharing using samba containers under cephadm
orchestration.

Signed-off-by: John Mulligan <[email protected]>
Enable the use of the SMB container daemon form class by importing, and
thus registering, it. Note that the only way to invoke this feature is
by hand rolling some JSON to feed to the `ceph _orch deploy` command.
Connecting this with the cephadm mgr module is left as a future task.

Signed-off-by: John Mulligan <[email protected]>
The not-a-real-fqdn hostname that the containers got were causing
performance issues joining AD (and running testjoin and winbind).
Define a virtual hostname that can be passed in from the service or
automatically derived from the system's hostname.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

@adk3798 and I discussed this PR today and since the current feedback is largely addressed and that it is fully a subset of #55068 - and that PR has docs and will gain teuthology tests soonish we don't need to keep this separate PR open.

@phlogistonjohn
phlogistonjohn deleted the jjm-cephadm-smb-core branch March 25, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants