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-admin configuration file

[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_ADMIN_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_admin
#: 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_ADMIN_DB.DB_SETTINGS]

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


[INFLUX_MONITORING]

#: [integer] send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 1
#: [string] InfluxDB 2.x workspace
ORGANIZATION =
#: [string] InfluxDB 2.x authentication token
TOKEN =
#: [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_ADMIN_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
#: send log to stdout
LOG_TO_STDOUT = 1
#: send log to file
LOG_TO_FILE = 1
#: allow multiline stack trace in logs
MULTILINE_STACK_TRACE = 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_FACES_ADDRESS]

#: LUNA Faces protocol, IP address, and port
ORIGIN = http://127.0.0.1:5030
#: API version of the LUNA Faces
API_VERSION = 3


[LUNA_IMAGE_STORE_FACES_SAMPLES_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 = visionlabs-samples


[LUNA_IMAGE_STORE_BODIES_SAMPLES_ADDRESS]

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


[LUNA_IMAGE_STORE_IMAGES_ADDRESS]

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


[LUNA_IMAGE_STORE_TASK_RESULT_ADDRESS]

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


[LUNA_SENDER_ADDRESS]

#: LUNA Sender protocol, IP address, and port
ORIGIN = http://127.0.0.1:5080
#: API version of the LUNA Sender
API_VERSION = 2


[LUNA_INDEX_MANAGER_ADDRESS]

#: LUNA Index Manager protocol, IP address, and port
ORIGIN = http://127.0.0.1:5060
#: API version of the LUNA Index Manager
API_VERSION = 1


[LUNA_EVENTS_ADDRESS]

#: LUNA Events protocol, IP address, and port
ORIGIN = http://127.0.0.1:5040
#: API version of the LUNA Events
API_VERSION = 2


[LUNA_TASKS_ADDRESS]

#: LUNA Tasks protocol, IP address, and port
ORIGIN = http://127.0.0.1:5050
#: API version of the LUNA Tasks
API_VERSION = 2


[LUNA_HANDLERS_ADDRESS]

#: LUNA Handlers protocol, IP address, and port
ORIGIN = http://127.0.0.1:5090
#: API version of the LUNA Handlers
API_VERSION = 1

[LUNA_PYTHON_MATCHER_ADDRESS]

#: LUNA Python Matcher protocol, IP address, and port
ORIGIN = http://127.0.0.1:5100
#: API version of the LUNA Python Matcher
API_VERSION = 1

[LUNA_MATCHER_PROXY_ADDRESS]

#: LUNA Matcher Proxy protocol, IP address, and port
ORIGIN = http://127.0.0.1:5110
#: API version of the LUNA Matcher Proxy
API_VERSION = 1

[LUNA_LICENSES_ADDRESS]

#: LUNA Licenses protocol, IP address, and port
ORIGIN = http://127.0.0.1:5120
#: API version of the LUNA Licenses
API_VERSION = 1


[LIVENESS_ADDRESS]
#: Liveness service protocol, IP address, and port
ORIGIN = http://127.0.0.1:8080


[QUEUE_SETTINGS]

#: COMMON QUEUE SETTINGS:
#: max count of retry messages
MAX_RETRIES = 5
#: delay step for retry
DELAY_STEP = 10
#: current version API of LUNA Core
api_version = 14
#: total request timeout
REQUEST_TIMEOUT = 30

#: RABBIT MQ SETTINGS
#: queue type: "rabbit"
QUEUE_TYPE = rabbit
#: queue host
HOST = 127.0.0.1
#: queue port, default: 5672 for "rabbit" type
PORT = 5672
#: queue username
USER = luna
#: queue password
PASSWORD = luna

# #: IBM MQ SETTINGS
# #: queue type: "ibmmq"
# QUEUE_TYPE = ibmmq
# #: queue host
# HOST = 127.0.0.1
# #: queue port, default: 1414 for "ibmmq" type
# PORT = 1414
# #: queue username
# USER = luna
# #: queue password
# PASSWORD = luna
# #: IBM MQ manager
# IBM_MANAGER = SATURN.QUEUE.MANAGER
# #: IBM MQ channel
# IBM_CHANNEL = PASSWORD.SVRCONN

# #: SQS SETTINGS
# #: queue type: "sqs"
# QUEUE_TYPE = sqs
# #: AWS public access key
# AWS_PUBLIC_ACCESS_KEY =
# #: AWS secret access key
# AWS_SECRET_ACCESS_KEY =
# #: AWS scheme: "http", "https" or "mqtt"
# AWS_SCHEME = https
# #: AWS authorization signature: "s3v2" or "s3v4"
# AWS_AUTHORIZATION_SIGNATURE = s3v4
# #: AWS endpoint region
# AWS_REGION =
# #: AWS request connection timeout
# AWS_CONNECT_TIMEOUT = 20


[INDEXED_MATCHER_QUEUE]

#: RabbitMQ Exchange for LUNA Core Indexed Matcher
RABBIT_EXCHANGE = luna.match
#: routing key for LUNA Core Indexed Matcher queue
ROUTING_KEY = indexed_matcher


[INDEXER_QUEUE]

#: RabbitMQ Exchange for LUNA Core Indexed Matcher
RABBIT_EXCHANGE = luna.index
#: routing key for LUNA Core Indexed Matcher queue
ROUTING_KEY = indexer


[LUNA_ADMIN_TIMEOUTS]

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


[ADDITIONAL_SERVICES_USAGE]

#: [integer] support LUNA Events service as a data source for tasks
LUNA_EVENTS = 1
#: [integer] support LUNA Tasks service for executing long tasks
LUNA_TASKS = 1
#: [integer] support LUNA Sender service, subscription on events by web sockets
LUNA_SENDER = 0
#: [integer] support matching by indexed lists
INDEXED_MATCHER = 0
#: [integer] support sharded matching
LUNA_MATCHER_PROXY = 1
#: [integer] use Liveness
LIVENESS = 0


[OTHER]

#: list of active plugins for LUNA Admin
LUNA_ADMIN_ACTIVE_PLUGINS = []
#: time format used in database records: "LOCAL" or "UTC"
STORAGE_TIME = LOCAL

Extended administrator configuration

Module sets values in the global variables.

configs.config.ADMIN_ID = '00000000-0000-4000-b000-000000000146'

admin id for creating tasks