-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(libstore): add support for multipart s3 uploads #14330
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
base: master
Are you sure you want to change the base?
Conversation
6fabf0d to
d5ef2c8
Compare
b179028 to
617ebc6
Compare
9bdac08 to
9415bfc
Compare
9415bfc to
7e1ec95
Compare
1e1800a to
b9a7cb6
Compare
86426bf to
78afd35
Compare
78afd35 to
30f22e7
Compare
|
Urgh sorry for convincing everyone we could get away without implementing multipart uploads. |
No big deal. IMO having a single store implementation is still much more beneficial. We now also have constant memory both for uploads in http store and constant memory downloads. Previously HTTP store would buffer everything on uploads and S3 - for downloads. Consolidating everything is better either way and multi-part uploads just need to work - not be as efficient as possible. I doubt NixOS infra uploads compressed NARs that are remotely close to the limit, since the uncompressed output size is already limited to 4GB. |
30f22e7 to
4daa3e6
Compare
4daa3e6 to
a756484
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR implements multipart upload support for S3 binary cache operations to address upload failures with large files. It adds three new configuration settings ( Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Areas requiring extra attention:
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-28T18:50:29.831ZApplied to files:
Comment |
| - **`multipart-upload`** (default: `false`): Enable multipart uploads for large | ||
| files. When enabled, files exceeding the multipart threshold will be uploaded | ||
| in multiple parts. | ||
|
|
||
| - **`multipart-threshold`** (default: `100 MiB`): Minimum file size for using | ||
| multipart uploads. Files smaller than this will use regular PUT requests. | ||
| Only takes effect when `multipart-upload` is enabled. | ||
|
|
||
| - **`multipart-chunk-size`** (default: `5 MiB`): Size of each part in multipart | ||
| uploads. Must be at least 5 MiB (AWS S3 requirement). Larger chunk sizes | ||
| reduce the number of requests but use more memory. | ||
|
|
||
| - **`buffer-size`**: Has been replaced by `multipart-chunk-size`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note (not actionable for this PR) that this is the sort of thing that I think nested settings / settings JSON is good for.
…tings Add three configuration settings to `S3BinaryCacheStoreConfig` to control multipart upload behavior: - `bool multipart-upload` (default `false`): Enable/disable multipart uploads - `uint64_t multipart-chunk-size` (default 5 MiB): Size of each upload part - `uint64_t multipart-threshold` (default 100 MiB): Minimum file size for multipart The feature is disabled by default.
Implement `uploadMultipart()`, the main method that orchestrates S3 multipart uploads
a756484 to
25b4045
Compare
Motivation
This adds support for multipart uploads to the new s3 implementation, which is required for uploading files larger than 5GiB.
It's a big change, the commits will be pulled out into individual PRs, but this is here for early review of the big picture.
Context
Fixes: #12671
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.