buildgrid.server.actioncache.instance module

class buildgrid.server.actioncache.instance.ActionCache(cache: ActionCacheABC)

Bases: Instance

SERVICE_NAME: ClassVar[str] = 'build.bazel.remote.execution.v2.ActionCache'

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.

property allow_updates: bool
get_action_result(action_digest: Digest) ActionResult

Retrieves the cached result for an Action.

If there is no cached result found, returns None.

Parameters:

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 cache.

If the result has a non-zero exit code and cache_failed_actions is False for this cache, the result is not cached.

Parameters:
  • 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.