-
Notifications
You must be signed in to change notification settings - Fork 51
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
flux-resource: support new "watch" subcommand #5395
flux-resource: support new "watch" subcommand #5395
Conversation
Haven't had a chance to check this out, but FWIW I like the idea. Good use case for KVS watch too IMO. Nice. |
0813d4b
to
2cc69cf
Compare
re-based, updating the changes to |
2cc69cf
to
47e1409
Compare
47e1409
to
4549343
Compare
43ebdcb
to
6c51610
Compare
6c51610
to
9983479
Compare
rebased, now that #5389 is in |
9983479
to
af48db2
Compare
Problem: Usually a subcommand function is set at the end of the arguments, but for a few subcommands it is set earlier in the command line option parser setup. This makes anal retentive people go cuckoo. Solution: Setup the subcommand function at the end of the command line option setup consistently.
Problem: It would be nice to see resource changes as they happen in real time. Solution: Support a watch subcommand in flux-resource. The subcommand will output all online/offline/drain/undrain changes as they occur by watching resource.eventlog. Fixes flux-framework#4792
Problem: There is no coverage for the new "flux resource watch" subcommand. Add coverage in new test file t2353-resource-cmd-watch.t.
Problem: The new flux resource watch subcommand is not documented. Add documentation in flux-resource.rst.
af48db2
to
db512f9
Compare
was rebasing some old PRs, due to 42852ea, this PR / feature no longer works / makes sense. This was a "neat" feature, but mostly was done as a way to use the new kvs async watcher. If we really want this feature in the future, we'd have to do it an alternate way. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5395 +/- ##
==========================================
- Coverage 83.46% 83.44% -0.02%
==========================================
Files 486 486
Lines 82933 82971 +38
==========================================
+ Hits 69217 69237 +20
- Misses 13716 13734 +18
|
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 watchingresource.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: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 ofjob/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.