Beispiel #1
0
async def _status():
    _info = get_full_version()
    return {
        'jina': _info[0],
        'envs': _info[1],
        'peas': pea_store.status,
        'pods': pod_store.status,
        'flows': flow_store.status,
        'workspaces': workspace_store.status,
        'used_memory': used_memory_readable()
    }
Beispiel #2
0
async def _status():
    _jina, _envs = get_full_version()
    return {
        'jina': _jina,
        'envs': _envs,
        'workspaces': workspace_store.status,
        'pods': pod_store.status,
        'deployments': deployment_store.status,
        'flows': flow_store.status,
        'used_memory': used_memory_readable(),
    }
Beispiel #3
0
        async def _status():
            """
            Get the status of this Jina service.

            This is equivalent to running `jina -vf` from command line.

            .. # noqa: DAR201
            """
            _info = get_full_version()
            return {
                'jina': _info[0],
                'envs': _info[1],
                'used_memory': used_memory_readable(),
            }
Beispiel #4
0
        async def _status():
            """
            Get the status of this Jina service.

            This is equivalent to running `jina -vf` from command line.

            .. # noqa: DAR201
            """
            version, env_info = get_full_version()
            for k, v in version.items():
                version[k] = str(v)
            for k, v in env_info.items():
                env_info[k] = str(v)
            return {'jina': version, 'envs': env_info}
Beispiel #5
0
    async def _status(self, empty, context) -> jina_pb2.JinaInfoProto:
        """
        Process the the call requested and return the JinaInfo of the Runtime

        :param empty: The service expects an empty protobuf message
        :param context: grpc context
        :returns: the response request
        """
        infoProto = jina_pb2.JinaInfoProto()
        version, env_info = get_full_version()
        for k, v in version.items():
            infoProto.jina[k] = str(v)
        for k, v in env_info.items():
            infoProto.envs[k] = str(v)
        return infoProto
Beispiel #6
0
def set_base_parser():
    """Set the base parser

    :return: the parser
    """
    from jina import __version__
    from jina.helper import colored, get_full_version, format_full_version_info

    # create the top-level parser
    urls = {
        'Code': ('💻', 'https://github.com/jina-ai/jina'),
        'Docs': ('📖', 'https://docs.jina.ai'),
        'Help': ('💬', 'https://slack.jina.ai'),
        'Hiring!': ('🙌', 'https://career.jina.ai'),
    }
    url_str = '\n'.join(
        f'- {v[0]:<10} {k:10.10}\t{colored(v[1], "cyan", attrs=["underline"])}'
        for k, v in urls.items())

    parser = argparse.ArgumentParser(
        epilog=f'''
Jina (v{colored(__version__, "green")}) is the cloud-native neural search framework powered by deep learning.

{url_str}

''',
        formatter_class=_chf,
        description='Command Line Interface of `%(prog)s`',
    )
    parser.add_argument(
        '-v',
        '--version',
        action='version',
        version=__version__,
        help='Show Jina version',
    )

    parser.add_argument(
        '-vf',
        '--version-full',
        action='version',
        version=format_full_version_info(*get_full_version()),
        help='Show Jina and all dependencies\' versions',
    )
    return parser