-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
Comments and clarifications requested.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
Cheers,
Stef
On Fri, 2014-06-20 at 12:35 +0200, Stef Walter wrote:
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
The reason for this awkward command is that we know the list of services to start only by querying the LDAP server (which needs to start first of course), and then apparently we cannot change the list of services easily/reliably anymore as the process of starting IPA is already started, and changing unit files on the fly is not something systemd picks up :) If someone has a good idea on how to start DS, pull the service list, reconfigure systemd (if necessary) and be able to keep the process going on reliably I am all ears :)
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
I had the same question...
Simo.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/20/2014 06:35 AM, Stef Walter wrote:
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
Yes and no. I'm fully aware of the FreeIPA special-case. In that situation, we just need to do "Wants=ipa.service" and trust that this service will start and stop the sub-services appropriately (as FreeIPA currently does).
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
If the deployment fails, the rolekit API will be back in the "Nascent" state and will have error data available as an attribute on the Role object. So Cockpit will be able to monitor for the D-BUS signal for the error attribute changing and use that data as feedback to the UI.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 20.06.2014 14:46, Stephen Gallagher wrote:
On 06/20/2014 06:35 AM, Stef Walter wrote:
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
Yes and no. I'm fully aware of the FreeIPA special-case. In that situation, we just need to do "Wants=ipa.service" and trust that this service will start and stop the sub-services appropriately (as FreeIPA currently does).
This is unfortunate when it comes to building Server Roles into Cockpit. Why is the service information in LDAP?
But anyway, I guess the key question that needs to be answered is:
* How can Cockpit enumerate the services that comprise a role?
That's a basic building block that we'll need in order to implement roles in Cockpit.
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
If the deployment fails, the rolekit API will be back in the "Nascent" state and will have error data available as an attribute on the Role object. So Cockpit will be able to monitor for the D-BUS signal for the error attribute changing and use that data as feedback to the UI.
So thinking ahead here, if Cockpit were to use such a configuration scheme ... we would need the following:
* Precise information about which part of the configuration caused the failure, perhaps some sort of property name/identifier. * Translated or translatable messages about the failure. * Textual (and ideally translatable or translated) progress information as the Role is being deployed (ie: the same output you get from ipa-server-install).
Obviously the above list is incomplete.
Cheers,
Stef
On Fri, 2014-06-20 at 20:31 +0200, Stef Walter wrote:
On 20.06.2014 14:46, Stephen Gallagher wrote:
On 06/20/2014 06:35 AM, Stef Walter wrote:
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
Yes and no. I'm fully aware of the FreeIPA special-case. In that situation, we just need to do "Wants=ipa.service" and trust that this service will start and stop the sub-services appropriately (as FreeIPA currently does).
This is unfortunate when it comes to building Server Roles into Cockpit. Why is the service information in LDAP?
Because FreeIPA is a distributed system, and an admin can, first of all, see immediately what services are enabled on any server of the infrastructure w/o having to log in on each of them. The admin can also turn off a service by accessing any server, and switching it in LDAP, when the affected ipa server restarts, that service does not (or vice versa). (we haven't wired an action in LDAP to trigger a service start/stop on the system yet, but it may be something we want to do in the future).
But anyway, I guess the key question that needs to be answered is:
- How can Cockpit enumerate the services that comprise a role?
That's a basic building block that we'll need in order to implement roles in Cockpit.
Why do you care exactly what services are enabled ? I haven't read anything about providing a list of (sub)services from the Roles but certainly that can be added if it is beneficial.
For IPA I guess for now all you can really do is parse ipactl status or read via LDAP, not great ways, but then so far IPA does not have any dbus at all ..
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
If the deployment fails, the rolekit API will be back in the "Nascent" state and will have error data available as an attribute on the Role object. So Cockpit will be able to monitor for the D-BUS signal for the error attribute changing and use that data as feedback to the UI.
So thinking ahead here, if Cockpit were to use such a configuration scheme ... we would need the following:
- Precise information about which part of the configuration caused the failure, perhaps some sort of property name/identifier.
- Translated or translatable messages about the failure.
- Textual (and ideally translatable or translated) progress information as the Role is being deployed (ie: the same output you get from ipa-server-install).
Obviously the above list is incomplete.
I am not sure I can give you the first 2 easily, the latter is a lot of output, is the quantity/format important ?
Simo.
On 20.06.2014 20:47, Simo Sorce wrote:
On Fri, 2014-06-20 at 20:31 +0200, Stef Walter wrote:
On 20.06.2014 14:46, Stephen Gallagher wrote:
On 06/20/2014 06:35 AM, Stef Walter wrote:
On 19.06.2014 16:43, Stephen Gallagher wrote:
I've finally gotten around to putting together my thoughts on how (at a high level) the roles should be implemented. NOTE: this is specifically about the Roles as a concept, not the implementation of the logic within the roles, except for a couple restrictions I make on input and output format.
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
I like the use of targets a lot. This really fits in well with how we use systemd in Cockpit.
But is it required that all services that comprise the role be listed in "Wants"?
For example for IPA, Cockpit has no way to track which units/cgroups are part of the IPA role, and representing them. That's because there's this awkward ipa.service middleman which runs systemd commands on its own instead of declaring dependencies for systemd.
Yes and no. I'm fully aware of the FreeIPA special-case. In that situation, we just need to do "Wants=ipa.service" and trust that this service will start and stop the sub-services appropriately (as FreeIPA currently does).
This is unfortunate when it comes to building Server Roles into Cockpit. Why is the service information in LDAP?
Because FreeIPA is a distributed system, and an admin can, first of all, see immediately what services are enabled on any server of the infrastructure w/o having to log in on each of them. The admin can also turn off a service by accessing any server, and switching it in LDAP, when the affected ipa server restarts, that service does not (or vice versa). (we haven't wired an action in LDAP to trigger a service start/stop on the system yet, but it may be something we want to do in the future).
But anyway, I guess the key question that needs to be answered is:
- How can Cockpit enumerate the services that comprise a role?
That's a basic building block that we'll need in order to implement roles in Cockpit.
Why do you care exactly what services are enabled ? I haven't read anything about providing a list of (sub)services from the Roles but certainly that can be added if it is beneficial.
Because we deeply care about:
* Resource information (cgroups) * Journal information (units/services) * The state of all services in a role (via systemd)
And more. A Role shouldn't just be running wild and free on a system. We need to be able to identify what is part of that role and what is not.
Yes, another way to do this would be containers. But service information for a role is the bare minimum.
For IPA I guess for now all you can really do is parse ipactl status or read via LDAP, not great ways, but then so far IPA does not have any dbus at all ..
I will be the first to admit that the "First-Boot Configuration" approach is a bit of a hack, but it's a hack that will work regardless of installation during anaconda or a live system (it defers the configuration step to a systemd unit that runs just prior to the first start-up of the role). The implication here is strong: while the UI that prepares the configuration may be interactive, the content fed into rolekit is non-interactive.
So is there room for the UI to try to setup a role configuration and ask the user for changes if the the configuration fails? This is pretty key to building a good UI. Or are UIs like Cockpit expected not to use a separate configuration mechanism?
If the deployment fails, the rolekit API will be back in the "Nascent" state and will have error data available as an attribute on the Role object. So Cockpit will be able to monitor for the D-BUS signal for the error attribute changing and use that data as feedback to the UI.
So thinking ahead here, if Cockpit were to use such a configuration scheme ... we would need the following:
- Precise information about which part of the configuration caused the failure, perhaps some sort of property name/identifier.
- Translated or translatable messages about the failure.
- Textual (and ideally translatable or translated) progress information as the Role is being deployed (ie: the same output you get from ipa-server-install).
Obviously the above list is incomplete.
I am not sure I can give you the first 2 easily, the latter is a lot of output, is the quantity/format important ?
Yes, I think so. We should come up with something standard and useful here. But more to the point, just staring at a spinning cursor for 10 minutes while IPA is doing something, isn't a good UI.
Stef
Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher sgallagh@redhat.com:
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
The targets are named fedora-*, but the directory is /etc/server-role (no fedora); should this be consistent? “Stop wasting our time” is a perfectly acceptable answer :) If we did want this unified, I’d slightly prefer a fedora-less naming (to make this easier on both derived and non-derived distributions).
If we go the route of configuration on first boot, we need to be sure the error handling is workable: unlike simply running a script at (role deploy) time, which can just write to stderr and (exit 1), this is not quite as automatic. How will rolekit find out that the configuration step failed, and why? Perhaps “rolekit would check the status of the unit” (when/triggered by what?), and “the unit must write sufficient information to journal *associated with the unit*”?
Tangentially, I’d like the configuration submitted to rolekit (/etc/server-roles/setup/$ROLENAME.config) archived on the system post-deploy, to make “throw away local modifications and redeploy” or “what changed on the system since role deployment?” possible. That’s fairly independent from the role packaging spec, though—rolekit can be saving these anywhere else than /etc/server-roles/setup and the roles don’t need to know about the existence of the archive. Mirek
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/26/2014 02:59 PM, Miloslav Trmač wrote:
Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com>:
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
The targets are named fedora-*, but the directory is /etc/server-role (no fedora); should this be consistent? “Stop wasting our time” is a perfectly acceptable answer :) If we did want this unified, I’d slightly prefer a fedora-less naming (to make this easier on both derived and non-derived distributions).
My intention there was to make the design non-fedora-specific, but make it clear that the roles we're installing are clearly for Fedora and probably won't work on other platforms without modification.
If we go the route of configuration on first boot, we need to be sure the error handling is workable: unlike simply running a script at (role deploy) time, which can just write to stderr and (exit 1), this is not quite as automatic. How will rolekit find out that the configuration step failed, and why? Perhaps “rolekit would check the status of the unit” (when/triggered by what?), and “the unit must write sufficient information to journal /associated with the unit/”?
My intention is that all of the roles' first-start scripts will have to be After=rolekit.service so that as part of their output they will have to signal rolekit about success or failure and can carry a payload with their error details.
I've also been toying with the idea that we should require roles to include a journald messageid specific to the role, to make it easier to track the logs all the way through. This won't be an F21 target, as I need to talk to the journald devs about whether there's any way to get journald to add a messageid automatically to messages generated by any descendent of a unit (or just track them all the way through). I suspect this isn't available today.
Tangentially, I’d like the configuration submitted to rolekit (/etc/server-roles/setup/$ROLENAME.config) archived on the system post-deploy, to make “throw away local modifications and redeploy” or “what changed on the system since role deployment?” possible. That’s fairly independent from the role packaging spec, though—rolekit can be saving these anywhere else than /etc/server-roles/setup and the roles don’t need to know about the existence of the archive.
Well, this information will have to be fully-recoverable from the API. So yes, it's implicit that this file's content will be stored and retrievable, though we'll probably do so in a way that's more "regenerate with identical values" and less "copy the exact file somewhere".
2014-06-27 17:25 GMT+02:00 Stephen Gallagher sgallagh@redhat.com:
On 06/26/2014 02:59 PM, Miloslav Trmač wrote:
Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com>:
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
The targets are named fedora-*, but the directory is /etc/server-role (no fedora); should this be consistent?
My intention there was to make the design non-fedora-specific, but make it clear that the roles we're installing are clearly for Fedora and probably won't work on other platforms without modification.
Makes sense.
I've also been toying with the idea that we should require roles to
include a journald messageid specific to the role, to make it easier to track the logs all the way through. This won't be an F21 target, as I need to talk to the journald devs about whether there's any way to get journald to add a messageid automatically to messages generated by any descendent of a unit (or just track them all the way through). I suspect this isn't available today.
We don’t strictly need that: the role API gives anyone the set of relevant units, and we can ask for all journal messages associated with an unit (which, true, wouldn’t be exactly instantaneous). (Using the same messageid for many different kinds of messages just to record an association seems like kind of an abuse of the concept :) )
Tangentially, I’d like the configuration submitted to rolekit
(/etc/server-roles/setup/$ROLENAME.config) archived on the system post-deploy, to make “throw away local modifications and redeploy” or “what changed on the system since role deployment?” possible. That’s fairly independent from the role packaging spec, though—rolekit can be saving these anywhere else than /etc/server-roles/setup and the roles don’t need to know about the existence of the archive.
Well, this information will have to be fully-recoverable from the API. So yes, it's implicit that this file's content will be stored and retrievable.
Ah, of course. I should have thought of that. Mirek
On 27.06.2014 17:30, Miloslav Trmač wrote:
2014-06-27 17:25 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com>:
On 06/26/2014 02:59 PM, Miloslav Trmač wrote: > Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher > <sgallagh@redhat.com <mailto:sgallagh@redhat.com> <mailto:sgallagh@redhat.com <mailto:sgallagh@redhat.com>>>: > > Please see the design page I've written at > https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and > comment on it here. > > The targets are named fedora-*, but the directory is > /etc/server-role (no fedora); should this be consistent? My intention there was to make the design non-fedora-specific, but make it clear that the roles we're installing are clearly for Fedora and probably won't work on other platforms without modification.
Makes sense.
I've also been toying with the idea that we should require roles to include a journald messageid specific to the role, to make it easier to track the logs all the way through. This won't be an F21 target, as I need to talk to the journald devs about whether there's any way to get journald to add a messageid automatically to messages generated by any descendent of a unit (or just track them all the way through). I suspect this isn't available today.
We don’t strictly need that: the role API gives anyone the set of relevant units, and we can ask for all journal messages associated with an unit (which, true, wouldn’t be exactly instantaneous). (Using the same messageid for many different kinds of messages just to record an association seems like kind of an abuse of the concept :) )
Yes, just to confirm, that's what we would do in Cockpit.
The only hurdle here is that roles like IPA don't (yet) allow us to detect which units belong to their role. I believe Simo said it was possible to remedy that somehow?
Stef
On 06/30/2014 01:48 PM, Stef Walter wrote:
On 27.06.2014 17:30, Miloslav Trmač wrote:
2014-06-27 17:25 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com>:
On 06/26/2014 02:59 PM, Miloslav Trmač wrote: > Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher > <sgallagh@redhat.com <mailto:sgallagh@redhat.com> <mailto:sgallagh@redhat.com <mailto:sgallagh@redhat.com>>>: > > Please see the design page I've written at > https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and > comment on it here. > > The targets are named fedora-*, but the directory is > /etc/server-role (no fedora); should this be consistent?
Why not /etc/rolekit/roles?
Then it is more obvious that it is for and used by rolekit.
My intention there was to make the design non-fedora-specific, but make it clear that the roles we're installing are clearly for Fedora and probably won't work on other platforms without modification.
Makes sense.
I've also been toying with the idea that we should require roles to include a journald messageid specific to the role, to make it easier to track the logs all the way through. This won't be an F21 target, as I need to talk to the journald devs about whether there's any way to get journald to add a messageid automatically to messages generated by any descendent of a unit (or just track them all the way through). I suspect this isn't available today.
We don’t strictly need that: the role API gives anyone the set of relevant units, and we can ask for all journal messages associated with an unit (which, true, wouldn’t be exactly instantaneous). (Using the same messageid for many different kinds of messages just to record an association seems like kind of an abuse of the concept :) )
Yes, just to confirm, that's what we would do in Cockpit.
The only hurdle here is that roles like IPA don't (yet) allow us to detect which units belong to their role. I believe Simo said it was possible to remedy that somehow?
Stef
server mailing list server@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/server
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/30/2014 08:15 AM, Thomas Woerner wrote:
On 06/30/2014 01:48 PM, Stef Walter wrote:
On 27.06.2014 17:30, Miloslav Trmač wrote:
2014-06-27 17:25 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com>:
On 06/26/2014 02:59 PM, Miloslav Trmač wrote:
Hello, 2014-06-19 16:43 GMT+02:00 Stephen Gallagher <sgallagh@redhat.com mailto:sgallagh@redhat.com
<mailto:sgallagh@redhat.com mailto:sgallagh@redhat.com>>:
Please see the design page I've written at https://fedorahosted.org/rolekit/wiki/Design/RolePackaging and comment on it here.
The targets are named fedora-*, but the directory is /etc/server-role (no fedora); should this be consistent?
Why not /etc/rolekit/roles?
I wrote this prior to the selection of rolekit as the name. I agree, that's a more sensible location.
server@lists.fedoraproject.org