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

Add upload_to_container_streaming to Container #445

Merged
merged 3 commits into from
Aug 17, 2024

Conversation

paul-hansen
Copy link
Contributor

@paul-hansen paul-hansen commented Aug 4, 2024

upload_to_container required loading the entire file into memory which was inefficient (sometimes impossible) for large files that can be streamed from disk or network.

Our use case is recreating containers with backups of the container's volumes stored in an S3 bucket. The backups are created with download_from_container which already supports streaming. Currently for us these volumes can be large and due to the limitations of upload_to_container would cause our demo server (with 1GiB of ram) to quickly run out of memory (especially if multiple customers tried to restore backups).

upload_to_container required loading the entire file into memory which
was inefficient (sometimes impossible) for large files that can be streamed
from disk or network.
@fussybeaver
Copy link
Owner

Fabulous! The previous streaming implementation wrote this test: https://github.com/russelltg/bollard/blob/15ace255bd8f22d566855ab862e1cdb2e16a7cf7/tests/image_test.rs#L1014-L1044 .. which is just a roundtrip test, so it could be similar test.

@paul-hansen paul-hansen marked this pull request as ready for review August 12, 2024 18:51
@fussybeaver
Copy link
Owner

Fabulous.. Thank you very much!

@fussybeaver fussybeaver merged commit 834acfe into fussybeaver:master Aug 17, 2024
14 checks passed
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.

2 participants