-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What would you like to be added?
Current OCI.pushBlob(ref, InputStream) spools to a temp file first (src/main/java/land/oras/OCI.java:109).
Add a streaming upload overload for the remote registry path, scoped to the "digest already known" case:
- New API (Registry):
Layer pushBlob(ContainerRef refWithDigest, long size, Supplier<InputStream> stream, Map<String,String> annotations)
Constraints / behavior:
refWithDigest.getDigest()is required; otherwise throw.- Implement upload as distribution-spec two-step:
POST /blobs/uploads/(no body) ->PUT <location>?digest=...(single streamed body). - Use
BodyPublishers.ofInputStream(stream)so auth/redirect retries can reopen the stream (no temp files).
Copy usage:
- Update
src/main/java/land/oras/CopyUtils.javato call the new overload and pass knownlayer.getSize()+ a stream supplier.
Non-goals:
- Streaming when digest is not known (no "compute digest while uploading" in this change).
- Changing existing
pushBlob(Path|byte[])behavior.
Why is this needed for ORAS?
- Performance: avoid extra disk I/O and temp space for every copied blob.
- Resource limits: works in constrained environments (CI runners, k8s, serverless).
Are you willing to submit PRs to contribute to this feature?
- Yes, I am willing to implement it.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request