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

Bug in dusage #14

Closed
gullbrekken opened this issue Jan 8, 2024 · 9 comments
Closed

Bug in dusage #14

gullbrekken opened this issue Jan 8, 2024 · 9 comments

Comments

@gullbrekken
Copy link

gullbrekken commented Jan 8, 2024

Runs dusage on Fram. Gets this error:

Traceback (most recent call last):
  File "/cluster/bin/_dusage/dusage", line 159, in <module>
    main()
  File "/cluster/software/Python-bundle-PyPI/2023.06-GCCcore-12.3.0/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/cluster/software/Python-bundle-PyPI/2023.06-GCCcore-12.3.0/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/cluster/software/Python-bundle-PyPI/2023.06-GCCcore-12.3.0/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/cluster/software/Python-bundle-PyPI/2023.06-GCCcore-12.3.0/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/cluster/bin/_dusage/dusage", line 118, in main
    quota_info = quota_using_account(config_file, hostname, user)
  File "/cluster/bin/_dusage/dusage_backend.py", line 254, in quota_using_account
    return _quota_using_account(account, config, _quota_using_option, _quota_using_path)
  File "/cluster/bin/_dusage/dusage_backend.py", line 178, in _quota_using_account
    os.path.join(home_prefix, account): _quota_using_option(
  File "/cluster/bin/_dusage/dusage_backend.py", line 118, in _lustre_quota_using_option
    return _lustre_quota_using_command(command)
  File "/cluster/bin/_dusage/dusage_backend.py", line 86, in _lustre_quota_using_command
    space_used_bytes = 1024 * int(space_used_kib)
ValueError: invalid literal for int() with base 10: '21601040*' 
@gullbrekken
Copy link
Author

Sorry for the messy formatting. I don't know how to make line breaks in markdown. Here is a screen shot of the error.
screen_dump

@bast
Copy link
Member

bast commented Jan 8, 2024

Thanks for reporting! I will try to fix it today.

@bast
Copy link
Member

bast commented Jan 8, 2024

Thanks again! I fixed now the problem.

@bast bast closed this as completed in d557864 Jan 8, 2024
@gullbrekken
Copy link
Author

Thanks! Now it works, yes. However, it seems the color formatting in the fixed version may be off?

dusage

@bast
Copy link
Member

bast commented Jan 8, 2024

It is programmed to change to orange when you are above 70% of quota and to red when you are above 85%. So that seems to work. But maybe it is not intuitive. What would you find more intuitive?

@bast
Copy link
Member

bast commented Jan 8, 2024

Maybe it should go to red when it is really full and orange only when it is almost full?

@bast bast reopened this Jan 8, 2024
@gullbrekken
Copy link
Author

Yes, I agree. That is how it worked before, I think. It should not be red before it is above the soft limit. Perhaps orange when above 85% of the soft limit, and red above soft limit?

It would also be very useful if dusage could show the output of lfs quota -u -t ~, i.e. the grace time above the soft limit.

@bast
Copy link
Member

bast commented Jan 8, 2024

Thanks! I will adjust the colors. The good suggestion about grace time is tracked in #15.

@bast
Copy link
Member

bast commented Jan 8, 2024

Colors are now fixed.

@bast bast closed this as completed Jan 8, 2024
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

No branches or pull requests

2 participants