Cook icon indicating copy to clipboard operation
Cook copied to clipboard

The usage CLI subcommand should only show information about pools currently being used

Open rmanyari opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Not a problem exactly but a usability improvement. When Cook is configured with many pools, the cs usage subcommand can be difficult to read. It would be great if the default behavior would be to only show the pools where resources are being used.

Describe the solution you'd like

Instead of returning something like:

$ cs --cluster pubcloud usage
PUBCLOUD - pool-1
               CPUs       Memory     GPUs       Jobs
Quota          0.0        0.0 bytes  0.0        0
Share          Unlimited  Unlimited  Unlimited  N/A
Current Usage  0.0        0.0 bytes  0.0        0

PUBCLOUD - pool-2 (inactive)
                 CPUs  Memory     GPUs       Jobs
Quota            3000  19.07 TiB  Unlimited  150
Share            3000  19.07 TiB  Unlimited  N/A
Current Usage       0  0.0 bytes  0.0        0

PUBCLOUD - useful-pool
               CPUs       Memory     GPUs       Jobs
Quota          Unlimited  Unlimited  Unlimited  1000
Share          Unlimited  Unlimited  Unlimited  N/A
Current Usage  10.0        250.0 GiB  0.0        10

It should return something like:

PUBCLOUD - useful-pool
               CPUs       Memory     GPUs       Jobs
Quota          Unlimited  Unlimited  Unlimited  1000
Share          Unlimited  Unlimited  Unlimited  N/A
Current Usage  10.0        250.0 GiB  0.0        10

Since useful-pool is the only one with active jobs.

Maybe this is the side effect of adding a flag (--used-only, defaults=True) to cs usage.

Describe alternatives you've considered Status-quo, not great.

Additional context Credits to @dposada for the original idea.

rmanyari avatar May 12 '21 18:05 rmanyari

👍🏼

Not sure if we even need --used-only: I think showing the pools with non-zero usage only should be the default, and then if you really need to see the quota / share for a pool with zero usage, you can use the existing --pool flag.

dposada avatar May 12 '21 19:05 dposada