... |
... |
@@ -23,6 +23,7 @@ import yaml |
23
|
23
|
|
24
|
24
|
from buildgrid.server.controller import ExecutionController
|
25
|
25
|
from buildgrid.server.actioncache.storage import ActionCache
|
|
26
|
+from buildgrid.server.referencestorage.storage import ReferenceCache
|
26
|
27
|
from buildgrid.server.cas.instance import ByteStreamInstance, ContentAddressableStorageInstance
|
27
|
28
|
from buildgrid.server.cas.storage.disk import DiskStorage
|
28
|
29
|
from buildgrid.server.cas.storage.lru_memory_cache import LRUMemoryCache
|
... |
... |
@@ -126,10 +127,18 @@ class Action(YamlFactory): |
126
|
127
|
|
127
|
128
|
yaml_tag = u'!action-cache'
|
128
|
129
|
|
129
|
|
- def __new__(cls, storage, max_cached_refs=0, allow_updates=True):
|
|
130
|
+ def __new__(cls, storage, max_cached_refs, allow_updates=True):
|
130
|
131
|
return ActionCache(storage, max_cached_refs, allow_updates)
|
131
|
132
|
|
132
|
133
|
|
|
134
|
+class Reference(YamlFactory):
|
|
135
|
+
|
|
136
|
+ yaml_tag = u'!reference-cache'
|
|
137
|
+
|
|
138
|
+ def __new__(cls, storage, max_cached_refs, allow_updates=True):
|
|
139
|
+ return ReferenceCache(storage, max_cached_refs, allow_updates)
|
|
140
|
+
|
|
141
|
+
|
133
|
142
|
class CAS(YamlFactory):
|
134
|
143
|
|
135
|
144
|
yaml_tag = u'!cas'
|
... |
... |
@@ -160,9 +169,9 @@ def _parse_size(size): |
160
|
169
|
|
161
|
170
|
def get_parser():
|
162
|
171
|
|
163
|
|
- yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
|
164
|
172
|
yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
|
165
|
173
|
yaml.SafeLoader.add_constructor(Action.yaml_tag, Action.from_yaml)
|
|
174
|
+ yaml.SafeLoader.add_constructor(Reference.yaml_tag, Reference.from_yaml)
|
166
|
175
|
yaml.SafeLoader.add_constructor(Disk.yaml_tag, Disk.from_yaml)
|
167
|
176
|
yaml.SafeLoader.add_constructor(LRU.yaml_tag, LRU.from_yaml)
|
168
|
177
|
yaml.SafeLoader.add_constructor(S3.yaml_tag, S3.from_yaml)
|