Skip to content

Add rollout support to the remote store layer#125

Merged
beinan merged 2 commits into
lance-format:mainfrom
beinan:feat/rollout-remote-store
Jul 9, 2026
Merged

Add rollout support to the remote store layer#125
beinan merged 2 commits into
lance-format:mainfrom
beinan:feat/rollout-remote-store

Conversation

@beinan

@beinan beinan commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extends the native RolloutRecord / RolloutStore (landed in Native RolloutRecord schema and RolloutStore for RL rollout storage #124)
    across the remote store layer, mirroring the existing ContextRecord
    remote path. Purely additive — the ContextRecord path is untouched.
  • Single POST /api/v1/rollouts/{name}/records endpoint accepts either
    encoding, chosen by Content-Type: application/json inlines
    binary_payload as base64; multipart/form-data sends a metadata
    part (records array, payloads null) followed by one raw binary part per
    record-with-a-blob, named by zero-based index. Avoids ~33% base64
    inflation and full-blob buffering for large artifacts.
  • Unified RolloutStore enum (Local / Remote) behind the remote
    feature, mirroring ContextStore.

Multipart strict-reject

A rollout append feeds training and is atomic, so the whole request is
rejected with 400 before anything is written when: the first part is
not metadata; a part name is not a valid record index (unparseable /
out of bounds); an index is duplicated; a byte length disagrees with the
record's payload_size; or a record declares payload_size but no
binary part is supplied.

Notes

  • payload_checksum is a caller-supplied opaque string, stored as-is (no
    server-side hashing — no hashing dep in the workspace).
  • Rollout datasets use a .rollout.lance suffix so a rollout store and a
    context store can share a name on disk.

Test plan

  • cargo test --all-features — api 6, core 102 (+1 ignored), server 26
  • cargo clippy --all-features --all-targets — clean
  • Multipart attach-by-index round-trip + all strict-reject cases
  • JSON inline base64 payload offloaded via blob v2, materialized via blob endpoint

Co-Authored-By: Beinan Wang beinanwang@microsoft.com

Beinan Wang added 2 commits July 8, 2026 20:33
Mirrors the existing ContextRecord remote path for the native
RolloutRecord schema across all five crates. Purely additive — no
ContextRecord behavior changes.

- lance-context-api: RolloutStoreApi trait (add/list/get/get_blob/
  version/checkout) + rollout DTOs.
- lance-context-client: RemoteRolloutStore HTTP client with a multipart
  upload path for large binary artifacts.
- lance-context-server: rollout routes + per-name store map. A single
  POST /records endpoint chooses encoding by Content-Type — JSON inlines
  binary_payload as base64; multipart sends a `metadata` part first, then
  one raw binary part per record-with-a-blob, named by zero-based index.
  The multipart path is strict-reject: metadata-not-first, unparseable/
  out-of-bounds/duplicate index, a size mismatch, or a declared-but-absent
  payload rejects the whole request with 400 before anything is written.
- lance-context-core: RolloutRecord <-> DTO mapping + RolloutStoreApi impl.
- lance-context: unified RolloutStore enum dispatching Local/Remote,
  mirroring ContextStore.

Artifact blobs travel as raw multipart parts to avoid base64 inflation
and full-blob buffering. payload_checksum is a caller-supplied opaque
string, stored as-is. Rollout datasets use a `.rollout.lance` suffix so a
rollout store and a context store can share a name without colliding.

Tests: server 26 (8 rollout, incl. multipart strict-reject), api 6,
core 102 (+1 ignored). clippy --all-features clean.

Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
@beinan beinan marked this pull request as ready for review July 9, 2026 04:37
@beinan beinan merged commit c7c3c51 into lance-format:main Jul 9, 2026
9 checks passed
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.

1 participant