Skip to content

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

When preparing the environment, the default configuration file of the Storages service will be used, containing all the default settings for connecting to databases, buckets, etc. If you need to use non-default settings or run LUNA PLATFORM on different servers, you need to edit the configuration file before running the environment preparation command:

vi /var/lib/luna/current/extras/conf/storages_config.conf

If necessary, you can first prepare the environment for the Configurator service, start it, and then prepare the environment for all other services using the settings from the running Configurator service. See the Storages utility manual for examples and detailed information about Storages.

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/ \
dockerhub.visionlabs.ru/luna/storages:v.0.4.37 \
bash -c "luna_prepare prepare all_entities \
    --platform_version=v.5.88.0 \
    --profile=common \
    --config=/srv/storages_config.conf \
    --local-buckets=/srv/local_storage"

Here:

  • 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.
  • -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/storages_config.conf:/srv/storages_config.conf — Command to mount the Storages configuration file.
  • -local-buckets=/srv/local_storage — Named argument containing the directory where the Image Store buckets should be created.
  • --config=/srv/storages_config.conf — Named argument containing the address of the configuration file for use by the Storages service.

Optional services usage#

The listed below services are not mandatory for LP:

  • Events
  • Image Store
  • Tasks
  • Sender
  • Handlers
  • Python Matcher Proxy (disabled by default)
  • Lambda (disabled by default)
  • Video Manager (disabled by default)

Working with the Lambda service is possible only when deploying LUNA PLATFORM services in Kubernetes. See detailed information in the installation manual using Kubernetes.

You can disable them if their functionality is not required for your tasks.

Use the "ADDITIONAL_SERVICES_USAGE" section in the API service settings in the Configurator service to disable unnecessary services.

You can use the dump file provided in the distribution package to enable/disable services before Configurator launch.

vi /var/lib/luna/current/extras/conf/platform_settings.json

Disabling any of the services has certain consequences. For more information, see the "Disableable services" section of the administrator manual.

Storages service will not prepare the environment for services that are disabled in the "ADDITIONAL_SERVICES_USAGE" setting.

Load dump file#

Run the following command to upload the dump file to the Configurator:

docker run \
--rm \
--network=host \
-v /var/lib/luna/current/extras/conf/storages_config.conf:/srv/storages_config.conf \
-v /var/lib/luna/current/extras/conf/platform_settings.json:/srv/platform_settings.json \
dockerhub.visionlabs.ru/luna/storages:v.0.4.37 \
bash -c "luna_prepare load_dump \
    --dump-file=/srv/platform_settings.json \
    --config=/srv/storages_config.conf"

Here:

  • luna_prepare load_dump — Command "load_dump", which enables you to upload a dump file to the Configurator database.
  • -v /var/lib/luna/current/extras/conf/platform_settings.json:/srv/platform_settings.json \ — Command to mount the dump file platform_settings.json.
  • --dump-file=/srv/platform_settings.json — Named argument containing the address of the dump file inside the container.
  • -v /var/lib/luna/current/extras/conf/storages_config.conf:/srv/storages_config.conf — Command to mount the Storages configuration file.
  • --config=/srv/storages_config.conf — Named argument containing the address of the configuration file for use by the Storages service.