Repository navigation
reapi: read from the CAS and the action cache - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Casdownloads 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 withMissingBlob, so callers can treat it as a cache miss.ActionCachelooks an action's result up, and returnsNoneon a miss.Changes
src/reapi/cas.rs:CasandMissingBlob.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_TIMEOUTis visible to the otherreapimodules.Cost
Without the
reapifeature, nothing new is compiled. With it, no new dependencies.Validation
-D warnings, with and withoutreapi.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.