libre-server / rolekit

'rolekit' is a daemon for Linux systems providing a stable D-BUS interface to manage the deployment of ​Server Roles.
19 stars 7 forks source link

Role deploy, decommission, etc. needs progress updater #18

Open sgallagher opened 9 years ago

sgallagher commented 9 years ago

We should allow clients to register for a progress update signal so they can see how far along the action has gone.

sgallagher commented 9 years ago

This will also require us to implement job-control for some (most? all) actions in the API. This will be a major, backwards-incompatible change, so we need to plan it carefully,

sgallagher commented 9 years ago

I had some more thoughts on this today. I'd also like to get the opinions of the Cockpit team here (@andreasn, @stefwalter).

  1. We need to implement a full job-control API here, similar to what systemd does, I think. Part of the payload of the job message return should be the object path to two signals, one for monitoring progress, the other being job-completion.
  2. We don't necessarily need to break backwards-compatibility here. We can simply add new routines for deploy_job(), etc and then have the existing deploy() routine internally implement the job mechanism. I'm not certain yet if this will be useful, since I don't know whether anyone is actually consuming the API besides rolectl. We might be able to get away with just breaking API this one time.
  3. The progress-monitoring signal should carry two items in its payload: an optional log message and a mandatory (but non-binding) integer from 1-100 representing approximate completion.
    • Open question: How do we handle log message translation? Should we just return a message ID and provide a separate API call to retrieve the translated version for a requested language?
    • The progress monitoring will have to be best-effort, since not all roles will have many points to plug in and report results. For example, the Domain Controller is almost entirely comprised of launching an external application. We can capture its stdout and return that in the monitoring signal as the log, but we won't realistically be able to update the progress bar value between start and completion. Also, that will be functionally impossible to translate.
sgallagher commented 8 years ago

@andreasn, @stefwalter Ping? I'd like to work out a design here so we can start working on this for Fedora 24.

andreasn commented 8 years ago

Sorry for the delay. Been busy with other stuff. Will look into it.