Skip to content
Snippets Groups Projects
Commit becd3571 authored by finnball's avatar finnball
Browse files

Added ReferenceCache parser.

Added refrence storage to cas config.
parent eb959e27
No related branches found
No related tags found
Loading
Pipeline #30370557 passed
......@@ -7,7 +7,7 @@ server:
tls-client-certs: null
description: |
Just a CAS.
Just a CAS with some reference storage.
instances:
- name: main
......@@ -24,3 +24,8 @@ instances:
- !bytestream
storage: *main-storage
- !reference-cache
storage: *main-storage
max_cached_refs: 256
allow_updates: true
......@@ -23,6 +23,7 @@ import yaml
from buildgrid.server.controller import ExecutionController
from buildgrid.server.actioncache.storage import ActionCache
from buildgrid.server.referencestorage.storage import ReferenceCache
from buildgrid.server.cas.instance import ByteStreamInstance, ContentAddressableStorageInstance
from buildgrid.server.cas.storage.disk import DiskStorage
from buildgrid.server.cas.storage.lru_memory_cache import LRUMemoryCache
......@@ -126,10 +127,18 @@ class Action(YamlFactory):
yaml_tag = u'!action-cache'
def __new__(cls, storage, max_cached_refs=0, allow_updates=True):
def __new__(cls, storage, max_cached_refs, allow_updates=True):
return ActionCache(storage, max_cached_refs, allow_updates)
class Reference(YamlFactory):
yaml_tag = u'!reference-cache'
def __new__(cls, storage, max_cached_refs, allow_updates=True):
return ReferenceCache(storage, max_cached_refs, allow_updates)
class CAS(YamlFactory):
yaml_tag = u'!cas'
......@@ -160,9 +169,9 @@ def _parse_size(size):
def get_parser():
yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
yaml.SafeLoader.add_constructor(Action.yaml_tag, Action.from_yaml)
yaml.SafeLoader.add_constructor(Reference.yaml_tag, Reference.from_yaml)
yaml.SafeLoader.add_constructor(Disk.yaml_tag, Disk.from_yaml)
yaml.SafeLoader.add_constructor(LRU.yaml_tag, LRU.from_yaml)
yaml.SafeLoader.add_constructor(S3.yaml_tag, S3.from_yaml)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment