-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add audbackend.backend.Minio #231
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
* Add support for owner() * Be more conservative regarding owner
Reviewer's Guide by SourceryThis pull request implements a new backend for MinIO in the audbackend library. It adds support for MinIO storage, which is compatible with S3, and includes necessary changes to the existing codebase to integrate the new backend. The implementation follows a similar pattern to the existing Artifactory backend, with additional configuration options specific to MinIO. Class diagram for the new Minio backendclassDiagram
class Minio {
- MinioClient _client
+ Minio(host: str, repository: str, authentication: Tuple[str, str] = None, secure: bool = None, **kwargs)
+ get_authentication(host: str) Tuple[str, str]
+ get_config(host: str) Dict
+ close()
+ _checksum(path: str) str
+ _collapse(path)
+ _copy_file(src_path: str, dst_path: str, verbose: bool)
+ _create()
+ _date(path: str) str
+ _delete()
+ _exists(path: str) bool
+ _get_file(src_path: str, dst_path: str, verbose: bool)
+ _ls(path: str) List[str]
+ _move_file(src_path: str, dst_path: str, verbose: bool)
+ _open()
+ _owner(path: str) str
+ path(path: str) str
+ _put_file(src_path: str, dst_path: str, checksum: str, verbose: bool)
+ _remove_file(path: str)
+ _size(path: str) int
}
class Base {
<<abstract>>
}
Minio --|> Base
note for Minio "This class implements a backend for MinIO storage, compatible with S3."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @hagenw - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🔴 Security: 2 blocking issues
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
I addressed now all comments and updated the description by mentioning our Hetzner S3 test. |
As it works with |
Implements a backend for MinIO.
MinIO is compatible with S3 storage, and we tested internally that this backend works with S3 storage on Hetzner and AWS. A test based on AWS is integrated in audeering/audb#450.
I decided to handle the authentication the same way as we do for
audbackend.backend.Artifactory
, by allowing to specify the username / password inside a config file or environment variable. In addition, we have the class methodaudbackend.backend.Minio.get_authentication()
to retrieve them, in order to check their values.For local MinIO servers we also need to set the
secure
argument toFalse
. I added this to the config file as well, in oder to make it part of the backend configuration, and added the class methodaudbackend.backend.Minio.get_config()
, which returns all entries as dictionary.In certain edge cases you might want to add other arguments to the underlying
minio.Minio
class. For that reason I decided to add support for**kwargs
, but do no checks if there is any conflict with authentication as I think this is only for power users anyway.Summary by Sourcery
Add support for MinIO as a new backend in the audbackend library, enabling storage operations with MinIO. Refactor tests to accommodate the new backend and ensure robust testing of its functionality.
New Features:
Enhancements:
Tests: