t.Key("storage-proxy"): t.Dict(
     {
         t.Key("node-id"): t.String,
         t.Key("num-proc", default=_max_cpu_count): t.Int[1:_max_cpu_count],
         t.Key("pid-file", default=os.devnull): tx.Path(
             type="file",
             allow_nonexisting=True,
             allow_devnull=True,
         ),
         t.Key("event-loop", default="asyncio"): t.Enum("asyncio", "uvloop"),
         t.Key("scandir-limit", default=1000): t.Int[0:],
         t.Key("max-upload-size", default="100g"): tx.BinarySize,
         t.Key("secret"): t.String,  # used to generate JWT tokens
         t.Key("session-expire"): tx.TimeDuration,
         t.Key("user", default=None): tx.UserID(
             default_uid=_file_perm.st_uid,
         ),
         t.Key("group", default=None): tx.GroupID(
             default_gid=_file_perm.st_gid,
         ),
     },
 ),
 t.Key("logging"): logging_config_iv,
 t.Key("api"): t.Dict(
     {
         t.Key("client"): t.Dict(
             {
                 t.Key("service-addr"): tx.HostPortPair(
                     allow_blank_host=True,
                 ),
                 t.Key("ssl-enabled"): t.ToBool,
Example #2
0
_RESERVED_VFOLDER_PATTERNS = [r'^\.[a-z0-9]+rc$', r'^\.[a-z0-9]+_profile$']
RESERVED_DOTFILES = ['.terminfo', '.jupyter', '.ssh', '.ssh/authorized_keys', '.local', '.config']
RESERVED_VFOLDERS = ['.terminfo', '.jupyter', '.tmux.conf', '.ssh']
RESERVED_VFOLDER_PATTERNS = [re.compile(x) for x in _RESERVED_VFOLDER_PATTERNS]

manager_local_config_iv = t.Dict({
    t.Key('db'): t.Dict({
        t.Key('type', default='postgresql'): t.Enum('postgresql'),
        t.Key('addr'): tx.HostPortPair,
        t.Key('name'): tx.Slug[2:64],
        t.Key('user'): t.String,
        t.Key('password'): t.String,
    }),
    t.Key('manager'): t.Dict({
        t.Key('num-proc', default=_max_cpu_count): t.Int[1:_max_cpu_count],
        t.Key('user', default=None): tx.UserID(default_uid=_file_perm.st_uid),
        t.Key('group', default=None): tx.GroupID(default_gid=_file_perm.st_gid),
        t.Key('service-addr', default=('0.0.0.0', 8080)): tx.HostPortPair,
        t.Key('heartbeat-timeout', default=5.0): t.Float[1.0:],  # type: ignore
        t.Key('secret', default=None): t.Null | t.String,
        t.Key('ssl-enabled', default=False): t.ToBool,
        t.Key('ssl-cert', default=None): t.Null | tx.Path(type='file'),
        t.Key('ssl-privkey', default=None): t.Null | tx.Path(type='file'),
        t.Key('event-loop', default='asyncio'): t.Enum('asyncio', 'uvloop'),
        t.Key('pid-file', default=os.devnull): tx.Path(type='file',
                                                       allow_nonexisting=True,
                                                       allow_devnull=True),
        t.Key('hide-agents', default=False): t.Bool,
        t.Key('importer-image', default='lablup/importer:manylinux2010'): t.String,
    }).allow_extra('*'),
    t.Key('docker-registry'): t.Dict({
Example #3
0
manager_config_iv = t.Dict({
    t.Key('db'):
    t.Dict({
        t.Key('type', default='postgresql'): t.Enum('postgresql'),
        t.Key('addr'): tx.HostPortPair,
        t.Key('name'): tx.Slug[2:64],
        t.Key('user'): t.String,
        t.Key('password'): t.String,
    }),
    t.Key('manager'):
    t.Dict({
        t.Key('num-proc', default=_max_cpu_count):
        t.Int[1:_max_cpu_count],
        t.Key('user', default=None):
        tx.UserID(default_uid=_file_perm.st_uid),
        t.Key('group', default=None):
        tx.GroupID(default_gid=_file_perm.st_gid),
        t.Key('service-addr', default=('0.0.0.0', 8080)):
        tx.HostPortPair,
        t.Key('event-listen-addr', default=('127.0.0.1', 5002)):
        tx.HostPortPair,
        t.Key('heartbeat-timeout', default=5.0):
        t.Float[1.0:],  # type: ignore
        t.Key('secret', default=None):
        t.Null | t.String,
        t.Key('ssl-enabled', default=False):
        t.Bool | t.StrBool,
        t.Key('ssl-cert', default=None):
        t.Null | tx.Path(type='file'),
        t.Key('ssl-privkey', default=None):