-
Notifications
You must be signed in to change notification settings - Fork 367
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
Liuxianyi/aws backend #984
base: main
Are you sure you want to change the base?
Conversation
raise ImportError('Please install boto3 to enable ' | ||
'AWS_Backend.') | ||
|
||
self._client = boto3.client('s3') |
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.
The client accepts many parameters. Should we also support them?
class AWSBackend(BaseStorageBackend):
def __init__(
self,
aws_access_key_id: Optional[[str] = None,
aws_secret_access_key: Optional[[str] = None,
path_mapping: Optional[dict] = None,
client_kwargs: Optional[dict] = None,
)
if client_kwargs is not None:
client_kwargs = dict()
self._client = boto3.client(
's3',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
**client_kwargs
)
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #984 +/- ##
=======================================
Coverage ? 76.38%
=======================================
Files ? 140
Lines ? 11060
Branches ? 2206
=======================================
Hits ? 8448
Misses ? 2251
Partials ? 361
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
bucket) and not obj_name.endswith('/') and obj_name != '': | ||
return True | ||
return False | ||
|
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.
join_path
function is required to make the backend compatible with CheckpointHook to save models to AWS bucket. See this. You may simply take the one from PetrelBackend and it will work.
Has this not been merged in due to the fact that the AWS / s3 backend does not implement the removal of prior checkpoints when best_checkpoint is used? And is there a reasonable way to use it without forking mmengine? |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Currently, mmengine can't support the cloud storage of amazon S3, so I pull a request to add this function.
Modification
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here and update the documentation.
Checklist