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: ~buildgrid._enums.ActionCacheEntryType | None = ActionCacheEntryType.ACTION_RESULT_DIGEST, migrate_entries: bool | None = False, bucket: str | None = None, endpoint_url: str | None = None, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, config: ~botocore.config.Config | None = <botocore.config.Config object>)

Bases: ActionCacheABC

property allow_updates: bool
get_action_result(action_digest: Digest) 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: Digest, action_result: 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.