Environment Variables#
Jina uses a number of environment variables to determine different behaviours. To see all supported environment variables and their current values, run
jina -vf
If you use containerized Executors (including Kubernetes and Docker Compose), you can pass separate environment variables to each Executor in the following way:
jtype: Flow
version: '1'
with: {}
executors:
- name: executor0
port: 49583
env:
JINA_LOG_LEVEL: DEBUG
MYSECRET: ${{ ENV.MYSECRET }}
- name: executor1
port: 62156
env:
JINA_LOG_LEVEL: INFO
CUDA_VISIBLE_DEVICES: 1
from jina import Flow
import os
secret = os.environ['MYSECRET']
f = (
Flow()
.add(env={'JINA_LOG_LEVEL': 'DEBUG', 'MYSECRET': secret})
.add(env={'JINA_LOG_LEVEL': 'INFO', 'CUDA_VISIBLE_DEVICES': 1})
)
f.save_config("envflow.yml")
See Also
For more information about the environment variable syntax used in Jina YAML configurations, see here.
The following environment variables are used internally in Jina:
Environment variable |
Description |
---|---|
|
Authentication token of Jina Cloud |
|
The default host where the server is exposed |
|
The default timeout time used by Flow to check the readiness of Executors |
|
The name of the deployment, used by the Head Runtime in Kubernetes to connect to different deployments |
|
If set, Jina will not use uvloop event loop for concurrent execution |
|
If set, all the CLI options will be shown in help |
|
Used when exporting a Flow to Kubernetes or docker-compose to override the default gateway image |
|
Set by the grpc service to keep track of the received bytes |
|
Set by the grpc service to keep track of the sent bytes |
|
The configuration used for the logger |
|
The logging level used: INFO, DEBUG, WARNING |
|
If set, disables color from rich console |
|
Sets the multiprocessing start method used by jina |
|
The max port number used when selecting random ports to apply for Executors or gateway |
|
The min port number used when selecting random ports to apply for Executors or gateway |
|
The root folder where file locks for concurrent Executor initialization |
|
If set, disables telemetry |