-
Notifications
You must be signed in to change notification settings - Fork 13
Add pivot.service as a host API #25
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
Conversation
|
|
|
Ahh yes, the good ol' "forgot to |
|
OK, split the Makefile & spec tweaks in #26 for now. |
|
So, the downside with this approach is that it's trickier for the MCD to keep track of what's happening during pivot. It'd have to do something like:
One thing we could do (if we're going to be writing godbus code anyway) is add a D-Bus interface to We'd still need something like what this patch is doing though for the pivot on first boot case. (In fact, another reason I'm thinking about a D-Bus interface is that this latter case wants |
Eek. I would like to try to do the minimum possible we need to work here right now. So my vote is less good logging and smaller more obviously correct patch. |
|
Maybe one approach for the reboot handling is to have |
|
(I'm not fully against a DBus interface, but I personally don't have much experience implementing them in Go. Actually this doesn't even need to be DBus, we can use whatever other local IPC we want over a socket; there may be more convenient ones? HTTP-over-Unix-socket like Docker is a well known path...) |
Maybe drop the |
|
OK my current thought is to add a Then in the MCD it's just connecting to that unix socket and writing the args. |
|
Hmm, OK one way to make this "synchronous" is we drop the
The same unit can still cover the pivot on first boot path.
Or tweak it slightly: make the Ignition config drop a |
|
I'd like to have |
|
Here's another thought; the MCD can easily ship code to run directly on the host. We just embed whatever binary we want, copy it to the host and |
|
Hmm, yeah that's true. Though the main issue I'm trying to solve here is waiting and error-handling. Doing The |
|
(That's not incompatible in any way with the idea of merging |
|
Oh wow, just realized we're already vendoring this in MCO for the login1 stuff: https://github.com/coreos/go-systemd/blob/master/dbus/methods.go. |
🤔 more while I think it's a nice idea in general actually for this case it wouldn't work because we need this code also for the early-pivot case before we've even pulled down the MCD. And while it's kind of tempting to embed the MCD container in the host by default...let's not go down that road right now. |
OK yep. |
|
OK, I updated this! I still stuck with the systemd approach even though now that the MCD will take care of the initial pivot, I'd like to leave the door open for the ability to pivot immediately on boot before joining the cluster. The service unit here allows us to do this by configuring it from Ignition. |
|
OK, I now rebased this on top of #29. Edited first post with updated commit message. Still testing the MCD path. |
|
OK, this is ready for review now! Successfully tested with openshift/machine-config-operator#335. |
|
Related: openshift/redhat-release-coreos#19 |
|
@jlebon is this ready for updated reviews and possibly merge? |
|
This is now blocked on coreos/rpm-ostree#1732. |
|
OK, this is now ready for final review! Together with openshift/machine-config-operator#335 and coreos/rpm-ostree#1732, I successfully tested a rebase to ootpa. This can go in now, but of course we'll have to wait for a new RHCOS before we actually make use of it in the MCD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two notes/comments, otherwise 👍
Add a new systemd service that simply executes `pivot`. But note that we don't have a `pivot.path` unit to auto-trigger it: this needs to be triggered explicitly by whatever drives pivot. Making it a service and standizing on a path in `/etc` means that we can trigger a pivot on boot from Ignition (patch to preset enable the service is pending), as well as from the MCD by directly starting the unit. Related: openshift/machine-config-operator#314
ashcrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@yuqi-zhang Shortly after this PR a new release will be cut. |
|
Latest RHCOS now includes coreos/rpm-ostree#1732! Let's get this in soon-ish? I'd like to have all this bake for a bit before the end of the week. |
|
Do you know if that rpm-ostree change has also propagated to brew? I'd like to pull this into the new internal build for pivot before end of week as well. |
Not yet. Will either backport or do a new release soon for it! |
|
LGTM |
This is done now. |
|
Thanks for the reviews, merging! |
Add a new systemd service that simply executes
pivot. But note that wedon't have a
pivot.pathunit to auto-trigger it: this needs to betriggered explicitly by whatever drives pivot. Making it a service and
standizing on a path in
/etcmeans that we can trigger a pivot on bootfrom Ignition (patch to preset enable the service is pending), as well
as from the MCD by directly starting the unit.
By running it directly from the host context rather than e.g. directly
by the MCD, we also avoid potential issues with SELinux as described in:
openshift/machine-config-operator#314