-
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
flux kvs dir command should not list values by default #1158
Comments
FWIW, I think displaying the keys & values is useful for "discovery". There's so much in the KVS, a lot of times you sort of want to just see what's there. I've certainly used it when debugging just to see what I may have screwed up along the way. I don't know if this is enough to warrant a |
Would it be too much to keep a |
I'm fine with retaining that capability if it's useful. Maybe add an As mentioned above it's trickier to decode the values into something printable after #1154 though. Maybe the default could be to directly display the raw value (which might be encoded JSON), with non-printable characters converted to "." and output truncated so that |
I like the idea of calling it |
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1] [key] This is supposed to be similar to ls(1) as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1] [key] This is supposed to be similar to ls(1) as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
Add new subcommand: flux kvs ls [-R] [-d] [-w COLS] [-1|-C] [-F] [key...] This subcommand mimics ls(1) behavior and options, as discussed in flux-framework#1158.
I was just thinking, maybe a
For exploration purposes, you could either do
and explore the file hierarchy that is created, or
and review the table of contents in a familar form? Seems like such a thing would be more generally useful than the proposed dir/dump. The POSIX tar archive format is simple and well documented: https://www.gnu.org/software/tar/manual/html_node/Standard.html |
The tar idea is interesting, but it doesn't solve the use case for dir/dump, which is to show all the keys and their values for a directory for quick debugging purposes. Also, wouldn't it be somewhat more straightforward to allow a |
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't print it directly instead of exiting. Truncate output at 79 colummns, or at first newline if value contains them. Indicate truncated values by appending "...". Fixes flux-framework#1158
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't print it directly instead of exiting. Truncate output at 79 colummns, or at first newline if value contains them. Indicate truncated values by appending "...". Fixes flux-framework#1158
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't print it directly instead of exiting. Truncate output at 79 colummns, or at first newline if value contains them. Indicate truncated values by appending "...". Fixes flux-framework#1158
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't, print it directly instead of exiting. If the output is a terminal, truncate long values so they fit within the terminal width (reusing logic from the ls subcommand). Also truncate values where they contain unprintable characters or newlines. Indicate truncated values by appending "...". Fixes flux-framework#1158
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't, print it directly instead of exiting. If the output is a terminal, truncate long values so they fit within the terminal width (reusing logic from the ls subcommand). Also truncate values where they contain unprintable characters or newlines. Indicate truncated values by appending "...". Fixes flux-framework#1158
Problem: the KVS allows non-JSON values to be stored, but flux kvs dir -R exits with an error if it encounters one. For each value, if it decodes as JSON, format it like before. But if it doesn't, print it directly instead of exiting. If the output is a terminal, truncate long values so they fit within the terminal width (reusing logic from the ls subcommand). Also truncate values where they contain unprintable characters or newlines. Indicate truncated values by appending "...". Fixes flux-framework#1158
flux kvs dir
displays values as well as keys by default:This can result in fairly unreadable output when the KVS contains complex values, for example the XML blob stored as a JSON string by
resource-hwloc
or base64 stdio data stored as a sequenced directory of JSON strings bywrexecd
vialibkz
.Furthermore, after #1154 converts the KVS metadata to RFC 11 form, the assumption that all values are JSON no longer holds, so displaying a value without hints from the user will be a dodgy proposition.
Finally, I'm not aware of an actual use case for dumping values via
flux kvs dir
.My vote would be to make
flux kvs dir
behave more likels(1)
. In fact, if we want to subliminally suggest to users thatflux kvs dir
options behave they way anls(1)
user would expect, it might not be a bad idea to rename it toflux kvs ls
.The text was updated successfully, but these errors were encountered: