feat(storage-objects): Add upload_from_dir helper method#680
Merged
Conversation
Contributor
Author
|
Still adding tests, but what do we think of this so far? So far, this is a naive implementation that holds the entire compressed directory tar in memory, and doesn't perform any filtering (dockerignore file). I think I'd like to land a naive version first before getting fancy. Streaming upload to S3 is a bit involved. |
fb7dc38 to
7675a82
Compare
sid-rl
reviewed
Nov 20, 2025
src/runloop_api_client/sdk/async_.py
Outdated
| tar_buffer = await asyncio.to_thread(synchronous_io) | ||
|
|
||
| obj = await self.create(name=name, content_type="tgz", metadata=metadata, ttl_ms=ttl_ms, **options) | ||
| await obj.upload_content(tar_buffer) |
Contributor
There was a problem hiding this comment.
can't upload synchronous BytesIO to an async http client, smoketest throws RuntimeError: Attempted to send an sync request with an AsyncClient instance.
ca04975 to
de3523b
Compare
This method creates an object out of a local directory by bundling it into a compressed tarball and uploading it as an object.
sid-rl
approved these changes
Nov 21, 2025
Contributor
sid-rl
left a comment
There was a problem hiding this comment.
LGTM! Just make sure the smoketests pass before merging
de3523b to
ec6311f
Compare
Contributor
Author
|
Smoke tests pass! Woot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This method creates an object out of a local directory by bundling it into a compressed tarball and uploading it as an object.