Configuration

Options

The service offers two configuration options:

  1. Using the Configurator service.

  2. Utilizing the configuration file.

The service reads settings from the configuration file by default.

You can specify the luna-config option in run command for pulling settings from the Luna Configurator service.

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 pulling has failed, the service will work without applying any changes to the existing configurations.

If check connections with new settings have failed, the service will retry pulling new configurations after 5 seconds. The service will shut down after 5 failed attempts.

Configuration files for administrator

# LUNA Vinder Matcher configuration file

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


[LUNA_VINDER_PROJECTOR_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
#: [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
#: log format
FORMAT=default


[LUNA_MONITORING]

#: [string] storage type
STORAGE_TYPE = clickhouse
#: [integer] send data for monitoring to clickhouse
SEND_DATA_FOR_MONITORING = 1
#: [string] database name
DB_USER = luna
#: [string] clickhouse password
DB_PASSWORD = password
#: [string] clickhouse database name
DB_NAME = luna_monitoring
#: [string] clickhouse IP address
HOST = 127.0.0.1
#: [integer] clickhouse port
PORT = 8123
#: [integer] Whether to use HTTPS to connect to Monitoring database
USE_SSL = 0
#: [integer] frequency of sending monitoring data to the database (in seconds)
FLUSHING_PERIOD = 1


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


[LUNA_SERVICE_METRICS]

#: [int] whether to enable /metrics path and statistics collection
ENABLED = 0
# [string] statistics data format (prometheus is the only option yet)
METRICS_FORMAT = prometheus


[LUNA_SERVICE_METRICS.EXTRA_LABELS]


[LUNA_VINDER_DB]

#: [string] type of database: "postgres" type is used by default
DB_TYPE = postgres
#: [string] database username
DB_USER = luna
#: [string] database password
DB_PASSWORD = luna
#: [string] database IP address
DB_HOST = 127.0.0.1
#: [integer] database listener port, 5432 - default for "postgres" type
DB_PORT = 5432
#: [string] database name for "postgres" type
DB_NAME = luna_vinder_projections

[LUNA_VINDER_DB.DB_SETTINGS]

#: [integer] database connection pool size
CONNECTION_POOL_SIZE = 5
# LUNA Vinder Matcher configuration file

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


[LUNA_VINDER_MATCHER_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
#: [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
#: log format
FORMAT=default


[LUNA_MONITORING]

#: [string] storage type
STORAGE_TYPE = clickhouse
#: [integer] send data for monitoring to clickhouse
SEND_DATA_FOR_MONITORING = 1
#: [string] database name
DB_USER = luna
#: [string] clickhouse password
DB_PASSWORD = password
#: [string] clickhouse database name
DB_NAME = luna_monitoring
#: [string] clickhouse IP address
HOST = 127.0.0.1
#: [integer] clickhouse port
PORT = 8123
#: [integer] Whether to use HTTPS to connect to Monitoring database
USE_SSL = 0
#: [integer] frequency of sending monitoring data to the database (in seconds)
FLUSHING_PERIOD = 1


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


[LUNA_SERVICE_METRICS]

#: [int] whether to enable /metrics path and statistics collection
ENABLED = 0
# [string] statistics data format (prometheus is the only option yet)
METRICS_FORMAT = prometheus


[LUNA_SERVICE_METRICS.EXTRA_LABELS]


[ADDITIONAL_SERVICES_USAGE]

#: [integer] LUNA Events usages
LUNA_EVENTS = 1
#: [integer] LUNA Faces usages
LUNA_FACES = 1


[LUNA_EVENTS_DB]

#: [string] type of database: "postgres" type is used by default
DB_TYPE = postgres
#: [string] database username
DB_USER = luna
#: [string] database password
DB_PASSWORD = luna
#: [string] database IP address
DB_HOST = 127.0.0.1
#: [integer] database listener port, 5432 - default for "postgres" type
DB_PORT = 5432
#: [string] database name for "postgres" type
DB_NAME = luna_events

[LUNA_EVENTS_DB.DB_SETTINGS]

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


[LUNA_VINDER_PROJECTOR_ADDRESS]

#: [string] Luna Vinder Projection protocol, IP address, and port
ORIGIN = http://127.0.0.1:5260
#: [integer] API version of the Luna Vinder Projector
API_VERSION = 1


[LUNA_VINDER_PROJECTOR_TIMEOUTS]

#: [integer] HTTP connection timeout
CONNECT = 30
#: [integer] HTTP request timeout (total)
REQUEST = 60


# [LUNA_VINDER_INDEXES.0]

# #: [integer] projection ID
# PROJECTION_ID = 8af381e7-d0d0-4ef4-886a-785357173b97
# #: [list(string)] collection on index composite fields
# INDEX_COMPOSITE_FIELDS = [source, age]


[LUNA_VINDER_SYNCHRONIZATION]

#: [float] synchronizaition routine period, in seconds
PERIOD = 1
#: [integer] synchronization batch size
BATCH_SIZE = 10000


[LUNA_VINDER_MATCHING]
#: [int] number of threads performing matching
THREAD_COUNT = 16


[OTHER]

#: [integer] default face descriptor version
DEFAULT_FACE_DESCRIPTOR_VERSION = 65
#: [integer] default human body descriptor version
DEFAULT_HUMAN_DESCRIPTOR_VERSION = 116

Extended administrator configuration

Application config with global variables.

Application config with global variables.