flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
GNU Lesser General Public License v3.0
3 stars 10 forks source link

create script for crontab tasks #450

Open garlick opened 4 months ago

garlick commented 4 months ago

Problem: currently the system administrators must maintain a flux crontab file in /etc/flux/cron.d for accounting, so when flux-accounting requires a change it requires sys admin intervention, and when the change is version dependent, the sys admins have to ensure configuration management can deal with the transition.

From an offline discussion, one possible solution is:

ryanday36 commented 4 months ago

Two other thoughts on this:

Could this be more built into the flux accounting service such that starting that service automatically turns on the updates rather than requiring a separate thing in ansible / configuration management? It would also be nice if the script could read an update frequency from system/conf.d/archive.toml or similar so that all of the db configs are in one place if the system administrators want more (or less) frequent updates to fairshare, etc.

garlick commented 4 months ago

Good idea. The systemd unit file does have ExecStartPre and ExecStopPost.

ExecStartPre could run the flux cron tab <file command but it would need to not do so if the cron tab is already installed.

ExecStopPost would need some way to look up the cron id and stop or delete it.

So a few details to think about there but maybe doable?

cmoussa1 commented 4 months ago

Perhaps starting with just a shell script might be a somewhat straightforward way to go (at least to start)? Is there a certain directory in the flux-accounting repo that something like this would belong in?