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

feat: Add "transfer_manager" module for concurrent uploads and downloads as a preview feature #844

Merged
merged 16 commits into from
Oct 27, 2022

Conversation

andrewsg
Copy link
Contributor

@andrewsg andrewsg commented Aug 19, 2022

This module adds support for concurrent uploads and downloads of multiple files, and concurrent chunked downloads of a single file.

Transfer Manager is currently a preview feature. The API and behavior of the module may change depending on user feedback. Please freely let us know about your experiences with the feature (be they problems, suggestions, or general feedback) by opening an issue on Github or commenting on an existing issue on the topic.

Fixes #36 and #388 🦕

@andrewsg andrewsg added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 19, 2022
@andrewsg andrewsg self-assigned this Aug 19, 2022
@andrewsg andrewsg requested review from a team as code owners August 19, 2022 18:49
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/python-storage API. labels Aug 19, 2022
@andrewsg
Copy link
Contributor Author

Docstrings pending initial review

@andrewsg andrewsg added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2022
Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

Couple questions, generally looking really good!

This is probably in the planning, but it'd be very helpful to add method and parameter descriptions in the docstring for the new module.

google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Show resolved Hide resolved
Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Few comments, thanks @andrewsg

return results


def download_chunks_concurrently_to_file(
Copy link
Member

Choose a reason for hiding this comment

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

What is the guidance on when a customer should rely on download_chunks_conccurrently_to_file directly vs. not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! The benefit is that it adds speed for large files in cases where one thread can't saturate the network bandwidth. And the drawback is that it's much more complex, and adds overhead esp. if chunk size is low. How to distill that into customer guidance? I'll have to think about it.

google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Show resolved Hide resolved
@andrewsg
Copy link
Contributor Author

andrewsg commented Oct 4, 2022

@frankyn @cojenco PTAL

Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Two comments; overall LGTM,

google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Show resolved Hide resolved
Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

A few questions, thanks for the thorough tests!

google/cloud/storage/transfer_manager.py Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
tests/system/test_transfer_manager.py Show resolved Hide resolved
google/cloud/storage/transfer_manager.py Outdated Show resolved Hide resolved
tests/system/test_transfer_manager.py Show resolved Hide resolved
tests/unit/test_transfer_manager.py Show resolved Hide resolved
@bwalsh
Copy link

bwalsh commented Oct 18, 2022

Great to see this, starting a new project that needs exactly this functionality. Thanks.

@andrewsg andrewsg removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 21, 2022
@andrewsg
Copy link
Contributor Author

@cojenco @frankyn PTAL

Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Andrew!

@andrewsg andrewsg changed the title feat: Add "transfer_manager" module for concurrent uploads and downloads feat: Add "transfer_manager" module for concurrent uploads and downloads as a preview feature Oct 25, 2022
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support parallel operations for copying objects
5 participants