buildgrid.server.actioncache.caches.s3_cache module

S3 Action Cache

Implements an Action Cache using S3 to store cache entries.

class buildgrid.server.actioncache.caches.s3_cache.S3ActionCache(storage: buildgrid.server.cas.storage.storage_abc.StorageABC, allow_updates: bool = True, cache_failed_actions: bool = True, entry_type: Optional[buildgrid._enums.ActionCacheEntryType] = <ActionCacheEntryType.ACTION_RESULT_DIGEST: 0>, migrate_entries: Optional[bool] = False, bucket: Optional[str] = None, endpoint: Optional[str] = None, access_key: Optional[str] = None, secret_key: Optional[str] = None)

Bases: buildgrid.server.actioncache.caches.action_cache_abc.ActionCacheABC

property allow_updates
get_action_result(action_digest: build.bazel.remote.execution.v2.remote_execution_pb2.Digest) → build.bazel.remote.execution.v2.remote_execution_pb2.ActionResult

Retrieves the cached ActionResult for the given Action digest.

Parameters

action_digest – The digest to get the result for

Returns

The cached ActionResult matching the given key or raises NotFoundError.

update_action_result(action_digest: build.bazel.remote.execution.v2.remote_execution_pb2.Digest, action_result: build.bazel.remote.execution.v2.remote_execution_pb2.ActionResult) → None

Stores the result in cache for the given key.

Parameters
  • action_digest (Digest) – digest of Action to update

  • action_result (ActionResult) – ActionResult to store.