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

Dependencies: Update to disk-objectstore~=1.0 #6132

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Sep 22, 2023

Fixes #6081

  • Update DiskObjectStoreRepositoryBackend.get_info to use the
    dataclasses returned by count_objects and get_total_size
    directly.
  • Change DiskObjectStoreRepositoryBackend.maintain to always call
    clean_storage, even during live operation of the container.
  • Change DiskObjectStoreRepositoryBackend.maintain to now pass
    CompressMode.AUTO when compress is set to True.

Blocked by aiidateam/disk-objectstore#155

Still need to address a few items of #6081 .

@sphuber sphuber added the pr/blocked PR is blocked by another PR that should be merged first label Sep 22, 2023
@sphuber sphuber force-pushed the fix/disk-objectstore-v1 branch 4 times, most recently from dfe844c to 23173e4 Compare October 10, 2023 06:00
@sphuber sphuber removed the pr/blocked PR is blocked by another PR that should be merged first label Oct 10, 2023
@sphuber sphuber force-pushed the fix/disk-objectstore-v1 branch 2 times, most recently from 2c788fd to f34f7f1 Compare October 12, 2023 08:09
Copy link
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

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

I left a couple of comments - in particular good to double check the one on tests (tests seem to be the same but the test results changed?), then it can be merged (Note: I didn't check if there were other occurrences of data classes still used in the old dict way, but I imagine we can fix those later if we spot them)



#yapf: disable
@pytest.mark.parametrize(('kwargs', 'output_info'), (
(
{'live': True},
{'unpacked': 2, 'packed': 4}
{'unpacked': 0, 'packed': 4}
Copy link
Member

Choose a reason for hiding this comment

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

Is it expected that these numbers changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I believe this is because the live maintenance now automatically includes packing and cleaning

:param do_repack: flag for forcing the re-packing of already packed files.
:param clean_storage: flag for forcing the cleaning of soft-deleted files from the repository.
:param do_vacuum: flag for forcing the vacuuming of the internal database when cleaning the repository.
:param compress: flag for compressing the data when packing loose files. Set to ``Compress.AUTO`` if ``True``.
Copy link
Member

Choose a reason for hiding this comment

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

Ok, I guess we only allow fully uncompressed or auto compression (no options for YES or KEEP), right?
I guess it's OK for the AiiDA interface in order to keep it simple and we can always point people to the Disk-ObjectStore API for more (or expand this API in the future)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we currently just have a boolean flag because that was all that was supported by the disk objectstore anyway. Don't think we should start making it even more complex now.

* Update `DiskObjectStoreRepositoryBackend.get_info` to use the
  dataclasses returned by `count_objects` and `get_total_size`
  directly.
* Change `DiskObjectStoreRepositoryBackend.maintain` to always call
  `clean_storage`, even during live operation of the container.
* Change `DiskObjectStoreRepositoryBackend.maintain` to now pass
  `CompressMode.AUTO` when `compress` is set to `True`.
@sphuber sphuber force-pushed the fix/disk-objectstore-v1 branch from f34f7f1 to 8306672 Compare October 17, 2023 07:17
@sphuber sphuber merged commit 56f9f6c into aiidateam:main Oct 17, 2023
32 checks passed
@sphuber sphuber deleted the fix/disk-objectstore-v1 branch October 17, 2023 08:27
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.

Upgrade to disk-objectstore 1.0
2 participants