Configuration¶
The service allowed two variant of configuration:
- use the Configurator service
- use the configuration file
The service reads settings from the configuration file by default.
You can specify the –luna-config option for pulling settings from the Configurator service, see configurator.
Auto reload configuration¶
The service supports an auto-reload of configurations. You can enable this feature by specifying a config-reload option in the command line. The service periodically checks new settings. If current settings and new pulled settings are the same the service will not perform any actions. You can specify the check period in the pulling-time command line argument (10 seconds by default).
If a configuration fetching has failed, the service will work without applying any changes to the existing configurations.
If check connections with the new configuration have failed, the service will retry pulling new configuration after pulling-time seconds. The service will shut down after 10 failed attempts.
Warning
Service can work incorrectly while the new settings are being applied. It is strongly recommended not to send requests to the service when you change important settings.
During configuration reload any existing HTTP connections to the service will be closed.
Configuration file for administrator¶
# LUNA API configuration file
[LUNA_CONFIGURATOR]
#: [integer] whether to load configs from Configurator
USE_CONFIGURATOR = 0
#: [string] LUNA Configurator protocol, ip-address, and port
LUNA_CONFIGURATOR_ORIGIN = http://127.0.0.1:5070
#: [integer] LUNA Configurator API version
LUNA_CONFIGURATOR_API = 1
[INFLUX_MONITORING]
#: [integer] send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 0
#: [integer] InfluxDB version (1 for InfluxDB 1.x, or 2 for InfluxDB 2.x)
VERSION = 2
#: [string] InfluxDB 2.x workspace
ORGANIZATION =
#: [string] InfluxDB 2.x authentication token
TOKEN =
#: [string] InfluxDB 2.x bucket name
BUCKET = luna_monitoring
#: [string] ip-address of InfluxDB
HOST = 127.0.0.1
#: [integer] port of InfluxDB
PORT = 8086
#: [integer] whether HTTPS should be used for connection to InfluxDB
USE_SSL = 0
#: [integer] frequency of sending monitoring data to InfluxDB (in seconds)
FLUSHING_PERIOD = 1
[LUNA_API_LOGGER]
#: [string] folder, where logs are saved (relative path - begins in directory with application)
FOLDER_WITH_LOGS = ./
#: [string] level of debug print, by priority: ERROR, WARNING, INFO, DEBUG
LOG_LEVEL = INFO
#: [string] time format used in log records: LOCAL or UTC
LOG_TIME = LOCAL
#: [integer] maximum log file size in megabytes before performing rotation (0 - without rotation)
MAX_LOG_FILE_SIZE = 1024
#: send log to stdout
LOG_TO_STDOUT = 1
#: send log to file
LOG_TO_FILE = 1
#: allow a multiline line stack trace message
MULTILINE_STACK_TRACE = 1
[LUNA_FACES_ADDRESS]
#: [string] LUNA Faces protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5030
#: [integer] LUNA Faces API version
API_VERSION = 3
[LUNA_FACES_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_IMAGE_STORE_FACES_SAMPLES_ADDRESS]
#: [string] LUNA Image Store protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5020
#: [integer] LUNA Image Store samples API version
API_VERSION = 1
#: [string] *bucket* name, where samples will be stored
BUCKET = visionlabs-samples
[LUNA_IMAGE_STORE_FACES_SAMPLES_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_IMAGE_STORE_BODIES_SAMPLES_ADDRESS]
#: [string] LUNA Image Store protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5020
#: [integer] LUNA Image Store samples API version
API_VERSION = 1
#: [string] *bucket* name, where samples will be stored
BUCKET = visionlabs-bodies-samples
[LUNA_IMAGE_STORE_BODIES_SAMPLES_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_IMAGE_STORE_IMAGES_ADDRESS]
#: LUNA Image-Store samples origin
ORIGIN = http://127.0.0.1:5020
#: LUNA Image-Store samples api version
API_VERSION = 1
#: *bucket* name, where samples will be stored
BUCKET = visionlabs-image-origin
[LUNA_IMAGE_STORE_IMAGES_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_SENDER_ADDRESS]
#: LUNA Sender origin
ORIGIN = http://127.0.0.1:5080
#: LUNA Sender api version
API_VERSION = 2
[ADDITIONAL_SERVICES_USAGE]
#: [integer] whether to send events to LUNA Events for storing
LUNA_EVENTS = 1
#: [integer] whether to use LUNA Tasks
LUNA_TASKS = 1
#: [integer] whether to use LUNA Python Matcher Proxy instead of LUNA Python Matcher
LUNA_MATCHER_PROXY = 1
#: Whether to use liveness
LIVENESS = 0
#: [integer] whether to use LUNA Sender
LUNA_SENDER = 1
[LUNA_EVENTS_ADDRESS]
#: [string] LUNA Events protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5040
#: [integer] LUNA Events API version
API_VERSION = 2
[LUNA_EVENTS_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_HANDLERS_ADDRESS]
#: [string] LUNA Handlers protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5090
#: [integer] LUNA Handlers API version
API_VERSION = 1
[LUNA_HANDLERS_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_PYTHON_MATCHER_ADDRESS]
#: LUNA Python Matcher origin
ORIGIN = http://127.0.0.1:5100
#: LUNA Python Matcher api version
API_VERSION = 1
[LUNA_PYTHON_MATCHER_TIMEOUTS]
#: CONNECT TIMEOUT
CONNECT = 30
#: REQUEST TIMEOUT (total)
REQUEST = 60
[LIVENESS_ADDRESS]
#: Liveness service
ORIGIN = http://127.0.0.1:5060
[LUNA_MATCHER_PROXY_ADDRESS]
#: LUNA Python Matcher Proxy origin
ORIGIN = http://127.0.0.1:5110
#: LUNA Python Matcher Proxy api version
API_VERSION = 1
[LUNA_PYTHON_MATCHER_PROXY_TIMEOUTS]
#: CONNECT TIMEOUT
CONNECT = 30
#: REQUEST TIMEOUT (total)
REQUEST = 60
[LUNA_TASKS_ADDRESS]
#: [string] LUNA Tasks protocol, ip-address, and port
ORIGIN = http://127.0.0.1:5050
#: [integer] LUNA Tasks API version
API_VERSION = 2
[LUNA_TASKS_TIMEOUTS]
#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60
[LUNA_LICENSES_ADDRESS]
#: LUNA Faces origin
ORIGIN = http://127.0.0.1:5120
#: LUNA Faces api version
API_VERSION = 1
[LUNA_HANDLERS_LIVENESS_SETTINGS]
#: Liveness v2 probability threshold
REAL_THRESHOLD = 0.88
[OTHER]
#: [string] list active plugins
LUNA_API_ACTIVE_PLUGINS = []
#: [integer] indexed lists refresh rate, in seconds, works if USE_INDEX_MANAGER
INDEXED_LISTS_REFRESH_RATE = 60
#: [string] time format used in DB entries: LOCAL or UTC
STORAGE_TIME = LOCAL
#: [integer] default descriptor version to work with
DEFAULT_FACE_DESCRIPTOR_VERSION = 59
Extended administrator configuration¶
Module parses a config file and sets values in the global variables.
-
configs.config.
FETCH_EXTERNAL_IMAGE_CONCURRENCY
= 10¶ concurrency limit for fetching
-
configs.config.
LIVENESS_PREDICT_CONCURRENCY
= 1¶ concurrency limit for predicting
-
configs.config.
LIVENESS_V1_QUALITY_THRESHOLD
= 0.2¶ liveness v1 quality threshold of “appropriate image” in the calculation of aggregate estimates
-
configs.config.
LIVENESS_V2_QUALITY_THRESHOLD
= 0.0¶ liveness v2 quality threshold of “appropriate image” in the calculation of aggregate estimates