Skip to content

reapi: read from the CAS and the action cache - #5

Merged
tiny-ac merged 1 commit into
reapi/mvpfrom
reapi/content-addressable-storage
Oct 22, 2026
Merged

tiny-ac merged 1 commit into
reapi/mvpfrom
reapi/content-addressable-storage

Conversation

@tiny-ac

@tiny-ac tiny-ac commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Reads from a REAPI server's content-addressable storage (CAS) and action cache. Nothing calls them yet; later PRs look compiles up in the action cache and download their outputs.

Cas downloads blobs over ByteStream, zstd-compressed when the server supports it, into memory or a temporary file. A blocking thread decompresses, hashes and writes each blob as it arrives, and the download fails if the blob's size or hash doesn't match its digest, or if the server sends more bytes than the digest allows. A blob the server doesn't have fails with MissingBlob, so callers can treat it as a cache miss.

ActionCache looks an action's result up, and returns None on a miss.

Changes

  • src/reapi/cas.rs: Cas and MissingBlob.
  • src/reapi/action_cache.rs: ActionCache.
  • src/reapi/fake.rs: an in-memory REAPI server for tests, with Capabilities, ByteStream reads and the action cache.
  • src/reapi/client.rs: RPC_TIMEOUT is visible to the other reapi modules.

Cost

Without the reapi feature, nothing new is compiled. With it, no new dependencies.

Validation

  • fmt, and clippy with -D warnings, with and without reapi.
  • cargo test --features reapi --lib reapi::: the new tests run against the fake server, including corrupt, oversized and invalid blobs, with and without zstd, and a missing blob reported when the read starts or in its stream.
  • cargo check --no-default-features --features reapi.

@tiny-ac
tiny-ac merged commit 16f87f8 into reapi/mvp Oct 22, 2026
68 of 101 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