Repository navigation
Upload binary files in zip batches (mirror NDI-matlab#1033) - #334
Merged
Merged
Conversation
uploadFilesForDatasetDocuments now honours file_upload_strategy: 'batch' (the default, as in MATLAB) packs files greedily into zips of at most file_batch_size_limit bytes and sends each through the bulk endpoint; 'serial' keeps the per-file signed-URL path. The strategy was previously read by nothing. zipForUpload is replaced by a port of MATLAB's binary batcher (the old one zipped document JSON and had no caller). It reports the documents whose batch failed -- including a batch whose extraction job did not complete -- so sync keeps them out of the index (NDI-matlab#805). SyncOptions gains file_batch_size_limit; uploadDataset gains file_upload_strategy and file_batch_size_limit. The three cloud batch preferences now set the defaults they were registered for, and Max_File_Batch_Size defaults to 250 MB. uploadSingleFile's bulk path no longer passes the URL dict to putFiles. Bridge entries updated to NDI-matlab 7180cc8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvdTYY5XXFwaJpQyHZFXDF
stevevanhooser
pushed a commit
that referenced
this pull request
Oct 17, 2026
CHANGELOG conflict only: both sides added Unreleased entries; kept all of main's and this PR's two. preferences.py and the preferences bridge entry merged cleanly (#334's batch-size default and 7180cc8 hash, this PR's ViewerLauncher default and decision_log note). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KyLF4xAq4Sm4aT5gDyMTS
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.
Summary
Companion to VH-Lab/NDI-matlab#1033. Brings the Python cloud upload path in line with MATLAB's: binary files now go up in zip batches whose size comes from a preference, and the cloud batch-size preferences actually set the defaults they were registered for.
Batched binary upload (new)
uploadFilesForDatasetDocumentsnow honoursfile_upload_strategy.'batch'(the default, as in MATLAB) packs files greedily, in order, into zips of at mostfile_batch_size_limitbytes and sends each through the bulk endpoint (getFileCollectionUploadURL→putFiles). A single file larger than the limit goes up alone.'serial'keeps the old one-signed-URL-per-file path. Previously the strategy was read by nothing and every file went up singly.ndi.cloud.upload.zipForUploadis replaced by a port of MATLAB's binary batcher. The old function zipped document JSON and had no caller insrc(already noted in the bridge file).complete, so sync keeps those documents out of the index (NDI-matlab#805). It waits on extraction jobs only after every batch is sent, so extraction overlaps the remaining uploads.SyncOptionsgainsfile_batch_size_limit(None= use the preference), passed through_upload_binariesby every sync mode.uploadDatasetgainsfile_upload_strategyandfile_batch_size_limit.Preferences now control batch sizes
Cloud.Upload.Max_File_Batch_Size: default 250 MB (was 500 MB); now the zip batch size.Cloud.Upload.Max_Document_Batch_Count: default foruploadDocumentCollection(max_chunk=None).Cloud.Download.Max_Document_Batch_Count(10000): default fordownloadDocumentCollection(chunk_size=None), which was 2000. Behaviour change: larger download chunks, matching MATLAB.Fixed in passing
uploadSingleFile(use_bulk_upload=True)passed the whole{"url", "jobId"}dict toputFilesas the URL, so that path could never succeed.Bridge / docs
zipForUpload,uploadFilesForDatasetDocuments,uploadDocumentCollection,downloadDocumentCollection,uploadDataset,SyncOptions,uploadNew,mirrorToRemote,twoWaySyncandpreferencesare updated to NDI-matlab7180cc8(the #1033 merge).FileBatchSizeLimitis added to the property allowlist. CHANGELOG updated.INTERFACE UPDATE: the bridge contract for
zipForUploadnow reflects the MATLAB source (binary file batching), replacing the old document-JSON signature.Tests
tests/test_cloud_upload_file_batches.py(30 tests, mocked server): packing and the oversize-file case, zip contents named by uid, temp-zip cleanup, per-batch failure reporting (URL, PUT, extraction failed or timed out, file missing), retries, sends-before-waits ordering, the strategy switch, SyncOptions pass-through, and the three preference defaults.file_upload_strategy="serial"; the old JSON-zip tests are removed.black/ruffclean; the affected files pass (229 passed, 15 skipped); the bridge status/properties/hash tests pass against NDI-matlab main.test_cloud_profile_secret_field_names.pyfails the same way on unmodified main locally (environment, not this change).test_cloud_file_series_round_trip.pyuploads a real dataset throughuploadDataset, so it's the first end-to-end run of the batched path.Follow-up: concurrent batch uploads in both languages are tracked in VH-Lab/NDI-matlab#1034.
Generated by Claude Code