gnes.composer.base module

class gnes.composer.base.YamlComposer(args)[source]

Bases: object

class Layer(layer_id: int = 0)[source]

Bases: object

append(comp)[source]
default_values = {'image': None, 'income': 'pull', 'name': None, 'py_path': None, 'replicas': 1, 'yaml_path': None}
get_component_name
static get_value(comp: Dict, key: str)[source]
is_heto_single_component
is_homo_multi_component
is_homogenous
is_single_component
add_comp(comp: Dict) → None[source]
add_layer(layer: Layer = None) → None[source]
build_all()[source]
static build_dockerswarm(all_layers: List[YamlComposer.Layer], docker_img: str = 'gnes/gnes:latest-alpine', volumes: Dict = None, networks: Dict = None) → str[source]
static build_html(generate_dict: Dict[str, str]) → str[source]
static build_kubernetes(all_layers: List[YamlComposer.Layer], *args, **kwargs)[source]
build_layers() → List[gnes.composer.base.YamlComposer.Layer][source]
static build_mermaid(all_layers: List[YamlComposer.Layer], mermaid_leftright: bool = False) → str[source]
static build_shell(all_layers: List[YamlComposer.Layer], log_redirect: str = None) → str[source]
check_fields(comp: Dict) → bool[source]
comp2args = {'Encoder': Namespace(dump_interval=5, host_in='0.0.0.0', host_out='0.0.0.0', num_parallel=1, parallel_backend='thread', parallel_type=<ParallelType.PUSH_NONBLOCK: 1>, port_ctrl=50625, port_in=62003, port_out=60580, py_path=None, read_only=False, socket_in=<SocketType.PULL_BIND: 0>, socket_out=<SocketType.PUSH_BIND: 2>, timeout=-1, verbose=False, yaml_path=<_io.StringIO object>), 'Frontend': Namespace(dump_interval=5, grpc_host='0.0.0.0', grpc_port=8800, host_in='0.0.0.0', host_out='0.0.0.0', max_concurrency=10, max_message_size=100, num_parallel=1, parallel_backend='thread', parallel_type=<ParallelType.PUSH_NONBLOCK: 1>, port_ctrl=59496, port_in=58689, port_out=58217, read_only=True, socket_in=<SocketType.PULL_BIND: 0>, socket_out=<SocketType.PUSH_BIND: 2>, timeout=-1, verbose=False), 'Indexer': Namespace(dump_interval=5, host_in='0.0.0.0', host_out='0.0.0.0', num_parallel=1, parallel_backend='thread', parallel_type=<ParallelType.PUSH_NONBLOCK: 1>, port_ctrl=53209, port_in=49167, port_out=49169, py_path=None, read_only=False, socket_in=<SocketType.PULL_CONNECT: 1>, socket_out=<SocketType.PUB_BIND: 6>, timeout=-1, verbose=False, yaml_path=<_io.StringIO object>), 'Preprocessor': Namespace(dump_interval=5, host_in='0.0.0.0', host_out='0.0.0.0', num_parallel=1, parallel_backend='thread', parallel_type=<ParallelType.PUSH_NONBLOCK: 1>, port_ctrl=58037, port_in=56344, port_out=54085, py_path=None, read_only=True, socket_in=<SocketType.PULL_BIND: 0>, socket_out=<SocketType.PUSH_BIND: 2>, timeout=-1, verbose=False, yaml_path=<_io.StringIO object>), 'Router': Namespace(dump_interval=5, host_in='0.0.0.0', host_out='0.0.0.0', num_parallel=1, num_part=None, parallel_backend='thread', parallel_type=<ParallelType.PUSH_NONBLOCK: 1>, port_ctrl=57527, port_in=56920, port_out=54744, py_path=None, read_only=True, socket_in=<SocketType.PULL_BIND: 0>, socket_out=<SocketType.PUSH_BIND: 2>, timeout=-1, verbose=False, yaml_path=<_io.StringIO object>)}
comp2file = {'Encoder': 'encode', 'Frontend': 'frontend', 'Indexer': 'index', 'Preprocessor': 'preprocess', 'Router': 'route'}
gnes.composer.base.parse_http_data(data, args)[source]