All Microservices in GNES¶

GNES v0.0.46: Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network. It enables large-scale index and semantic search for text-to-text, image-to-image, video-to-video and any content form. Visit https://gnes.ai for tutorials and documentations.

usage: gnes [-h] [-v] [--verbose]
            {frontend,encode,index,route,preprocess,grpc,client,compose,healthcheck}
            ...

Named Arguments¶

-v, --version show program’s version number and exit
--verbose

turn on detailed logging for debug

Default: False

GNES sub-commands¶

use “gnes [sub-command] –help” to get detailed information about each sub-command

cli Possible choices: frontend, encode, index, route, preprocess, grpc, client, compose, healthcheck

Sub-commands:¶

frontend¶

start a frontend service

gnes frontend [-h] [--port_in PORT_IN] [--port_out PORT_OUT]
              [--host_in HOST_IN] [--host_out HOST_OUT]
              [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
              [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
              [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
              [--dump_interval DUMP_INTERVAL] [--read_only]
              [--parallel_backend {thread,process}]
              [--num_parallel NUM_PARALLEL]
              [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
              [--check_version] [--identity IDENTITY] [--route_table]
              [--squeeze_pb] [--ctrl_with_ipc] [--grpc_host GRPC_HOST]
              [--grpc_port GRPC_PORT] [--max_message_size MAX_MESSAGE_SIZE]
              [--proxy] [--max_concurrency MAX_CONCURRENCY]
              [--dump_route DUMP_ROUTE]
              [--max_pending_request MAX_PENDING_REQUEST]

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 53453

--port_out

port for output data, default a random port between [49152, 65536]

Default: 62715

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 63220

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: True

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--grpc_host

host address of the grpc service

Default: “0.0.0.0”

--grpc_port

host port of the grpc service

Default: 8800

--max_message_size
 

maximum send and receive size for grpc server in bytes, -1 means unlimited

Default: -1

--proxy, --no-proxy, --no_proxy
 

respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems perfer –no_proxy

Default: False

--max_concurrency
 

maximum concurrent connections allowed

Default: 10

--dump_route dumping route information to a file
--max_pending_request
 

maximum number of pending requests allowed, when exceed wait until we receive the response

Default: 100

encode¶

start an encoder service

gnes encode [-h] [--port_in PORT_IN] [--port_out PORT_OUT] [--host_in HOST_IN]
            [--host_out HOST_OUT]
            [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
            [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
            [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
            [--dump_interval DUMP_INTERVAL] [--read_only]
            [--parallel_backend {thread,process}]
            [--num_parallel NUM_PARALLEL]
            [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
            [--check_version] [--identity IDENTITY] [--route_table]
            [--squeeze_pb] [--ctrl_with_ipc] --yaml_path YAML_PATH
            [--py_path PY_PATH [PY_PATH ...]]

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 59864

--port_out

port for output data, default a random port between [49152, 65536]

Default: 54712

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 53306

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: False

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--yaml_path yaml config of the service, it should be a readable stream, or a valid file path, or a supported class name.
--py_path the file path(s) of an external python module(s).

index¶

start an indexer service

gnes index [-h] [--port_in PORT_IN] [--port_out PORT_OUT] [--host_in HOST_IN]
           [--host_out HOST_OUT]
           [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
           [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
           [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
           [--dump_interval DUMP_INTERVAL] [--read_only]
           [--parallel_backend {thread,process}] [--num_parallel NUM_PARALLEL]
           [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
           [--check_version] [--identity IDENTITY] [--route_table]
           [--squeeze_pb] [--ctrl_with_ipc] --yaml_path YAML_PATH
           [--py_path PY_PATH [PY_PATH ...]] [--sorted_response]
           [--as_response AS_RESPONSE]

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 56714

--port_out

port for output data, default a random port between [49152, 65536]

Default: 54866

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 53795

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: False

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--yaml_path yaml config of the service, it should be a readable stream, or a valid file path, or a supported class name.
--py_path the file path(s) of an external python module(s).
--sorted_response
 

sort the response (if exist) by the score

Default: False

--as_response

convert the message type from request to response after indexing. turn it off if you want to chain other services after this index service.

Default: True

route¶

start a router service

gnes route [-h] [--port_in PORT_IN] [--port_out PORT_OUT] [--host_in HOST_IN]
           [--host_out HOST_OUT]
           [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
           [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
           [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
           [--dump_interval DUMP_INTERVAL] [--read_only]
           [--parallel_backend {thread,process}] [--num_parallel NUM_PARALLEL]
           [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
           [--check_version] [--identity IDENTITY] [--route_table]
           [--squeeze_pb] [--ctrl_with_ipc] --yaml_path YAML_PATH
           [--py_path PY_PATH [PY_PATH ...]] [--sorted_response]
           [--num_part NUM_PART]

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 56678

--port_out

port for output data, default a random port between [49152, 65536]

Default: 49619

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 50675

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: True

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--yaml_path yaml config of the service, it should be a readable stream, or a valid file path, or a supported class name.
--py_path the file path(s) of an external python module(s).
--sorted_response
 

sort the response (if exist) by the score

Default: False

--num_part explicitly set the number of parts of message

preprocess¶

start a preprocessor service

gnes preprocess [-h] [--port_in PORT_IN] [--port_out PORT_OUT]
                [--host_in HOST_IN] [--host_out HOST_OUT]
                [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
                [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
                [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
                [--dump_interval DUMP_INTERVAL] [--read_only]
                [--parallel_backend {thread,process}]
                [--num_parallel NUM_PARALLEL]
                [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
                [--check_version] [--identity IDENTITY] [--route_table]
                [--squeeze_pb] [--ctrl_with_ipc] --yaml_path YAML_PATH
                [--py_path PY_PATH [PY_PATH ...]]

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 56431

--port_out

port for output data, default a random port between [49152, 65536]

Default: 63683

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 49484

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: True

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--yaml_path yaml config of the service, it should be a readable stream, or a valid file path, or a supported class name.
--py_path the file path(s) of an external python module(s).

grpc¶

start a general purpose grpc service

gnes grpc [-h] [--port_in PORT_IN] [--port_out PORT_OUT] [--host_in HOST_IN]
          [--host_out HOST_OUT]
          [--socket_in {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
          [--socket_out {PULL_BIND,PULL_CONNECT,PUSH_BIND,PUSH_CONNECT,SUB_BIND,SUB_CONNECT,PUB_BIND,PUB_CONNECT,PAIR_BIND,PAIR_CONNECT}]
          [--port_ctrl PORT_CTRL] [--timeout TIMEOUT]
          [--dump_interval DUMP_INTERVAL] [--read_only]
          [--parallel_backend {thread,process}] [--num_parallel NUM_PARALLEL]
          [--parallel_type {PUSH_BLOCK,PUSH_NONBLOCK,PUB_BLOCK,PUB_NONBLOCK}]
          [--check_version] [--identity IDENTITY] [--route_table]
          [--squeeze_pb] [--ctrl_with_ipc] [--grpc_host GRPC_HOST]
          [--grpc_port GRPC_PORT] [--max_message_size MAX_MESSAGE_SIZE]
          [--proxy] --pb2_path PB2_PATH --pb2_grpc_path PB2_GRPC_PATH
          --stub_name STUB_NAME --api_name API_NAME

Named Arguments¶

--port_in

port for input data, default a random port between [49152, 65536]

Default: 63735

--port_out

port for output data, default a random port between [49152, 65536]

Default: 51230

--host_in

host address for input

Default: “0.0.0.0”

--host_out

host address for output

Default: “0.0.0.0”

--socket_in

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for input port

Default: PULL_BIND

--socket_out

Possible choices: PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT, SUB_BIND, SUB_CONNECT, PUB_BIND, PUB_CONNECT, PAIR_BIND, PAIR_CONNECT

socket type for output port

Default: PUSH_BIND

--port_ctrl

port for controlling the service, default a random port between [49152, 65536]

Default: 59937

--timeout

timeout (ms) of all communication, -1 for waiting forever

Default: -1

--dump_interval
 

serialize the model in the service every n seconds if model changes. -1 means –read_only.

Default: 5

--read_only

do not allow the service to modify the model, dump_interval will be ignored

Default: False

--parallel_backend
 

Possible choices: thread, process

parallel backend of the service

Default: “thread”

--num_parallel, --replicas
 

number of parallel services running at the same time (i.e. replicas), port_in and port_out will be set to random, and routers will be added automatically when necessary

Default: 1

--parallel_type, --replica_type
 

Possible choices: PUSH_BLOCK, PUSH_NONBLOCK, PUB_BLOCK, PUB_NONBLOCK

parallel type of the concurrent services

Default: PUSH_NONBLOCK

--check_version, --no-check_version, --no_check_version
 

comparing the GNES and proto version of incoming message with local setup, mismatch raise an exception

Default: True

--identity

identity of the service, empty by default

Default: “”

--route_table, --no-route_table, --no_route_table
 

showing a route table with time cost after receiving the result

Default: False

--squeeze_pb, --no-squeeze_pb, --no_squeeze_pb
 

sending bytes and ndarray separately apart from the protobuf message, usually yields better network efficiency

Default: True

--ctrl_with_ipc
 

use ipc protocol for control socket

Default: False

--grpc_host

host address of the grpc service

Default: “0.0.0.0”

--grpc_port

host port of the grpc service

Default: 8800

--max_message_size
 

maximum send and receive size for grpc server in bytes, -1 means unlimited

Default: -1

--proxy, --no-proxy, --no_proxy
 

respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems perfer –no_proxy

Default: False

--pb2_path the path of the python file protocol buffer compiler
--pb2_grpc_path
 the path of the python file generated by the gRPC Python protocol compiler plugin
--stub_name the name of the gRPC Stub
--api_name the api name for calling the stub

client¶

start a GNES client of the selected type

gnes client [-h] {http,cli} ...

GNES client sub-commands¶

use “gnes client [sub-command] –help” to get detailed information about each client sub-command

client Possible choices: http, cli

Sub-commands:¶

http¶

start a client that allows HTTP requests as input

gnes client http [-h] [--grpc_host GRPC_HOST] [--grpc_port GRPC_PORT]
                 [--max_message_size MAX_MESSAGE_SIZE] [--proxy]
                 [--http_port HTTP_PORT] [--http_host HTTP_HOST]
                 [--max_workers MAX_WORKERS] [--top_k TOP_K]
                 [--batch_size BATCH_SIZE]
Named Arguments¶
--grpc_host

host address of the grpc service

Default: “0.0.0.0”

--grpc_port

host port of the grpc service

Default: 8800

--max_message_size
 

maximum send and receive size for grpc server in bytes, -1 means unlimited

Default: -1

--proxy, --no-proxy, --no_proxy
 

respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems perfer –no_proxy

Default: False

--http_port

http port to deploy the service

Default: 80

--http_host

http host to deploy the service

Default: “0.0.0.0”

--max_workers

max workers to deal with the message

Default: 100

--top_k

default top_k for query mode

Default: 10

--batch_size

batch size for feed data for train mode

Default: 2560

cli¶

start a client that allows stdin as input

gnes client cli [-h] [--grpc_host GRPC_HOST] [--grpc_port GRPC_PORT]
                [--max_message_size MAX_MESSAGE_SIZE] [--proxy]
                [--txt_file TXT_FILE | --image_zip_file IMAGE_ZIP_FILE | --video_zip_file VIDEO_ZIP_FILE]
                [--batch_size BATCH_SIZE] --mode {index,query,train}
                [--top_k TOP_K] [--start_doc_id START_DOC_ID]
                [--max_concurrency MAX_CONCURRENCY]
Named Arguments¶
--grpc_host

host address of the grpc service

Default: “0.0.0.0”

--grpc_port

host port of the grpc service

Default: 8800

--max_message_size
 

maximum send and receive size for grpc server in bytes, -1 means unlimited

Default: -1

--proxy, --no-proxy, --no_proxy
 

respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems perfer –no_proxy

Default: False

--txt_file

text file to be used, each line is a doc/query

Default: <_io.TextIOWrapper name=’<stdin>’ mode=’r’ encoding=’UTF-8’>

--image_zip_file
 image zip file to be used, consists of multiple images
--video_zip_file
 video zip file to be used, consists of multiple videos
--batch_size

the size of the request to split

Default: 100

--mode

Possible choices: index, query, train

the mode of the client and the server

--top_k

top_k results returned in the query mode

Default: 10

--start_doc_id

the start number of doc id

Default: 0

--max_concurrency
 

maximum concurrent connections allowed

Default: 10

compose¶

start a GNES Board to visualize YAML configs

gnes compose [-h] [--port PORT] [--name NAME] [--yaml_path YAML_PATH]
             [--html_path HTML_PATH] [--shell_path SHELL_PATH]
             [--swarm_path SWARM_PATH] [--k8s_path K8S_PATH]
             [--graph_path GRAPH_PATH]
             [--shell_log_redirect SHELL_LOG_REDIRECT] [--mermaid_leftright]
             [--docker_img DOCKER_IMG] [--flask | --serve]
             [--http_port HTTP_PORT]

Named Arguments¶

--port

host port of the grpc service

Default: 8800

--name

name of the instance

Default: “GNES app”

--yaml_path

yaml config of the service

Default: <_io.BufferedReader name=’/home/docs/checkouts/readthedocs.org/user_builds/gnes/checkouts/latest/gnes/resources/compose/gnes-example.yml’>

--html_path output path of the HTML file, will contain all possible generations
--shell_path output path of the shell-based starting script
--swarm_path output path of the docker-compose file for Docker Swarm
--k8s_path output path of the docker-compose file for Docker Swarm
--graph_path output path of the mermaid graph file
--shell_log_redirect
 the file path for redirecting shell output. when not given, the output will be flushed to stdout
--mermaid_leftright
 

showing the flow in left-to-right manner rather than top down

Default: False

--docker_img

the docker image used in Docker Swarm & Kubernetes

Default: “gnes/gnes:latest-alpine”

--flask

start a Flask server and serve the composer in interactive mode, aka GNES board

Default: False

--serve

start a basic HTTP server and serve the composer in interactive mode, aka GNES board

Default: False

--http_port

server port for receiving HTTP requests

Default: 8080

healthcheck¶

do health check on any GNES microservice

gnes healthcheck [-h] [--host HOST] --port PORT [--timeout TIMEOUT]
                 [--retries RETRIES]

Named Arguments¶

--host

host address of the checked service

Default: “127.0.0.1”

--port control port of the checked service
--timeout

timeout (ms) of one check, -1 for waiting forever

Default: 1000

--retries

max number of tried health checks before exit 1

Default: 3