ref(snapshots): Use file-based upload for objectstore puts#3185
Merged
ref(snapshots): Use file-based upload for objectstore puts#3185
Conversation
Use `put_file` instead of `put` when uploading images to objectstore, streaming file contents from disk rather than loading entire files into memory. Hash computation also now uses buffered reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lcian
commented
Mar 4, 2026
src/commands/build/snapshots.rs
Outdated
| .with_context(|| format!("Failed to read image: {}", image.path.display()))?; | ||
| let hash = compute_sha256_hash(&contents); | ||
| let hash = compute_sha256_hash(&image.path)?; | ||
| let file = runtime.block_on(File::open(&image.path)).with_context(|| { |
Member
Author
There was a problem hiding this comment.
This will be improved in #3187 by making compute_sha256_hash async too and entering the runtime earlier so we can await async things instead of using block_on.
NicoHinderling
approved these changes
Mar 4, 2026
Member
Author
|
Merging now as it solves a problem for @NicoHinderling where images larger than a certain threshold would fail to upload due to an object size limit we have in the batch endpoint. |
…ailure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Use
put_fileinstead ofputwhen uploading images to objectstore,streaming file contents from disk rather than loading entire files into
memory. This leverages the
Filevariant added in objectstore-client0.1.2.
Hash computation also now uses buffered reads instead of loading the
entire file into memory at once.
Close #3160
Close CLI-293