flux-core icon indicating copy to clipboard operation
flux-core copied to clipboard

flux-resource: support new "watch" subcommand

Open chu11 opened this issue 1 year ago • 5 comments

Built on top of #5389. Per a random idea I once had in #4792, support a flux resource watch command that watches and outputs resource changes as they occur by watching resource.eventlog. The idea is to type it in your terminal when you leave work, and see what changed in your terminal when you get back in the next day. Sample output:

2023-08-16T03:51:53 offline fake3
2023-08-16T03:51:53 drain   fake2

This was largely an exercise to make sure the recently added KVSWatch support in the Python kvs module is sorta useful. And for the most part it works as intended. Admittedly this is sort of just "neat" rather than a "must have" or "important". But went ahead and add tests/documentation just in case people like it.

Some thoughts:

  • should job.EventLogEvent be moved outside of job/event.py to a more general location? I didn't do that here, but for consideration.

  • I only support the options --all and --ranks for now. An infinite number of output possibilities exist, but I think this is ok for now.

chu11 avatar Aug 16 '23 03:08 chu11