def set_pod_parser(parser=None): """Set the parser for the Pod :param parser: an optional existing parser to build upon :return: the parser """ if not parser: from jina.parsers.base import set_base_parser parser = set_base_parser() from jina.parsers.hubble.pull import mixin_hub_pull_options_parser from jina.parsers.orchestrate.base import mixin_base_ppr_parser from jina.parsers.orchestrate.pod import mixin_pod_parser from jina.parsers.orchestrate.runtimes.container import ( mixin_container_runtime_parser, ) from jina.parsers.orchestrate.runtimes.distributed import ( mixin_distributed_feature_parser, ) from jina.parsers.orchestrate.runtimes.remote import mixin_remote_runtime_parser from jina.parsers.orchestrate.runtimes.worker import mixin_worker_runtime_parser mixin_base_ppr_parser(parser) mixin_worker_runtime_parser(parser) mixin_container_runtime_parser(parser) mixin_remote_runtime_parser(parser) mixin_distributed_feature_parser(parser) mixin_pod_parser(parser) mixin_hub_pull_options_parser(parser) mixin_head_parser(parser) return parser
def set_flow_parser(parser=None): """Set the parser for the flow :param parser: an (optional) initial parser to build upon :return: the parser """ from jina.parsers.orchestrate.base import mixin_base_ppr_parser if not parser: parser = set_base_parser() mixin_base_ppr_parser(parser) mixin_flow_features_parser(parser) return parser
def set_gateway_parser(parser=None): """Set the parser for the gateway arguments :param parser: an optional existing parser to build upon :return: the parser """ if not parser: from jina.parsers.base import set_base_parser parser = set_base_parser() from jina.parsers.orchestrate.base import mixin_base_ppr_parser from jina.parsers.orchestrate.runtimes.worker import mixin_worker_runtime_parser from jina.parsers.orchestrate.runtimes.remote import ( mixin_gateway_parser, mixin_prefetch_parser, mixin_http_gateway_parser, mixin_compressor_parser, ) from jina.parsers.orchestrate.deployment import mixin_base_deployment_parser from jina.parsers.orchestrate.pod import mixin_pod_parser mixin_base_ppr_parser(parser) mixin_worker_runtime_parser(parser) mixin_prefetch_parser(parser) mixin_http_gateway_parser(parser) mixin_compressor_parser(parser) mixin_comm_protocol_parser(parser) mixin_gateway_parser(parser) mixin_pod_parser(parser) mixin_head_parser(parser) from jina.enums import DeploymentRoleType parser.set_defaults( name='gateway', runtime_cls='GRPCGatewayRuntime', deployment_role=DeploymentRoleType.GATEWAY, ) return parser
def get_main_parser(): """ Return main parser :return: main parser """ parser = set_base_parser() mixin_remote_jinad_parser(parser) mixin_base_ppr_parser(parser) mixin_daemon_parser(parser) from jina import __resources_path__ parser.set_defaults( port=8000, workspace='/tmp/jinad', log_config=os.getenv( 'JINAD_LOG_CONFIG', os.path.join(__resources_path__, 'logging.daemon.yml'), ), ) return parser