Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split microovn.central service. #83

Merged
merged 6 commits into from
Oct 20, 2023
Merged

Conversation

mkalcok
Copy link
Contributor

@mkalcok mkalcok commented Oct 19, 2023

Previously microovn.central started all three central services (ovn-nb, ovn-sb and northd). Now these daemons are split into their own services for more fine-grained controll over them.

The microovn.central will stay for now and act as an umbrella service that can trigger start of all three services. However the usage is discouraged as it will be removed. It's also not capable of being used as shortcut for stopping these services.

Additional consequence of splitting of the services is that we can now scale the cluster without restarting OVN NB/SB services as only the northd daemon needs restart.

Copy link
Member

@fnordahl fnordahl left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on this, avoiding unnecessary restarts of the DB servers is a huge boon for microovn!

microovn/ovn/bootstrap.go Show resolved Hide resolved
microovn/ovn/bootstrap.go Outdated Show resolved Hide resolved
microovn/ovn/bootstrap.go Outdated Show resolved Hide resolved
microovn/ovn/join.go Show resolved Hide resolved
snapcraft/commands/central.start Outdated Show resolved Hide resolved
snapcraft/commands/ovn-northd.start Outdated Show resolved Hide resolved
snapcraft/ovn-central.env Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

I'm looking forward to this landing :)

Copy link

@pmatulis pmatulis left a comment

Choose a reason for hiding this comment

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

Thanks for this. See change requests.

I would normally expect to see a significant doc change like this as a separate PR with a separate Jira card.

docs/reference/index.rst Outdated Show resolved Hide resolved
@@ -0,0 +1,63 @@
=================
MicroOVN Services

Choose a reason for hiding this comment

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

s/Services/services

docs/reference/index.rst Show resolved Hide resolved
docs/reference/services.rst Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
docs/reference/services.rst Outdated Show resolved Hide resolved
@mkalcok
Copy link
Contributor Author

mkalcok commented Oct 19, 2023

Thank you for extensive review @fnordahl @pmatulis . I believe I addressed all the comments.

I would normally expect to see a significant doc change like this as a separate PR

The need for this documentation was created directly by code changes in this PR. We split the microovn.central service but retained it (for some underlying technical reasons) which, imo, created a bit of an ambiguity. That's why we decided to include also this documentation piece that would explain the purpose of each service exposed by the MicroOVN snap.

What I should've done though is to make a separate commit for the doc change for easier review.

@mkalcok mkalcok requested review from fnordahl and pmatulis October 19, 2023 21:19
Copy link

@pmatulis pmatulis left a comment

Choose a reason for hiding this comment

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

Sorry, a few last things


* ``microovn.ovn-ovsdb-server-nb``
* ``microovn.ovn-ovsdb-server-sb``
* ``microovn.ovn-northd``.

Choose a reason for hiding this comment

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

extra dot

MicroOVN services
=================

This page presents a list of all MicroOVN services. The descriptions presented

Choose a reason for hiding this comment

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

apologies, my fault here:

s/The descriptions presented here is/Their descriptions are/

Copy link
Member

@fnordahl fnordahl left a comment

Choose a reason for hiding this comment

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

I took this for a spin and tested both refresh, fresh install and post configuration reboots, looks great.

The commit messages may need updating to reflect changes during review.

I also have a couple of comments in-line that request splitting a couple of things into separate commits.

Comment on lines -15 to -20
# Disable some commands
mkdir -p "${OVN_RUNDIR}/bin/"
for i in install plymouth sudo systemctl; do
[ -e "${OVN_RUNDIR}/bin/${i}" ] && continue

ln -s "/bin/true" "${OVN_RUNDIR}/bin/${i}"
Copy link
Member

Choose a reason for hiding this comment

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

Good riddance!

However, I see these are also in snapcraft/commands/chassis.start and snapcraft/commands/switch.start.

Would it be more consistent to drop all of these simultaneously in a separate parent commit?

For the record, there are now some additional DENIED messages logged, but they do not affect operation.

[  101.595042] audit: type=1400 audit(1697770466.057:241): apparmor="DENIED" operation="exec" profile="snap.microovn.ovn-ovsdb-server-nb" name="/usr/bin/systemctl" pid=2804 comm="ovn-ctl" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[  101.595086] audit: type=1400 audit(1697770466.057:242): apparmor="DENIED" operation="exec" profile="snap.microovn.ovn-ovsdb-server-nb" name="/usr/bin/systemctl" pid=2804 comm="ovn-ctl" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[  101.596966] audit: type=1400 audit(1697770466.061:243): apparmor="DENIED" operation="exec" profile="snap.microovn.ovn-ovsdb-server-nb" name="/usr/bin/plymouth" pid=2806 comm="ovn-ctl" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[  101.597023] audit: type=1400 audit(1697770466.061:244): apparmor="DENIED" operation="exec" profile="snap.microovn.ovn-ovsdb-server-nb" name="/usr/bin/plymouth" pid=2806 comm="ovn-ctl" requested_mask="x" denied_mask="x" fsuid=0 ouid=0

Even without this change there are still other unhandled DENIED rules logged, such as:

[  101.599507] audit: type=1400 audit(1697770466.065:245): apparmor="DENIED" operation="capable" profile="snap.microovn.switch" pid=2787 comm="ovsdb-server" capability=38  capname="perfmon"

So I still think we should still drop these hacks and figure out what indirect dependencies of the OVS/OVN ctl scripts end up calling the offending binaries and provide patches upstream at some point in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I'll drop those instances too. The commands do not work anyway, it's better to have the failures logged rather than silently failing.

docs/how-to/tls.rst Show resolved Hide resolved
These commands do not work within the snap context but to figure out
how to properly fix this we need to stop masking them as `/bin/true`
so the apparmor violations can be logged.

Signed-off-by: Martin Kalcok <[email protected]>
Previously `microovn.central` started all three central services (
`microovn.ovn-ovsdb-server-nb`, `microovn.ovn-ovsdb-server-sb` and
`microovn.ovn-northd`). Now these daemons are split into their own services
for more fine-grained controll over them.

The `microovn.central` will stay for now and act as an transitional service
that can trigger start of all three services. However the usage is discouraged
as it will be removed. It's also not capable of being used as shortcut for
stopping these services.

Additional benefits of splitting of the services is that we can now scale
the cluster without restarting OVN NB/SB services as only the northd daemon
needs restart.

Signed-off-by: Martin Kalcok <[email protected]>
sha256sum doesn't work properly if string passed for hashing starts with "-".
Since pubkeys start exactly with these characters, pipe them instead via STDIN

Signed-off-by: Martin Kalcok <[email protected]>
The specific test suit in this general Make target was likely introduced
unintentionally.

Signed-off-by: Martin Kalcok <[email protected]>
Signed-off-by: Martin Kalcok <[email protected]>
@mkalcok
Copy link
Contributor Author

mkalcok commented Oct 20, 2023

Thanks again for the review. I incorporated your comments and I separated the docs and the command masking removal into separate commits.

Copy link
Member

@fnordahl fnordahl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fnordahl fnordahl dismissed pmatulis’s stale review October 20, 2023 06:26

I have confirmed that the latest update addresses the comments left in this review, and in the interest of time we'll proceed.

@fnordahl fnordahl merged commit 0d9f525 into canonical:main Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants