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

iRods microservice does not catch ibun (zip/unzip) actions #5418

Closed
devincowan opened this issue Mar 18, 2024 · 3 comments
Closed

iRods microservice does not catch ibun (zip/unzip) actions #5418

devincowan opened this issue Mar 18, 2024 · 3 comments
Assignees
Labels
bug Broad category when more specific Label can't be found iRODS

Comments

@devincowan
Copy link
Contributor

devincowan commented Mar 18, 2024

we've noticed that in some cases the size displayed on resource landing page differs vastly from that in iRods

Example:

image

$ ils ../wwwHydroProxy/62dfabfc99c64878883e58383182dd92
/hydroshareZone/home/wwwHydroProxy/62dfabfc99c64878883e58383182dd92:
  C- /hydroshareZone/home/wwwHydroProxy/62dfabfc99c64878883e58383182dd92/data
$ # quotaUserName AVU on the collection
$  imeta ls -C ../wwwHydroProxy/62dfabfc99c64878883e58383182dd92 quotaUserName
AVUs defined for collection /hydroshareZone/home/wwwHydroProxy/62dfabfc99c64878883e58383182dd92:
attribute: quotaUserName
value: REDACTED
units:
$ # quota usage for the quotaUserName (AVU named is quotaUserName-usage)
$ imeta ls -C ../wwwHydroProxy/bags REDACTED-usage
AVUs defined for collection /hydroshareZone/home/wwwHydroProxy/bags:
attribute: REDACTED-usage
value: 349970851238

? # actual aggregate size on disk of the collection minus the FAIR data objects
? # but INCLUDING the overhead of all the subdirectory book-keeping on disk (approx 4K per subdir)
? du -b --max-depth=0 /projects/hydroshare/vaults/wwwProxy/home/wwwHydroProxy/62dfabfc99c64878883e58383182dd92/data/contents
349971928486	/projects/hydroshare/vaults/wwwProxy/home/wwwHydroProxy/62dfabfc99c64878883e58383182dd92/data/contents

Perhaps related to #5182

Originally posted by @devincowan in #5262 (comment)

@devincowan
Copy link
Contributor Author

UPDATE: after repairing the resource and ingesting all irods files, then running command to refresh size metadata, I see:

>>> from hs_core.models import BaseResource
>>> res = BaseResource.objects.get(short_id="62dfabfc99c64878883e58383182dd92")
>>> res.size
315937358286
>>> from hs_core.hydroshare.utils import convert_file_size_to_unit
>>> convert_file_size_to_unit(res.size, 'gb')
294.2395939361304
>>> from hs_tools_resource.utils import convert_size
>>> convert_size(res.size)
'294.24 GB'
>>> from django.template.defaultfilters import filesizeformat
>>> filesizeformat(res.size)
'294.2\xa0GB'

We might see quite a bit of variation depending on how we convert size
For the resource landing page, we use the built-in: https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#filesizeformat
https://github.com/django/django/blob/3.2.11/django/template/defaultfilters.py#L838-L877

@devincowan devincowan self-assigned this Mar 18, 2024
@devincowan devincowan added this to Backlog in HydroShare Issue Management Board via automation Mar 18, 2024
@devincowan devincowan moved this from Backlog to In Progress in HydroShare Issue Management Board Mar 18, 2024
@devincowan devincowan changed the title we've noticed that in some cases the size displayed on resource landing page differs vastly from that in iRods iRods microservice does not catch ibun (zip/unzip) actions Mar 18, 2024
@devincowan devincowan added the bug Broad category when more specific Label can't be found label Mar 18, 2024
@devincowan
Copy link
Contributor Author

@devincowan
Copy link
Contributor Author

closing as no longer needed
Quota updates released as 2.14 move the HS datazone away from microservices.
Improper handling of ibun should not be impactful for the userzone (where microservices will still be enabled for the time being)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broad category when more specific Label can't be found iRODS
1 participant