-
Notifications
You must be signed in to change notification settings - Fork 198
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
Strengthen notion of "update driver" in rpm-ostree status
#1747
Comments
seems like a good idea but it would be cool if the lines could link us to where we could find more information on the controlling update client.. The suggestion I would make here is to mention the systemd unit that controls that client:
|
A lot of interesting design questions there.
Hm...yeah, I kind of like the low-tech approach of a file in |
Prior art from locksmith: https://github.com/coreos/locksmith/blob/master/pkg/coordinatorconf/conf.go |
Expanding some details from my previous comment. Depending on the usecase here, I think we have two options on the low-tech static side:
In both cases, the protocol dictated by rpm-ostree should cover the location of such file and well-known key names. |
If I'm understanding this, you're suggesting the "agent" script write to some environment file referenced in I like the idea of a simple JSON format. E.g. something like: # /run/rpm-ostree/agent.json
{
"name": "Cincinnati Client",
"status": "waiting for permission to reboot",
"unit": "cincinnati-client.service"
} Hmm, another slightly less low-tech idea is to leverage the journal since we're already using that a bit. Dictate a msg id, and look for it. One advantage of this is that it's probably something the agents would want to do anyway (logging to the journal), and we transparently get a message, the unit name in charge of the agent, and a timestamp, so we can print e.g.
And then a key in |
@jlebon the latter. rpm-ostreed can read it directly (on-request every time, or periodically cached), but having in env-file format makes it easy for other script/units to source directly. On the other hand, JSON is a better data-interchange format (also my preference) but can't be directly shell-sourced, in case we cared for that. |
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: coreos#1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: coreos#1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: coreos#1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: coreos#1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: coreos#1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Pre-FCOS we made an effort for automatic updates but nowadays with Fedora CoreOS we generally expect people to be using zincati. Until we fix the "agent registration" problem: #1747 Let's not confuse people by printing `AutomaticUpdates: disabled`. Only print if it's set to a value in non-verbose mode.
Should probably tag @kalev here since this affects GNOME Software too. |
Thoughts on the journal entry idea in #1747 (comment)? One thing that I really like from it is that it implicitly exports the description, name, and status of the unit handling updates. ISTM it also feels more natural from the app's POV rather continuously updating a JSON file. |
I don't have a strong opinion either way. I'd be happy to implement what's needed on gnome-software side though to support this. |
@jlebon that's an interesting approach. Is your plan to only consider the most recent journal entry with a well-known message-id? Do you want to detect/react if there happen to be multiple conflicting drivers? |
I hadn't fully thought it through, but yes I think so.
We discussed this in video chat too, but just to write it down. I think we could detect this to be nice. Probably the most obvious thing to detect is whether rpm-ostree's automatic updates feature itself is turned on and an external update driver is detected (maybe just the |
Related to coreos#1747 Basically after this we can have `rpm-ostree status` output e.g. `Agent: zincati` at least *after* an upgrade has happened.
Related to coreos#1747 Basically after this we can have `rpm-ostree status` output e.g. `Agent: zincati` at least *after* an upgrade has happened.
Related to #1747 Basically after this we can have `rpm-ostree status` output e.g. `Agent: zincati` at least *after* an upgrade has happened.
Also on board with using the one-shot journal entry to claim "ownership" and let everything else be communicated through systemd unit state. |
Right, something I forgot is that zincati won't ask rpm-ostree to update until it knows there is one, whereas e.g. gnome-software defers to rpm-ostree directly. We could add a simple One concern I have with parsing journal entries is access control; any process on the system can log a journal message. We can't filter for |
Hmm, that implies the daemon is always running, no?
Yeah, good point. Though it's mostly informational, not something rpm-ostree really needs to act upon. Also, we use the journal to get to the systemd service. So at least it's a process that has to be able to create and start a systemd service. |
Which daemon? Either way I think we'd serialize this claim rpm-ostree side into say
Not sure what you mean; any process can log a journal message. |
rpm-ostreed. Or right exactly, we'd have to serialize it somewhere.
We would ignore the message if it's for a systemd service which doesn't exist. But again, note this is all informational. We also already print journal messages in Can you describe what the concern is? Adding a D-Bus API for this feels like overengineering at this point (also Zincati today doesn't use D-Bus, so we'd have to also add a CLI entrypoint for this). If we want to do things other than just displaying to the user, then yeah a new API which requires privileges seems warranted. |
Every process is running under some systemd unit. Now we could restrict things to e.g.
Yes, but it's fairly important information and confusing an admin about updates seems bad.
We should have strong journal source checks, see e.g.: |
I wouldn't call it overengineering; it'd involve some boilerplate C/C++ code but that's not really hard, neither is proxying it to a CLI. On a thread very related to this; a while ago in the MCO I tried to use the systemd journal to log why reboots were being initiated, and it had the same problem of needing to filter by privileged processes. A good way to think about this is that we're using the journal as IPC - much like if one has two processes where one reads from a file and the other writes it, you have all the usual concerns about access control/ownership etc. |
Sure OK, new D-Bus API WFM. |
For what it's worth, I also think new D-Bus API sounds cleaner :) |
In coreos#2395, agent's id is recorded in the journal. Similarly, record the systemd service that called the client, as well. Related to coreos#1747.
In coreos#2395, agent's id is recorded in the journal. Similarly, record the systemd service that called the client, as well. Related to coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
In coreos#2395, agent's id is recorded in the journal. Similarly, record the systemd service that called the client, as well. Related to coreos#1747.
In coreos#2395, agent's id is recorded in the journal. Similarly, record the systemd service that called the client, as well. Related to coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the agent id and agent systemd unit and serialize it into a JSON file at `/run/rpmostree/update-driver.json`. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the calling agent's systemd unit and serialize it into a g-variant file at `/run/rpmostree/update-driver.gv`, along with the human-readable name of the update driver provided as a string argument. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the calling agent's systemd unit and serialize it into a g-variant file at `/run/rpmostree/update-driver.gv`, along with the human-readable name of the update driver provided as a string argument. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the calling agent's systemd unit and serialize it into a g-variant file at `/run/rpmostree/update-driver.gv`, along with the human-readable name of the update driver provided as a string argument. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the calling agent's systemd unit and serialize it into a g-variant file at `/run/rpmostree/update-driver.gv`, along with the human-readable name of the update driver provided as a string argument. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes coreos#1747.
Record the calling agent's systemd unit and serialize it into a g-variant file at `/run/rpmostree/update-driver.gv`, along with the human-readable name of the update driver provided as a string argument. Also add the companion `--register-driver` option to the `deploy` CLI argument. Closes #1747.
This is kinda similar to #1406, but taking the idea further. In some downstream distributions, we want rpm-ostree updates to be driven by a separate client. E.g. in FCOS, we're discussing an agent that talks to rpm-ostree for downloading, applying, and rebooting into updates. Similarly, this could be used in Silverblue by GNOME Software when automatic updates are turned on.
In such cases, users will likely still be interacting with rpm-ostree directly, e.g. for package layering, rolling back, etc... Rather than having downstream users wrap
status
and confusing users with two CLIs, we should establish an interface by which rpm-ostree can extract information about the state of the update driver and display it instatus
. E.g. something like:Or:
We could have that data come out of a file in
/run
or something, or a helper script in/etc/rpm-ostreed.conf
we run and paste its output directly in there.The text was updated successfully, but these errors were encountered: