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 credentials, work plugins list, and others).

Configuration file for administrator

# LUNA Faces 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

[LUNA_FACES_DB]

#: [string] type of database: postgres, oracle, default postgres
DB_TYPE = postgres
#: [string] login to database
DB_USER = luna
#: [string] password to database
DB_PASSWORD = luna
#: [string] ip-address of database
DB_HOST = 127.0.0.1
#: [integer] database listener port, 5432 - default for Postgres, 1521 - default for Oracle
DB_PORT = 5432
#: [string] name of database for postgres, SID name for Oracle
DB_NAME = luna_faces

[LUNA_ATTRIBUTES_DB]

#: [string] login to database
PASSWORD =
#: [string] ip-address of database
HOST = 127.0.0.1
#: [integer] database listener port, 5432 - default for Postgres, 1521 - default for Oracle
PORT = 6379
#: [integer] redis database number (0-15)
NUMBER = 0

[LUNA_ATTRIBUTES_DB.SENTINEL]
#: [string] sentinel master name
MASTER_NAME = luna_attributes
#: [list[string] list redis sentinel listeners (example [127.0.0.1:26379, 10.0.4.1:26379])
SENTINELS = []

[ATTRIBUTES_STORAGE_POLICY]
#: [integer] default time to live of temporary attributes (in seconds), default: 5 minutes
DEFAULT_TTL = 300
#: [integer] maximum time to live of temporary attributes (in seconds), default: 1 day
MAX_TTL = 86400

[LUNA_FACES_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


[INFLUX_MONITORING]

#: [integer] whether to 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


[OTHER]

#: [integer] database number; set 0 if replication is disabled; for more information see 'replication' in sphinx documentation.
DATABASE_NUMBER = 0
#: [string] default descriptor version to work with
DEFAULT_FACE_DESCRIPTOR_VERSION = 56
#: [integer] whether to use materialized views flag; for more information see 'materialized' in sphinx documentation
USE_MATERIAL_VIEWS = 0
#: [integer] maximum number of database connection checks for each request; if DB is unavailable, an error is returned; when <=0 no checks performed
LUNA_FACES_DB_PING_MAX_COUNT = 0
#: [string] time format used in DB entries: LOCAL or UTC
STORAGE_TIME = LOCAL
#: list active plugins
LUNA_FACES_ACTIVE_PLUGINS = []

Extended administrator configuration

Module contains constants.

configs.config.BACKGROUND_REMOVAL_BATCH_SIZE = 10000

objects’ bath size for background removal

configs.config.DATABASE_CONNECTION_POOL_COUNT = 5

size of a connection pool to database

configs.config.DB_CONNECT_TIMEOUT = 5

Connection timeout for database in seconds

configs.config.MAX_FACES_COUNT_TO_REEXTRACT_OR_GC = 1000

max descriptors count to removing at once

configs.config.MAX_JSON_ARRAY_SIZE = 1000

max size of any array in any json in incoming request