Configuration

The service allowed two variant of configuration:

  1. use the Configurator service

  2. 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 (database configuration, work plugins list, and others).

During configuration reload any existing HTTP connections to the service will be closed.

Configuration file for administrator


[LUNA_CONFIGURATOR]
#: load configs from LUNA Configurator
USE_CONFIGURATOR = 0
#: LUNA Configurator protocol, IP address, and port
LUNA_CONFIGURATOR_ORIGIN = http://127.0.0.1:5070
#: API version of the LUNA Configurator
LUNA_CONFIGURATOR_API  = 1


[LUNA_BACKPORT3_LOGGER]

#: folder, where logs are saved
FOLDER_WITH_LOGS = ./
#: level of debug print, by priority: "ERROR", "WARNING", "INFO", "DEBUG"
LOG_LEVEL = INFO
#: time format used in log records: "LOCAL" or "UTC"
LOG_TIME = LOCAL
#: maximum log file size in megabytes before performing rotation (0 - without rotation)
MAX_LOG_FILE_SIZE = 1024
#: [integer] send log to stdout
LOG_TO_STDOUT = 1
#: [integer] send log to file
LOG_TO_FILE = 0
#: [integer] allow multiline stack trace in logs
MULTILINE_STACK_TRACE = 1


[LUNA_BACKPORT3_DB]

#: type of database: "postgres" or "oracle"; "postgres" type is used by default
DB_TYPE = postgres
#: database username
DB_USER = luna
#: database password
DB_PASSWORD = luna
#: database name for "postgres" type, SID name for "oracle" type
DB_NAME = luna_backport3
#: database IP address
DB_HOST = 127.0.0.1
#: database listener port, 5432 - default for "postgres" type, 1521 - default for "oracle" type
DB_PORT = 5432


[LUNA_BACKPORT3_DB.DB_SETTINGS]

#: [integer] database connection pool size
CONNECTION_POOL_SIZE = 5


[INFLUX_MONITORING]

#: send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 1
#: [string] InfluxDB 2.x workspace
ORGANIZATION = luna
#: [string] InfluxDB 2.x authentication token
TOKEN = kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDUmmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA==
#: [string] InfluxDB 2.x bucket name
BUCKET = luna_monitoring
#: [string] InfluxDB IP address
HOST = 127.0.0.1
#: [integer] InfluxDB port
PORT = 8086
#: [integer] use HTTPS to connect to InfluxDB
USE_SSL = 0
#: [integer] frequency of sending monitoring data to InfluxDB (in seconds)
FLUSHING_PERIOD = 1


[LUNA_API_ADDRESS]

#: LUNA API protocol, IP address, and port
ORIGIN = http://127.0.0.1:5000
#: API version of the LUNA API
API_VERSION = 6


[LUNA_API_TIMEOUTS]

#: CONNECT TIMEOUT
CONNECT = 30
#: REQUEST TIMEOUT (total)
REQUEST =  60


[LUNA_IMAGE_STORE_PORTRAITS_ADDRESS]

#: LUNA Image Store protocol, IP address, and port (for samples)
ORIGIN = http://127.0.0.1:5020
#: API version of the LUNA Image Store (for samples)
API_VERSION = 1
#: *bucket* name, where samples will be stored
BUCKET = portraits


[LUNA_IMAGE_STORE_PORTRAITS_TIMEOUTS]

#: CONNECT TIMEOUT
CONNECT = 30
#: REQUEST TIMEOUT (total)
REQUEST =  60


[BACKPORT3_EVENTS_DB_ADDRESS]

#: redis host for the service subscription
HOST = 127.0.0.1
#: redis port for the service subscription
PORT = 6379
#: redis password for the service subscription
PASSWORD =
#: redis channel for the service subscription
CHANNEL = luna-backport3

[LUNA_BACKPORT3_HTTP_SETTINGS]

#: [integer] service request timeout (in seconds)
REQUEST_TIMEOUT = 60
#: [integer] service response timeout (in seconds)
RESPONSE_TIMEOUT = 600
#: [integer] max request size (in bytes), default 1gb
REQUEST_MAX_SIZE = 1073741824
#: [integer] service http keep-alive timeout (in seconds)
KEEP_ALIVE_TIMEOUT = 15

[OTHER]

#: storage time - "LOCAL" or "UTC"
STORAGE_TIME = LOCAL
#: Use samples as portraits
USE_SAMPLES_AS_PORTRAITS = 1
#: Max candidate count into a response on matching request
MAX_CANDIDATE_IN_RESPONSE = 5
#: Whether to enable ws events support
BACKPORT3_ENABLE_WS_EVENTS = 1

Extended administrator configuration

Module to set values in global variables.

configs.config.AUTH_CACHE_MAX_SIZE = 1024

int, maximum number of cached auth

configs.config.AUTH_CACHE_TTL = 60

seconds, time to live for cached auth

configs.config.DEFAULT_HANDLERS_SCORE_THRESHOLD = 0.0

score threshold for new handlers

configs.config.FACES_CONCURRENCY = 10

max number of requests to luna-faces service

configs.config.HANDLERS_CACHE_MAX_SIZE = 1024

int, maximum number of cached handlers

configs.config.HANDLERS_CACHE_POLLING_PERIOD = 10

seconds, cache invalidator polling period

configs.config.HANDLERS_CACHE_TTL = 60

seconds, time to live for cached handlers

configs.config.IDENTIFY_THRESHOLD = 0.9

threshold for /handlers/identify

configs.config.MAX_PORTRAIT_SIZE = 250

max portrait size

configs.config.REDIS_COMMAND_TIMEOUT = 1

Redis command timeout (in seconds)

configs.config.REDIS_PING_INTERVAL = 5

Redis ping interval (in seconds)

configs.config.REDIS_RECONNECTION_DELAY = 1

Redis reconnection delay (in seconds)

configs.config.REDIS_SUBSCRIBE_ATTEMPTS = 3

Redis subscribe attempts count

configs.config.VERIFY_THRESHOLD = 0.9

threshold for /handlers/verify

configs.config.WSCODE_GOING_AWAY = 1001

WebSocket close code for going away