reanahub / reana-client

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

cli: more informative output when users exceed quotas #607

Closed tiborsimko closed 2 years ago

tiborsimko commented 2 years ago

Current behaviour

When a user would like to start a new workflow run, but the user exceeded existing quota limits, the user would currently see:

$ reana-client create -w myanalysis --skip-validation
==> ERROR: Cannot create workflow myanalysis:
User quota exceeded.

This is good, since the user is prevented from starting now workflows, but we are not guiding the user as to what to do.

Expected behaviour

I would expect to see at least the basic information:

(1) Which quota was exceeded? CPU? Disk?

(2) What are the limits? Basically we could show an equivalent of what the user would be doing here:

$ reana-client quota-show --resource disk -h
2.26 MiB out of 9.77 KiB used (23716%)
$ reana-client quota-show --resource disk --report usage -h
2.26 MiB
$ reana-client quota-show --resource disk --report limit -h
9.77 KiB

If we show something like:

User quota exceeded. Resource: disk, usage: 2.26 MiB out of 9.77 KiB used (23716%).

(3) What to do next? We should guide the user to go read such-and-such documentation page where we explain how to detect the workflows that are consuming the disk space the most, how to delete unwanted ones, and how to set shorter retention periods for bigger temporary files that are not necessary to keep for too long after the workflow run terminates. (We'll create this page as part of another issue in docs.reana.io.)

audrium commented 2 years ago

Reopening, since (3) item from the issue was not implemented yet