-
Notifications
You must be signed in to change notification settings - Fork 50
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
initial flux-kvs cleanup #928
Conversation
That is just the default help output, you can override that as we do in It might also be really nice if commands were listed in order of usefulness as well instead of alphabetical order, e.g.
The |
Ahhh, I see what you're talking about now. Actually, looking into liboptparse a bit more, overriding it for |
Could the Also, |
@grondo Yup, Hadn't thought about the Hmmm, now that I"m thinking about it, do the |
Well I hadn't looked at the actual commands in awhile, but I was thinking something akin to cpio, but that command has a horrible interface IMO, so perhaps a bad example. I forgot that Also, I wonder how others feel about using |
I was thinking of renaming a few things like Hmmm, how about something as simple as |
Current coverage is 76.08% (diff: 78.68%)@@ master #928 diff @@
==========================================
Files 149 149
Lines 26013 25936 -77
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 19778 19734 -44
+ Misses 6235 6202 -33
Partials 0 0
|
This is my next round of flux-kvs cleanup, this should approach the final cleanup as many unit tests have been added. Biggest cleanup since the last push is merging
I went back and forth about creating a |
To prepare for refactoring/cleanup of flux-kvs, copy the current flux-kvs command into new kvs "basic" tool, for testing basic functionality of the kvs. Rename tool to 'basic' accordingly.
Adjust basic KVS tests to use kvs/basic internally build test tool.
The -d option was for user output convenience and not necessary for basic kvs tests.
For basic tests, need to support multiple inputs in various commands is unnecessary. Remove the support and adjust tests appropriately.
Remove convenience option where no key means looking at the root directory (i.e. "."). This convenience isn't necessary for testing.
2d03bfb
to
b5dd696
Compare
Ended up there was some small racey behavior in my tests b/c of a |
Remove get-treeobj, put-treeobj, getat, dirat, readlinkat, dirsize, type, copy-tokvs, and copy-fromkvs.
Adjust logic of watch and watchdir commands to output 'count' changes and not 'count' versions.
Add -o option to watch and watchdir that will output the current version stored in the key before watching.
Update watch and watch-dir commands w/ recent changes (-o option and logic of output).
Update 'mkdir' and 'readlink' documentation to indicate multiple keys can be specified.
For consistency to many coreutils tools (ls, rm, etc.), change -r option to -R option to specify recursion.
In 'watch' and 'watch-dir' subcommands, make the 'count' argument an option instead of an argument.
Merge dropcache and dropcache-all commands into one with new --all option.
Handle error situations in unlink subcommand, such as when user attempts to remove non-existent KVS entries or non-empty directories. Support -R option to unlink to recursively delete non-empty directories.
Merge watch and watch-dir commands into a single command. Handle many additional corner cases, such as entries being deleted or converting between keys and directories.
Reorder subcommand listing to be consistent to new flux-kvs command and be ordered by usability.
Just pushed, also added 1 extra patch re-organizing the ordering of subcommands in the manpage. |
hmmm, first time through a test failed on one build job b/c of the first test in
I'm going to guess the 1/10th of the core this is running on got scheduled poorly and this thing timed out due to the large number of pings. Maybe should bump up the timeout if we see this anymore. Rebuilt and things all passed this time. |
Yup, looks good. Thanks again @chu11! Merging. |
Per #897 , cleaned up a bunch of flux-kvs command, trying to make it a more "user facing" tool instead of the unit-testing tool it was before. Refactor w/ liboptparse along the way. Copied the old tool into
t/kvs/basic
for unit testing.Ended up axeing
get-treeobj
,put-treeobj
,getat
,dirat
,readlinkat
,type
,dirsize
, andexists
as I felt they were more for testing the KVS api & implementation than really something users need. Casual users will just usewc -l
or-n $str
in scripts withdir
andget
.Other minor fixes along the way:
watch
command logic more in line with user thinking that it means "N changes" occured. Add-o
option to output current value.-r
to-R
for consistency tols
dropcache
anddropcache-all
into one commandcount
turned into an optionThere's still a few more things that I think could be cleaned up, but they will probably be for a future PR.
dropcache --all
, could be a KVS lib function or an option inkvs_dropcache()
or perhaps could be per rank if tweaked appropriately. Sending an event message doesn't seen necessary.watch
andwatch-dir
into one. Maybe can be done right now, but not enough details inkvs.h
about what functions can return EISDIR to program at the moment. Need to dig intolibkvs
deeper.The help output from
flux-kvs
vialiboptparse
is IMO a little uglyI think some tweeks to the liboptparse library could make this nicer (and possibly could be taken advantage by
flux.c
). Perhaps it could be something more like:Still need to add basic tests for the new command (edit: and update old tests that used flux kvs), so don't hit merge yet. Or perhaps I should work on the liboptparse help output first.