Prepare environment#
The environment is prepared using the Storages service. Using the command below will execute:
- Creating buckets in InfluxDB for monitoring work (if not done previously)
- Creating buckets for the Image Store service (if not done previously)
- Preparing the Influx database for collecting aggregated statistics using the Admin service (if not done previously)
- Creating databases, adding VLMatch functions, creating migration scripts for PostgreSQL databases
- Uploading basic settings to the Configurator database
Select services#
Note: Perform the settings in this section only if you need to launch services that are not included in the standard LUNA PLATFORM configuration.
You can prepare the environment either for each service separately or for all services at once. In this documentation, the environment is prepared with the all_entities
argument, meaning that all entities for the set of services defined in the Storages configuration will be prepared.
However, after preparing the environment, you must enable usage of the corresponding services in the LUNA PLATFORM settings.
Thus, selecting services for preparing the environment and further launch consists of two stages:
- selecting services in the "ADDITIONAL_SERVICE_USAGE" setting in the Storages configuration file so that the Storages utility can prepare all the necessary entities for future services
- selecting services in the "ADDITIONAL_SERVICE_USAGE" setting in the LUNA PLATFORM settings to tell the system which services to use. You can load the setting either using a dump file or in the Configurator settings after it is launched directly.
This documentation uses a dump file as the settings loading file.
As a result, to select services, you need to fill:
You can enable or disable environment updates for the following services:
- Faces
- Events
- Image Store
- Tasks
- Sender
- Handlers
- Remote SDK
- Python Matcher
- Python Matcher Proxy (disabled by default)
- Lambda (disabled by default)
- Video Manager (disabled by default)
- Video Agent (disabled by default)
- Streams Retranslator (disabled by default)
Working with the Lambda service is only possible when deploying LUNA PLATFORM services in Kubernetes. For more information, see the Deploying LP on Kubernetes guide.
Important! Disabling environment updates for core services has implications. For more information, see the "Disableable services" section of the administrator manual.
Setting Storages configuration file#
Note: Skip this section if you want to launch LUNA PLATFORM in a standard configuration.
When preparing the environment, the Storages service configuration file is used, which contains:
- a list of services for which the environment will be prepared
- database connection settings
- bucket connection settings
- S3 connection settings
- monitoring settings
- other
This file must be mounted to the Storages service container and specified in the --config
argument.
As an example, the storages_config.conf
file is mounted, containing standard settings for deploying LUNA PLATFORM in a minimal base configuration.
Edit the Storages configuration file to specify custom settings:
vi /var/lib/luna/current/extras/conf/storages_config.conf
Setting dump file#
Note: Skip this section if you want to launch LUNA PLATFORM in a standard configuration.
Edit the dump file to specify custom settings:
vi /var/lib/luna/current/extras/conf/platform_settings.json
Prepare environment command#
Prepare the environment with the following command:
docker run \
--rm \
--network=host \
-v /var/lib/luna/current/extras/conf/storages_config.conf:/srv/storages_config.conf \
-v /var/lib/luna/image_store/:/srv/local_storage/ \
-v /var/lib/luna/current/extras/conf/platform_settings.json:/srv/platform_settings.json \
dockerhub.visionlabs.ru/luna/storages:v.0.5.35 \
bash -c "luna_prepare prepare all_entities \
--platform_version=v.5.98.0 \
--profile=common \
--config=/srv/storages_config.conf \
--local-buckets=/srv/local_storage \
--dump-file=/srv/platform_settings.json"
Here:
-v /var/lib/luna/current/extras/conf/storages_config.conf:/srv/storages_config.conf
— Command to mount the Storages configuration file.-v /var/lib/luna/image_store/:/srv/local_storage/
— Command to mount a directory with Image Store buckets.-v /var/lib/luna/current/extras/conf/platform_settings.json:/srv/platform_settings.json
— Command to mount the dump fileplatform_settings.json
.luna_prepare prepare all_entities
— — Command "prepare" to prepare all entities.--platform_version
— Named argument containing the LUNA PLATFORM version.--profile
— Named argument containing the profile (list of services)backports
, which means that the environment will be prepared for all services, including Backport 3 and Backport 4 services.--config=/srv/storages_config.conf
— Named argument containing the address of the configuration file for use by the Storages service.-local-buckets=/srv/local_storage
— Named argument containing the directory where the Image Store buckets should be created.--dump-file=/srv/platform_settings.json
— Named argument containing the address of the dump file inside the container