Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(composer): rename grpcfrontend to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 9, 2019
1 parent 55126f2 commit 0d6a5d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gnes/composer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class YamlComposer:
'Encoder': 'encode',
'Router': 'route',
'Indexer': 'index',
'gRPCFrontend': 'frontend',
'Frontend': 'frontend',
'Preprocessor': 'preprocess'
}

comp2args = {
'Encoder': set_loadable_service_parser().parse_args(['--yaml_path', 'BaseEncoder']),
'Router': set_router_service_parser().parse_args(['--yaml_path', 'BaseRouter']),
'Indexer': set_indexer_service_parser().parse_args(['--yaml_path', 'BaseIndexer']),
'gRPCFrontend': set_frontend_parser().parse_args([]),
'Frontend': set_frontend_parser().parse_args([]),
'Preprocessor': set_preprocessor_service_parser().parse_args(['--yaml_path', 'BasePreprocessor'])
}

Expand Down Expand Up @@ -115,7 +115,7 @@ def __init__(self, args):

if 'services' in tmp:
self.add_layer()
self.add_comp(CommentedMap({'name': 'gRPCFrontend', 'grpc_port': self._port}))
self.add_comp(CommentedMap({'name': 'Frontend', 'grpc_port': self._port}))
for comp in tmp['services']:
self.add_layer()
if isinstance(comp, list):
Expand Down Expand Up @@ -158,9 +158,9 @@ def build_layers(self) -> List['YamlComposer.Layer']:
all_layers.append(copy.deepcopy(l))
all_layers[0] = copy.deepcopy(self._layers[0])

# gRPCfrontend should always on the bind role
# Frontend should always on the bind role
assert all_layers[0].is_single_component
assert all_layers[0].components[0]['name'] == 'gRPCFrontend'
assert all_layers[0].components[0]['name'] == 'Frontend'

if all_layers[0].components[0]['socket_in'] == str(SocketType.SUB_CONNECT):
# change to sub bind
Expand Down Expand Up @@ -244,7 +244,7 @@ def build_dockerswarm(all_layers: List['YamlComposer.Layer'], docker_img: str =
and (c['yaml_path'].endswith('.yml') or c['yaml_path'].endswith('.yaml')):
swarm_lines['services'][c_name]['configs'] = ['%s_yaml' % c_name]

if c['name'] == 'gRPCFrontend':
if c['name'] == 'Frontend':
swarm_lines['services'][c_name]['ports'] = ['%d:%d' % (c['grpc_port'], c['grpc_port'])]

if volumes:
Expand Down Expand Up @@ -312,7 +312,7 @@ def build_mermaid(all_layers: List['YamlComposer.Layer'], mermaid_leftright: boo
# if len(last_layer.components) > 1:
# self.mermaid_graph.append('\tend')

style = ['classDef gRPCFrontendCLS fill:#FFE0E0,stroke:#FFE0E0,stroke-width:1px;',
style = ['classDef FrontendCLS fill:#FFE0E0,stroke:#FFE0E0,stroke-width:1px;',
'classDef EncoderCLS fill:#FFDAAF,stroke:#FFDAAF,stroke-width:1px;',
'classDef IndexerCLS fill:#FFFBC1,stroke:#FFFBC1,stroke-width:1px;',
'classDef RouterCLS fill:#C9E8D2,stroke:#C9E8D2,stroke-width:1px;',
Expand Down

0 comments on commit 0d6a5d9

Please sign in to comment.