Skip to content
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

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Aug 16, 2023

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.

@grondo
Copy link
Contributor

grondo commented Aug 16, 2023

Haven't had a chance to check this out, but FWIW I like the idea. Good use case for KVS watch too IMO. Nice.

@chu11 chu11 changed the title WIP flux-resource: support new "watch" subcommand flux-resource: support new "watch" subcommand Sep 12, 2023
@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from 0813d4b to 2cc69cf Compare November 30, 2023 05:38
@chu11
Copy link
Member Author

chu11 commented Nov 30, 2023

re-based, updating the changes to flux-resource(1) per the new formatting.

@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from 2cc69cf to 47e1409 Compare November 30, 2023 05:53
@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from 47e1409 to 4549343 Compare December 18, 2023 19:39
@chu11
Copy link
Member Author

chu11 commented Dec 18, 2023

rebased on new lineage, #5627, #5389 come before this

@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch 2 times, most recently from 43ebdcb to 6c51610 Compare December 19, 2023 21:39
@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from 6c51610 to 9983479 Compare January 30, 2024 02:26
@chu11
Copy link
Member Author

chu11 commented Jan 30, 2024

rebased, now that #5389 is in

@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from 9983479 to af48db2 Compare February 1, 2024 02:13
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.
@chu11 chu11 force-pushed the issue4792_flux_resource_stream_changes branch from af48db2 to db512f9 Compare February 2, 2024 01:20
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Merging #5395 (db512f9) into master (2527c83) will decrease coverage by 0.02%.
The diff coverage is 35.00%.

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     
Files Coverage Δ
src/cmd/flux-resource.py 88.97% <35.00%> (-6.20%) ⬇️

... and 12 files with indirect coverage changes

@chu11
Copy link
Member Author

chu11 commented May 23, 2024

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.

@chu11 chu11 closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants