buildgrid.server.actioncache.caches.remote_cache module

Remote Action Cache

Provides an interface to a remote Action Cache. This can be used by other services (e.g. an Execution service) to communicate with a remote cache.

It provides the same API as any other Action Cache instance backend.

class buildgrid.server.actioncache.caches.remote_cache.RemoteActionCache(remote: str, instance_name: str, retries: int = 0, max_backoff: int = 64, request_timeout: float | None = None, channel_options: Tuple[Tuple[str, str], ...] | None = None, tls_credentials: Dict[str, str] | None = None)

Bases: ActionCacheABC

setup_grpc() None

A method called when the Service is being attached to a grpc server.

This method may be overriden if extra setup is required.

property allow_updates: bool
get_action_result(action_digest: Digest) ActionResult

Retrieves the cached result for an Action.

Queries the remote ActionCache service to retrieve the cached result for a given Action digest. If the remote cache doesn’t contain a result for the Action, then None is returned.


action_digest (Digest) – The digest of the Action to retrieve the cached result of.

update_action_result(action_digest: Digest, action_result: ActionResult) None

Stores a result for an Action in the remote cache.

Sends an UpdateActionResult request to the remote ActionCache service, to store the result in the remote cache.

If the remote cache doesn’t allow updates, then this raises a NotImplementedError.

  • action_digest (Digest) – The digest of the Action whose result is being cached.

  • action_result (ActionResult) – The result to cache for the given Action digest.