Skip to content
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

rest: simplify disk usage format #301

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

diegodelemos
Copy link
Member

@diegodelemos diegodelemos commented Oct 19, 2020

@diegodelemos diegodelemos force-pushed the rs-296/simplify-du branch 4 times, most recently from 86f6af5 to 45bdcd5 Compare October 22, 2020 10:10
@diegodelemos diegodelemos marked this pull request as ready for review October 23, 2020 08:15
@mvidalgarcia
Copy link
Member

mvidalgarcia commented Oct 28, 2020

Moderate: ⚠️

$ flask reana-admin quota-usage
User could not be retrieved: 
None

Fails when we have users with no limits, the key doesn't exist, because we don't calculate the health.

Works when users have limits set:

$ flask reana-admin quota-usage
ID                                     EMAIL                 CPU-USED   CPU-LIMIT   DISK-USED   DISK-LIMIT
00000000-0000-0000-0000-000000000000   jdoe@example.org   89922      90000       1060        90000   

@diegodelemos
Copy link
Member Author

To get this going I've changed the implementation so when there is no health returned, the user quota is displayed as healthy (in green). This is not correct and will have to be addressed in a separate issue.

health_ordered = max(
[disk.get("health"), cpu.get("health")],
[disk.get("health", "healthy"), cpu.get("health", "healthy")],
Copy link
Member

@mvidalgarcia mvidalgarcia Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be ok to import it from the QuotaHealth enum?

* Shows disk usage format either in raw (bytes) or humand-friendly
  format (closes reanahub#296).

* Remove unused marshmallow for openapi generation.
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@136c031). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #301   +/-   ##
=========================================
  Coverage          ?   50.80%           
=========================================
  Files             ?       17           
  Lines             ?     1374           
  Branches          ?        0           
=========================================
  Hits              ?      698           
  Misses            ?      676           
  Partials          ?        0           

@diegodelemos diegodelemos merged commit 6c00f30 into reanahub:master Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quotas: quota unit conversion server side
3 participants