Skip to content

ref(snapshots): Use file-based upload for objectstore puts#3185

Merged
lcian merged 5 commits intomasterfrom
lcian/bump-objectstore-client
Mar 4, 2026
Merged

ref(snapshots): Use file-based upload for objectstore puts#3185
lcian merged 5 commits intomasterfrom
lcian/bump-objectstore-client

Conversation

@lcian
Copy link
Member

@lcian lcian commented Mar 4, 2026

Use put_file instead of put when uploading images to objectstore,
streaming file contents from disk rather than loading entire files into
memory. This leverages the File variant added in objectstore-client
0.1.2.

Hash computation also now uses buffered reads instead of loading the
entire file into memory at once.

Close #3160
Close CLI-293

lcian and others added 3 commits March 4, 2026 15:04
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 lcian marked this pull request as ready for review March 4, 2026 18:10
@lcian lcian requested review from a team as code owners March 4, 2026 18:10
@linear
Copy link

linear bot commented Mar 4, 2026

.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(|| {
Copy link
Member Author

@lcian lcian Mar 4, 2026

Choose a reason for hiding this comment

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

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.

@lcian
Copy link
Member Author

lcian commented Mar 4, 2026

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.
The newly introduced put_file API is size-aware and dispatches to the single object endpoint as needed, to ensure this failure mode is avoided.
We can still discuss this tomorrow if you wish @szokeasaurusrex.

@lcian lcian merged commit 1b65526 into master Mar 4, 2026
25 checks passed
@lcian lcian deleted the lcian/bump-objectstore-client branch March 4, 2026 18:44
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.

Improve Objectstore batching efficiency

2 participants