[Notes] [Git][BuildGrid/buildgrid][finn/85-ref-parser] Added ReferenceCache parser.



Title: GitLab

finn pushed to branch finn/85-ref-parser at BuildGrid / buildgrid

Commits:

2 changed files:

Changes:

  • buildgrid/_app/settings/cas.yml
    ... ... @@ -7,7 +7,7 @@ server:
    7 7
         tls-client-certs: null
    
    8 8
     
    
    9 9
     description: |
    
    10
    -  Just a CAS.
    
    10
    +  Just a CAS with some reference storage.
    
    11 11
     
    
    12 12
     instances:
    
    13 13
       - name: main
    
    ... ... @@ -24,3 +24,8 @@ instances:
    24 24
     
    
    25 25
           - !bytestream
    
    26 26
             storage: *main-storage
    
    27
    +
    
    28
    +      - !reference-cache
    
    29
    +        storage: *main-storage
    
    30
    +        max_cached_refs: 256
    
    31
    +        allow_updates: true

  • buildgrid/_app/settings/parser.py
    ... ... @@ -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)
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]