-
Notifications
You must be signed in to change notification settings - Fork 34
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
updates/strategy: local timezone aware reboot windows #301
Comments
Heh, was going to file a similar issue. I think for the "single pet FCOS server" case, it's really annoying to have to define things in UTC time. And it also means that the time window shifts wrt your local time when going from e.g. EST to EDT or vice versa. |
On this topic, I still think it's worthy exploring a path where a timer unit does most of the time-related work (i.e. expose a flexible configuration), and Zincati only checks its status in order to get a go/no-go signal. |
Expanding a bit more on the timer units, from an high level perspective the optimal UX would be something like:
This however may require investigating/implementing that systemd timer units can be used:
|
From a UX perspective at least IMO it'd be more coherent to work this on top of Zincati's existing |
IIUC, if we are able to use systemd timer units (particularly useful is |
I believe systemd timer units can only be "edge-triggered". The Calendar Events' I think what we really want out of the timer units is the Calendar Events specification format. Perhaps we could sort of create continuous ranges out of discrete values by saying that the entire second after any Calendar Event value is considered "OK to reboot". E.g. |
One simple, non-intrusive solution would be to include a time zone field (that defaults to UTC if not specified) in the
I believe the first two points are inevitable, but I think we can potentially take action on the latter two points. |
Possible solutions to the fourth point (alternatives to using
|
That sounds like a nice compromise to me! If you actually care about timezones, then you should probably use UTC anyway. |
According to me, I'm not sure that's the best approach as it would suggest doing the wrong thing, which is using a non UTC timezone for the whole system. The use case I think we should focus on is users keeping UTC for the system (which is the only correct option) and making it easier for them to specify the reboot windows without having to do the time conversion manually or taking care of DST shifts. For example, I'm in Europe/Paris, and I want my server to reboot between 2 AM / 3AM my time, whatever the current DST is. I keep my server in UTC but I don't want to have my server reboot at different time during the year depending on which DST we are and this is currently not possible with the options nor would it be possible with a local timezone option. |
I agree that encouraging more people to use non-UTC localtime in order to use this feature is a bit of an unfortunate drawback. On a different topic, it seems that there is an implicit consensus that a single modifier for the whole strategy is fine, i.e. that we are NOT interested in being able to define multiple reboot windows according to different timezones (for example one in UTC and another one in Paris time). |
I agree that it doesn't seem like a very common use case to be able to define multiple reboot windows according to different time zones. |
OK, I might've misunderstood, because that's exactly what I want too. :) |
I think I'm proposing a hybrid of those two, where it uses |
Ah, I wasn't aware that servers should only use UTC as their system time (but now that I think about it, it makes total sense). In this case, it looks like we have no way of getting around reading from |
What I have in mind for the UX:
What I have in mind for Zincati:
Agree. I don't see a use case for that.
I don't understand how you could do that without changing the system timezone. |
@travier Thanks for the suggestions! I agree with the UX. Currently, I've also added a Gain:
Pain:
I think the above "pains" aren't too bad, but they make the solution a bit less elegant; overall, it seems to me that the cost is not worth the gain. But this could be because I am totally overlooking the value of having invariant lengths over invariant time. |
After some offline discussion with @lucab, we agreed that because having invariant naive time seems more intuitive/natural over having invariant length, we will pursue the invariant naive time route for now. But if there are factors in favour of having invariant length that we overlooked, please let me know! |
Couple notes regarding keeping invariant length: There are a couple points that can make this approach significantly more complex than keeping invariant clock time (naive time). Mainly the trickiness and edge cases stem from having to make some arbitrary decisions around mapping clock time to UTC time. Essentially, we cannot easily compute the UTC time for a given clock time in a time zone. For example, say a reboot window configuration is 2:30 AM for 60 minutes and the time zone is US/Eastern. There is no problem on most days of the year, except for "Spring Forward Day" and "Fall Back Day". On "Spring Forward Day", 2:30 AM does not exist, so we'll need to make an arbitrary decision like changing the reboot window to 3:00 AM for 60 minutes. A similar situation exists for "Fall Back Day"; we will need to make the arbitrary decision to use allow a 60 minute reboot window starting at the second occurrence of 2:30 AM (like @travier suggested). However, keeping track of this will not be as simple as having something like a To me, it is simpler and more intuitive for the reboot windows to always obey the clock time for a time zone, and sacrifice guaranteeing an invariant reboot window length. Additionally, if I understood correctly, systemd timer units also work in a similar way, where jobs can be skipped if the specified P.S. just a thought, but we can potentially just say we don't support windows with start times at "special" times (this would be between 2:00 AM to 3:00 AM for US/Eastern), so we don't need to deal with having to make arbitrary decisions. But this makes the window configurations very coupled with the specified time zone and also very vulnerable to policy changes. |
Zincati 0.0.11 gained a new
periodic
strategy for scheduling reboot windows on a weekly calendar.Its design decisions are noted here and the configuration options here.
There are three main points that pinned the
periodic
strategy to use UTC times and dates:However this comes with a few usability drawbacks:
One idea that was floated is to add a new strategy which uses systemd time labels as documented in https://www.freedesktop.org/software/systemd/man/systemd.time.html.
That format however is meant for edge-triggers (i.e. precise points in time) instead of level-triggers (i.e. time windows). It also results in possibly weird windows definitions like
yesterday
andweekly
.Another idea is to add low-level strategy (e.g. the filesystem-based one at #245) so that high-level components could plug into it. In this case a systemd timer+service unit would handle the filesystem entry based on local time.
The text was updated successfully, but these errors were encountered: