reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

cli: robot-friendly disk usage information #341

Closed tiborsimko closed 4 years ago

tiborsimko commented 4 years ago

Currently, reana-client du and reana-client list --verbose will give information about workspace disk usage. The information is printed in human-friendly way, e.g.

$ reana-client du -s -w roofit-yadage
SIZE   NAME
189K   .   

The behaviour was modelled after Unix's du command.

The problem with the current behaviour is that there is no way to get robot-friendly output that would be actionable, as users may be accustomed from Unix analogy e.g. to discover three most consuming subdirectories:

$ du -ks ./* | sort -nr | head -3

The proposed solution is to enhance reana-client du and reana-client list commands with an option -k that would print disk usage not in human friendly format, but in kilobytes; or even better -b that would do the same in bytes; or perhaps even both by analogy with Unix du command.

(Also, we should enrich the Click docs of the list command to better advertise that the --verbose option will print out disk sizes for all the workflow runs. I think it is pretty hidden right now.)

mvidalgarcia commented 4 years ago

For the reana-client list --verbose case, flags -k and -b would only work if --verbose is there, am I right?

tiborsimko commented 4 years ago

Yeah, right... We could simply add to the help guide something like

-b, --bytes      Print workspace disk size in bytes (to be used with --verbose)

But I can see that this can get confusing for people... For the du command, there is no problem, since the analogy with "du" works perfectly. For the list command, the analogy works less well, so it could get confusing.

One option is to live with such a documentation and eventually amend the behaviour later based on real-life usage.

Another option is to change the logic for the list command already now and invent a new, separate and nicely descriptive flag such as --size that would be decoupled from --verbose (and from du, as it were).