Expose `MultipartStore`: multipart uploads that span several calls
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the existing sign functions and the Rust MultipartStore trait implementations named in the issue, especially PrefixStore and MaybePrefixedStore. The proposal outlines four public functions and a MultipartCapableStore alias, but leaves names and shapes open for discussion. Done means the maintainers agree on an API and it supports creating, resuming, completing, and aborting multipart uploads across calls.
Written by the indexing model from the issue text.
Description
Use case
put(..., use_multipart=True) and open_writer run a whole multipart upload inside one call. Some callers need to keep one multipart upload open across calls, and across processes: a server that receives a large file in several HTTP requests (a resumable upload protocol such as tus, where each request can reach a different host) creates the upload once, sends part n from the request that carries those bytes, and completes it from a later request. Today this needs a second S3 client next to obstore.
object_store already has the operations in its MultipartStore trait, implemented by AmazonS3, GoogleCloudStorage, MicrosoftAzure, InMemory and PrefixStore. The upload id and the part ids are strings, so a caller can store them and resume from another process.
Proposal
Four functions in the style of sign, each with an _async twin, restricted to the stores that implement the trait:
MultipartCapableStore: TypeAlias = AzureStore | GCSStore | S3Store | MemoryStore
class PartId(TypedDict):
content_id: str
def create_multipart(
store: MultipartCapableStore,
path: str,
*,
attributes: Attributes | None = None,
tags: dict[str, str] | None = None,
) -> str: ... # the upload id
def put_part(
store: MultipartCapableStore,
path: str,
upload_id: str,
part_idx: int,
data: bytes | Buffer,
) -> PartId: ...
def complete_multipart(
store: MultipartCapableStore,
path: str,
upload_id: str,
parts: Sequence[PartId],
) -> PutResult: ...
def abort_multipart(store: MultipartCapableStore, path: str, upload_id: str) -> None: ...
On the Rust side this would be a MultipartCapableStore enum like SignCapableStore, plus a MultipartStore impl for MaybePrefixedStore that prefixes the path, as PrefixStore does. MemoryStore in the alias lets users test their code without a bucket.
Names and shapes are a suggestion. Would you accept this?
- Dominant language
- Python
- Stars
- 848
- Forks
- 50
- Avg merge
- 7h 58m
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/obstore
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
developmentseed/obstore#836 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#835 ·
Maintainers usually reply within 1 day
-
fsspec: `get_file` silently writes nothing for `file://` and Windows pathsPossibly taken @andyhetianjun claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
developmentseed/obstore#830 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
developmentseed/obstore#823 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#819 ·
Maintainers usually reply within 1 day
All issues in developmentseed/obstore
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
needs-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
pollen-robotics/reachy_mini_conversation_app#631 ·
Maintainers usually reply within 7 days
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100