jina gateway

Start a Jina gateway that receives client remote requests via gRPC

usage: jina gateway [-h] [--name] [--log-config] [--show-exc-info]
                    [--port-ctrl] [--ctrl-with-ipc] [--timeout-ctrl]
                    [--ssh-server] [--ssh-keyfile] [--ssh-password] [--uses]
                    [--py-modules [PATH [PATH ...]]] [--port-in] [--port-out]
                    [--host-in] [--host-out]
                    [--socket-in {PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT ... 8 more choices}]
                    [--socket-out {PULL_BIND, PULL_CONNECT, PUSH_BIND, PUSH_CONNECT ... 8 more choices}]
                    [--max-socket-retries] [--dump-interval] [--read-only]
                    [--separated-workspace] [--memory-hwm]
                    [--skip-on-error {NONE, EXECUTOR, HANDLE}]
                    [--max-message-size] [--proxy] [--prefetch]
                    [--prefetch-on-recv] [--restful] [--host] [--port-expose]
                    [--daemon] [--runtime-backend {THREAD, PROCESS}]
                    [--runtime-cls {GRPCRuntime, RESTRuntime, ContainerRuntime, JinadRuntime ... 2 more choices}]
                    [--timeout-ready] [--env [KEY=VALUE [KEY=VALUE ...]]]
                    [--expose-public]

Essential arguments

--name

the name of this Pea, used to identify the pea/pod and its logs.

Default: “gateway”

--log-config

the yaml config of the logger. note the executor inside will inherit this log config

Default: “/home/runner/work/jina/jina/jina/resources/logging.default.yml”

--show-exc-info

if true then exception stack information to be added to the logging message, useful in debugging

Default: False

ZMQRuntime arguments

--port-ctrl

port for controlling the runtime, default a random port between [49152, 65535]

Default: 46903

--ctrl-with-ipc

use ipc protocol for control socket

Default: True

--timeout-ctrl

timeout (ms) of the control request, -1 for waiting forever

Default: 5000

--ssh-server

the SSH server through which the tunnel will be created, can actually be a fully specified “user@server:port” ssh url.

--ssh-keyfile

this specifies a key to be used in ssh login, default None. regular default ssh keys will be used without specifying this argument.

--ssh-password

ssh password to the ssh server.

ZEDRuntime arguments

--uses

the config of the executor, it could be > a YAML file path, > an executor’s class name, > a docker image (must start with docker://)> one of “_pass”, “_logforward” > the raw content of YAML config (must starts with “!”)

Default: “_pass”

--py-modules

the customized python modules need to be imported before loading the executor

--port-in

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

Default: 42209

--port-out

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

Default: 33279

--host-in

host address for input, by default it is 0.0.0.0

Default: “0.0.0.0”

--host-out

host address for output, by default it is 0.0.0.0

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, ROUTER_BIND, DEALER_CONNECT

socket type for input port

Default: 1

--socket-out

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

socket type for output port

Default: 3

--max-socket-retries

max number of retries when socket is conflict

Default: 3

--dump-interval

serialize the model in the pod every n seconds if model changes. -1 means –read-only.

Default: 240

--read-only

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

Default: True

--separated-workspace

the data and config files are separated for each pea in this pod, only effective when BasePod’s parallel > 1

Default: False

--memory-hwm

memory high watermark of this pod in Gigabytes, pod will restart when this is reached. -1 means no restriction

Default: -1

--skip-on-error

Possible choices: NONE, EXECUTOR, HANDLE

skip strategy on error message.

Default: 0

GRPC/REST arguments

--max-message-size

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

Default: -1

--proxy

respect the http_proxy and https_proxy environment variables. otherwise, it will unset these proxy variables before start. gRPC seems to prefer no proxy

Default: False

--prefetch

the number of pre-fetched requests from the client

Default: 50

--prefetch-on-recv

the number of additional requests to fetch on every receive

Default: 1

--restful, --rest-api

use RESTful interface instead of gRPC as the main interface

Default: False

Expose arguments

--host

host address of the runtime, by default it is 0.0.0.0.

Default: “0.0.0.0”

--port-expose

host port exposed to the public

Default: 35561

Pea arguments

--daemon

the Pea attempts to terminate all of its Runtime child processes/threads on existing. setting it to true basically tell the Pea do not wait on the Runtime when closing

Default: False

--runtime-backend, --runtime

Possible choices: THREAD, PROCESS

the parallel backend of the runtime inside the pea

Default: 1

--runtime-cls

Possible choices: GRPCRuntime, RESTRuntime, ContainerRuntime, JinadRuntime, SSHRuntime, ZEDRuntime

the runtime class to run inside the pea

Default: “GRPCRuntime”

--timeout-ready

timeout (ms) of a pea waits for the runtime to be ready, -1 for waiting forever

Default: 10000

--env

a map of environment variables that are available inside runtime

--expose-public

expose the public IP address to remote when necessary, by default it exposesprivate IP address, which only allows accessing under the same network/subnet

Default: False