buildgrid.server.cas.instance module
Storage Instances
Instances of CAS and ByteStream
- class buildgrid.server.cas.instance.ContentAddressableStorageInstance(storage: RootStorage, read_only: bool = False, enable_chunking: bool = False, chunked_by_buildbox_allowed_subjects: list[str] | None = None, verified_by_buildbox_allowed_subjects: list[str] | None = None)
Bases:
Instance- SERVICE_NAME: ClassVar[str] = 'build.bazel.remote.execution.v2.ContentAddressableStorage'
The expected FULL_NAME of the Service which will wrap this instance. This value should be declared on the class of any Instance implementations.
- start() None
A method called when the grpc service is starting.
This method may be overriden if startup logic is required.
- stop() None
A method called when the grpc service is shutting down.
This method may be overriden if shutdown logic is required.
- find_missing_blobs(blob_digests: Sequence[Digest]) FindMissingBlobsResponse
- batch_update_blobs(requests: Sequence[Request], *, client_verified: bool = False) BatchUpdateBlobsResponse
Store a batch of blobs. If
client_verifiedand the subject is allowlisted, skip hashing; size and hash format are still checked.
- batch_read_blobs(digests: Sequence[Digest]) BatchReadBlobsResponse
- get_tree(request: GetTreeRequest) Iterator[GetTreeResponse]
- property chunking_enabled: bool
- property splice_enabled: bool
- splice_blob(request: SpliceBlobRequest, *, client_verified: bool = False, client_chunked: bool = False) SpliceBlobResponse
Record the chunk mapping for a blob assembled from already-uploaded chunks.
- Parameters:
request – the SpliceBlob request.
client_verified – whether the request had the
verified-by-buildboxheader.client_chunked – whether the request had the deprecated
chunked-by-buildboxheader.
Either header skips chunk verification if the subject is in its allowlist. The structural checks below always run.
- split_blob(request: SplitBlobRequest) SplitBlobResponse
- class buildgrid.server.cas.instance.WriteBlobState(hash: '_Hash', bytes_count: int)
Bases:
object- hash: _Hash
- bytes_count: int
- update(data: bytes) None
- validate(digest: Digest) None
- class buildgrid.server.cas.instance.ByteStreamInstance(storage: RootStorage, read_only: bool = False, disable_overwrite_early_return: bool = False, stream_blob: bool = True)
Bases:
Instance- SERVICE_NAME: ClassVar[str] = 'google.bytestream.ByteStream'
The expected FULL_NAME of the Service which will wrap this instance. This value should be declared on the class of any Instance implementations.
- BLOCK_SIZE = 1048576
- start() None
A method called when the grpc service is starting.
This method may be overriden if startup logic is required.
- stop() None
A method called when the grpc service is shutting down.
This method may be overriden if shutdown logic is required.
- read_cas_blob(digest: Digest, read_offset: int, read_limit: int) Iterator[ReadResponse]
- write_cas_blob(digest_hash: str, digest_size: str, requests: Iterator[WriteRequest]) WriteResponse