Skip to content

Add an action cache

finn requested to merge bloomberg/buildgrid-csande/action-cache into master

Description

This MR implements a basic action cache as described in #37 (closed). The action cache is enabled by default whenever CAS is enabled.

Changes proposed in this merge request:

An ActionCache class has been added that implements an action cache. It stores ActionResults in CAS and keeps an in-memory dictionary mapping action digests to action result digests. (Currently, there's no way to store the digest->digest mapping anywhere except in memory.)

Two command-line options have been added to bgd server start:

  • --max-cached-actions controls the maximum number of entries in the action cache's dictionary. (It can be set to zero, in which case no actions will ever be cached.)
  • --forbid-update-action-result prevents clients from calling UpdateActionResult to manually edit cache entries.

ActionCacheService APIs no longer return UNIMPLEMENTED statuses all the time, and Execute will no longer reject requests that set skip_cache_lookup to false.

The Scheduler class has been modified to support using an action cache, and the Job class has been modified to keep track of its Action's digest.

This merge request, when approved, will close issue/bug:

Closes #37 (closed).

Author is @cartr , I simply rebased and added a small fix.

Merge request reports