Skip to content

Services launch#

This section gives examples for:

  • Databases tables creation
  • Buckets creation
  • Launching of containers

The commands are given in the order they must be performed.

It is recommended to launch containers one by one and wait for the container status to become "up" (use the docker ps command).

See the "Docker commands" section for details about working with containers.

General container launching parameters#

When launching a Docker container for a LUNA PLATFORM service you should specify additional parameters required for the service launching.

The parameters specific for a particular container are described in the section about this container launching.

All the parameters given in the service launching example are required for proper service launching and utilization.

Login to registry#

When launching containers, you should specify a link to the image required for the container launching. This image will be downloaded from the VisionLabs registry. Before that, you should login to the registry.

Enter login .

After running the command, you will be prompted for a password. Enter password.

The login and password are received from VisionLabs.

In the docker login command, you can enter the login and password at the same time, but this does not guarantee security because the password can be seen in the command history.

Description of launch parameters#

Common parameters for launching containers are described in this section.

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=<Port_of_the_launched_service> \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/<service>:/srv/logs/ \
--name=<service_container_name> \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/<service-name>:<version>

docker run - the command for running the selected image as a new container.

dockerhub.visionlabs.ru/luna/<service-name>:<version> - the parameter specifies the image required for the container launching.

Links to download the container images you need are available in the description of the corresponding container launching.

--network=host - the parameter specifies that a network is not simulated and the server network is used. If you need to change the port for third-party party containers, you should change this string to -p 5440:5432. Where the first port 5440 is the local port and 5432 is the port used inside the container. The example is given for PostgreSQL.

--env= - the parameter specifies the environment variables required to run a container. The following general values are specified:

  • CONFIGURATOR_HOST=127.0.0.1 - the host where the Configurator service is running. The localhost is set in the case when the container is launched on the same server with the Configurator service.

  • CONFIGURATOR_PORT=5070 - the port where the Configurator service is listening. The 5070 port is used by default.

  • PORT=<Port_of_the_service> - the port where the service will listen.

  • WORKER_COUNT - specifies the number of worker processes for the service.

  • RELOAD_CONFIG enables auto-reload of configurations for the service when set to "1". See the "Automatic configurations reload" section in the LUNA PLATFORM 5 administrator manual.

  • RELOAD_CONFIG_INTERVAL specifies the configurations check period (10 seconds by default). See the "Automatic configurations reload" section in the LUNA PLATFORM 5 administrator manual.

--name=<service_container_name> - the parameter specifies the name of the launched container. The name must be unique. If there is a container with the same name, an error will occur.

--restart=always - the parameter specifies a restart policy. The daemon will always restart the container regardless of the exit status.

--detach=true - run the container in the background mode.

-v - the volume parameter enables you to mount the content of a server folder into a volume in the container. Thus their contents will synchronize. The following general data is mounted:

  • /etc/localtime:/etc/localtime:ro - sets the current time zone used by the system in the container.
  • /tmp/logs/<service>:/srv/logs/ - enables copying of the folder with service logs to your server /tmp/logs/<service> directory. You can change the directory where the logs will be saved according to your needs.

Description of database creation parameters#

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/<service>:/srv/logs/ \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/<service-name>:<version> \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

The following parameters are used when containers are launched for database migration and creation procedures.

--rm - the parameter specifies if the container is deleted after all the specified scripts finish processing

python3 ./base_scripts/db_create.py - the parameter specifies Python version and a script db_create.py launched in the container. The script is used for the database structure creation. --luna-config http://localhost:5070/1 - the parameter specifies where the launched script should receive configurations. By default, the service requests configurations from the Configurator service.

Monitoring configuration#

InfluxDB OSS 2#

InfluxDB 2.0.8-alpine is required for LP monitoring purpose with data visualization using Grafana (for more information, see the "Monitoring" section in the administrator’s manual).

Note! If you already have InfluxDB 2.0.8-alpine installed, skip this step.

Run InfluxDB container#

Use the docker run command with these parameters:

docker run \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_BUCKET=luna_monitoring \
-e DOCKER_INFLUXDB_INIT_USERNAME=luna \
-e DOCKER_INFLUXDB_INIT_PASSWORD=password \
-e DOCKER_INFLUXDB_INIT_ORG=luna \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDU mmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA== \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/current/example-docker/influx:/var/lib/influxdb2 \
--restart=always \
--detach=true \
--network=host \
--name influxdb \
dockerhub.visionlabs.ru/luna/influxdb:2.0.8-alpine

Monitoring parameters configuration#

Enable monitoring for services using Influx DB.

Configure access to Influx DB in configurations of Python services in the INFLUX_MONITORING section.

Monitoring for the services is enabled by default.

Service names in Configurator

Service Service name in Configurator
API luna-api
Faces luna-faces
Image Store luna-image-store
Accounts luna-accounts
Tasks luna-tasks
Events luna-events
Sender luna-sender
Admin luna-admin
Licenses luna-licenses
Python Matcher luna-python-matcher
Handlers luna-handlers
Backport 3 luna-backport3
Backport 4 luna-backport4

The Configurator service itself is configured in the configuration file only:

/var/lib/luna/current/example-docker/luna_configurator/configs/luna_configurator_postgres.conf

The following parameters can be specified for InfluxDB:

SEND_DATA_FOR_MONITORING - enables monitoring for the service.

MONITORING_USE_SSL - enables HTTPS protocol usage for connection to InfluxDB (0 – do not use, 1 – use).

MONITORING_FLUSHING_PERIOD – the frequency of sending monitoring data to InfluxDB.

MONITORING_PORT - InfluxDB port.

MONITORING_HOST - InfluxDB IP address.

MONITORING_ORGANIZATION - Organization name.

MONITORING_TOKEN - Token received after registration.

MONITORING_BUCKET_NAME - Bucket name.

Run third-party services#

This section describes the launching of databases and message queues in docker containers. They must be launched before LP services.

Redis#

If you already have Redis installed, skip this step.

Use the following command to launch Redis.

docker run \
-v /etc/localtime:/etc/localtime:ro \
--name=redis \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/redis:7.0.5-alpine3.16

Configurator#

Optional services usage#

The listed below services are not mandatory for LP. 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.

Optional services

Service Dependent services
Events API, Admin, Handlers, Tasks.
Tasks API, Admin, Handlers
Sender API, Admin, Handlers
Python Matcher Proxy (disabled by default) API, Admin, Handlers, Tasks.

The API service does not depend on the state of the Admin, Backport3, Backport4, User Interface 3 and User Interface 4 services. These services do not need to be changed in the Configurator service, it is enough just not to launch them.

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

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

You must restart a dependent service after changing its parameters if the service was already launched.

Configurator DB creation#

Create the database for the Configurator service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/
  • Create the database

  • Grant privileges to the database user

  • Allow user to authorize in the DB

runuser -u postgres -- psql -c 'CREATE DATABASE luna_configurator;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_configurator TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Configurator DB tables creation#

Use the docker run command with these parameters to create the Configurator database tables.

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/current/example-docker/luna_configurator/configs/luna_configurator_postgres.conf:/srv/luna_configurator/configs/config.conf \
-v /var/lib/luna/current/extras/conf/platform_settings.json:/srv/luna_configurator/used_dumps/platform_settings.json \
--network=host \
-v /tmp/logs/configurator:/srv/logs \
--rm \
--entrypoint bash \
dockerhub.visionlabs.ru/luna/luna-configurator:v.2.0.74 \
-c "python3 ./base_scripts/db_create.py; cd /srv/luna_configurator/configs/configs/; python3 -m configs.migrate --config /srv/luna_configurator/configs/config.conf head; cd /srv; python3 ./base_scripts/db_create.py --dump-file /srv/luna_configurator/used_dumps/platform_settings.json"

/var/lib/luna/current/extras/conf/platform_settings.json - enables you to specify the path to the dump file with LP configurations.

./base_scripts/db_create.py; - creates database structure.

python3 -m configs.migrate head; - performs settings migrations in Configurator DB and sets revision for migration. The revision will be required during the upgrade to the new LP5 build.

--dump-file /srv/luna_configurator/used_dumps/platform_settings.json - updates settings in the Configurator DB with values from the provided file.

Run Configurator container#

Use the docker run command with these parameters to launch Configurator:

docker run \
--env=PORT=5070 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/current/example-docker/luna_configurator/configs/luna_configurator_postgres.conf:/srv/luna_configurator/configs/config.conf \
-v /tmp/logs/configurator:/srv/logs \
--name=luna-configurator \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-configurator:v.2.0.74 

Configuring InfluxDB#

If you are going to use InfluxDB OSS 2, then you need to update the monitoring settings in Configurator service.

There are the following settings for InfluxDB OSS 2:

"send_data_for_monitoring": 1,
"use_ssl": 0,
"flushing_period": 1,
"host": "127.0.0.1",
"port": 8086,
"organization": "<ORGANIZATION_NAME>",
"token": "<TOKEN>",
"bucket": "<BUCKET_NAME>",
"version": <DB_VERSION>

You can update InfluxDB settings in the Configurator service by following these steps:

  • Open /var/lib/luna/current/extras/conf/influx2.json.
  • Set required data in "organization", "token", "bucket", "version" fields.
  • Save changes.
  • Copy the file to the influxDB container:
docker cp /var/lib/luna/current/extras/conf/influx2.json luna-configurator:/srv/
  • Update settings in the Configurator.
docker exec -it luna-configurator python3 ./base_scripts/db_create.py --dump-file /srv/influx2.json

You can also manually update settings in the Configurator service user interface.

Settings changing#

There are three general ways to change settings stored in the Configurator DB:

  • using Configurator GUI,
  • using Configurator API requests,
  • using dump file.

Settings can be changed after the Configurator service was launched.

The settings of Configurator itself are stored in the "luna_configurator_postgres.conf" file that is downloaded to the Configurator container during its launch.

Configurator Interface

You can enter the configurator GUI and change setting. By default, the following address on localhost are used: <Configurator_server_address>:5070.

Configurator API

You can use Configurator API to update settings. See "ConfiguratorReferenceManual.html".

Dump file

You can receive a dump file with all the LP services settings. Use one of the following commands:

wget -O /var/lib/luna/settings_dump.json 127.0.0.1:5070/1/dump

or

curl 127.0.0.1:5070/1/dump > /var/lib/luna/settings_dump.json

You should specify correct Configurator service address and port.

You should delete the "limitations" section from the file. You will not be able to apply your updated dump file if the section remains.

    "limitations":[
      ...
    ],

Edit parameters in the "settings" section.

    "settings":[
      ...
    ],

Copy the dump file to your Configurator container.

docker cp /var/lib/luna/settings_dump.json luna-configurator:/srv/

Apply the file:

docker exec luna-configurator python3 ./base_scripts/db_create.py --dump-file /srv/settings_dump.json

Enable logging to server directory#

If you want to save service logs in a single directory on your server, you should update services configurations.

Logs are not saved to the server directory by default.

To enable logs saving to the server you should:

  • create a directory for logs (see Create logs directory)
  • enable logs saving and change logs directory in the Configurator service

When logging to file is enabled and configured, service logs are written to the "/srv/logs" directory in the service container and to the specified service directory on the server (e. g., "/tmp/logs").

For more information about the LUNA PLATFORM logging system, see the "Logging" section in the administrator manual.

Change logs directory manually before Configurator launch#

The settings of the Configurator service are stored in file:

/var/lib/luna/current/example-docker/luna_configurator/configs/luna_configurator_postgres.conf

You should change its logging parameters in this file before starting Configurator or restart Configurator after their change.

Change this logging parameter FOLDER_WITH_LOGS = ./ to FOLDER_WITH_LOGS = /srv/logs

Set the "log_to_file" parameter to "True" to enable logging to files.

Change logs directory manually after Configurator launch#

Specify "folder_with_logs" parameter value to "/srv/logs" for all the services where you want to write logs. The docker run commands are already configured for saving logs to your server to this directory. After launching the service container, the service will write logs to the "/srv/logs"directory.

Set the "log_to_file" parameter to "True" to enable logging to files.

Change logs directory using dump file#

You can use the dump file provided in the distribution package to update logging settings.

/var/lib/luna/current/extras/conf/logging.json

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/current/extras/conf/logging.json:/srv/luna_configurator/used_limitations/logging.json \
--network=host \
-v /tmp/logs/configurator:/srv/logs \
--rm \
--entrypoint=python3 \
dockerhub.visionlabs.ru/luna/luna-configurator:v.2.0.74 \
./base_scripts/db_create.py --dump-file /srv/luna_configurator/used_limitations/logging.json

Migration from LUNA PLATFORM 3 to Backport 3#

This section describes accounts, descriptors, and persons migration from LUNA PLATFORM 3 databases to LUNA PLATFORM 5 databases.

Edit configuration file#

You need to set up the following configuration file before starting the migration:

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

Enter the following information:

  • API, Faces, Broker services general parameters (LUNA PLATFORM 3);
  • Backport 3 and Faces services general parameters (LUNA PLATFORM 5);
  • Luna Image Store general parameters;
  • Logging parameters.

Before migration#

  1. The server where the migrations script is launched should have a connection to all the specified databases and the Broker service.

  2. Make sure that the Broker service (LUNA PLATFORM 3) is launched. It is used to get descriptors from the database.

It is not necessary to launch the LUNA PLATFORM 5 services to perform migrations.

  1. The databases with all the required tables should be created for Backport3 and Faces services (LUNA PLATFORM 5) before running migrations. See the installation manuals of corresponding services.

The Faces (LUNA PLATFORM 3) and Faces (LUNA PLATFORM 5) database names are similar by default (luna_faces). You should fix it using one of the following ways:

  • You can use another PostgreSQL for creating a new database for the Faces service (LUNA PLATFORM 5) hence the "luna_faces" name will not be changed. In this case, you should specify the new address of the PostgreSQL database in the "LUNA_FACES_DB" section of the Faces configuration file/Configurator.

  • You can change the default name of the Faces DB (LUNA PLATFORM 5) in the "LUNA_FACES_DB" section of the Faces configuration file/Configurator and database creation commands. For example, set the "luna_faces_5" name.

The second way is described in this manual. The "luna_faces_5" name is set for the base by default. See the "Faces DB creation" section.

Note! Make sure that the databases for the Backport 3 service (LUNA PLATFORM 5) and the Faces service (LUNA PLATFORM 5) are empty (there are no entries) before starting the migration.

Note! Do not launch the creation of database tables for the Faces service before changing the database name/PostgreSQL address in the "LUNA_FACES_DB" section of the Faces service configuration file/Configurator. Otherwise, you can lose the data stored in the Faces database of LUNA PLATFORM 3.

Faces DB creation#

Create the database for the Faces service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/
  • Create a database

  • Grant privileges to the database and the user

  • Enable the user to login into DB

runuser -u postgres -- psql -c 'CREATE DATABASE luna_faces_5;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_faces_5 TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Change the utilized DB#

Now you should specify the "luna_faces_5" DB name in the settings of the Faces service.

  • Go to the Configurator service user interface (http://<server_name>:5070).
  • Select "luna-faces" in the "Service name" filter.
  • Find the "LUNA_FACES_DB" group of settings.
  • Set the "db_name": "luna_faces_5" parameter.
  • Press the [Save] button.

Faces DB tables creation#

Use the following command to create the Faces DB tables:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/faces:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-faces:v.4.6.5 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Backport 3 DB creation#

Create the database for the Backport 3 service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/

The sequence of actions corresponds to the commands below:

  • Create a database
  • Grant privileges to the database and the user
  • Enable the user to login into DB
runuser -u postgres -- psql -c 'CREATE DATABASE luna_backport3;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_backport3 TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Backport 3 BD tables creation#

Use the following command to create DB tables for Backport 3:

docker run \
-v /etc/localtime:/etc/localtime:ro  \
-v /tmp/logs/backport3:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Accounts DB creation#

Create the database for the Accounts service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/
  • Create the database

  • Grant privileges to the database user

  • Allow user to authorize in the DB

runuser -u postgres -- psql -c 'CREATE DATABASE luna_accounts;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_accounts TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Accounts DB tables creation#

Use the following command to create Accounts DB tables:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/accounts:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-accounts:v.0.0.17 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Migration launch#

All the migration procedures are performed using the "start_migration.py" script. See the "Migration script description" section below for additional information about the script.

Add the "luna" owner for the "/var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage".

chown -R 1001:0 /var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage

Run the script using the Backport 3 container:

docker run \
--rm -t \
-v /tmp/logs/backport3:/srv/logs \
-v /var/lib/luna/current/extras/conf/migration_config.conf:/srv/base_scripts/migrate_backport3/config/config.conf \
-v /var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage:/local_storage \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 -c "cd ./base_scripts/migrate_backport3 && pip3 install -r requirements.txt && python3 ./start_migration.py"

You can optionally use the --skip_missing_descriptors parameter, which will enable you to ignore missing descriptors in the LP 3 database.

-v /tmp/logs/backport3:/srv/logs - the script is saving logs to the /srv/logs directory by default. Then the logs are moved to the /tmp/logs/backport3 directory on your server.

The configuration file /var/lib/luna/current/extras/conf/migration_config.conf is added to the container for the script launching.

-v /var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage:/local_storage - the local storage with Image Store samples is added to the container. It is required for the samples migration.

cd ./base_scripts/migrate_backport3 && pip3 install -r requirements.txt && python3 ./start_migration.py - the "requirements.txt" file is required to run the "start_migration.py" script with a set of specified dependencies.

Migration script description#

Data transfer will be performed in the following order:

  • database migration from API (LUNA PLATFORM 3) service to Backport 3 (LUNA PLATFORM 5)
  • database migration from Faces (LUNA PLATFORM 3) to Backport 3 (LUNA PLATFORM 5)
  • database migration from Faces (LUNA PLATFORM 3) to Faces (LUNA PLATFORM 5)
  • updating descriptors in the Faces database (LUNA PLATFORM 5) from the CORE (LUNA PLATFORM 3) database
  • add accounts to samples and optionally portraits in the Luna Image Store storage

When migrating API and Faces service databases, all LP 3 accounts will be migrated and stored in the database of the Accounts service. All migrated accounts will be of type "user". The fields "password", "email" and "organization_name" will be transferred to the "account" table of the Accounts database under new names - "password", "login" and "description" respectively. Tokens will stored in the Backport3 database, but their identifier will also be entered in the Accounts database, where the necessary permissions will be automatically set.

When the script is launched, the "luna-backport3_ERROR_migration.txt" and "luna-backport3_WARNING_migration.txt" files are created. The files include information about all the errors and warnings that occurred during the migration process.

The files are saved to "/srv/logs/" directory of the container.

Run the following script to get help:

docker run --rm -t \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 -c "cd ./base_scripts/migrate_backport3 && pip3 install -r requirements.txt && python3 ./start_migration.py --help"

To start individual migration steps, pass the --migrate command line argument.

The argument takes the following parameters:

  • stage_1 - migrate from API (LUNA PLATFORM 3) and Faces (LUNA PLATFORM 3) databases to Backport 3 (LUNA PLATFORM 5) database
  • stage_2 - migrate from Faces (LUNA PLATFORM 3) database to Faces (LUNA PLATFORM 5) database
  • stage_3 - update descriptors in the Faces (LUNA PLATFORM 5) from the CORE (LUNA PLATFORM 3) database
  • stage_4 - add accounts for samples and optionally portraits (--migrate_portraits flag) in the Luna-Image-Store storage
  • all - perform all the above steps

Code example:

docker run \
--rm -t \
-v /tmp/logs/backport3:/srv/logs \
-v /var/lib/luna/current/extras/conf/migration_config.conf:/srv/base_scripts/migrate_backport3/config/config.conf \
-v /var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage:/local_storage \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 -c "cd ./base_scripts/migrate_backport3 && pip3 install -r requirements.txt && python3 ./start_migration.py --migrate stage_1"

If you are migrating from stage_3, check that the face and attribute tables in the Faces (LUNA PLATFORM 5) database have entries.

If something went wrong during stage_3, use the argument --lower_boundary to specify the last failed face ID to continue migration. The face ID can be found in migration logs.

For example:

docker run --rm -t -v \
/tmp/logs/backport3:/srv/logs \
-v /var/lib/luna/current/extras/conf/migration_config.conf:/srv/base_scripts/migrate_backport3/config/config.conf \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 -c "cd ./base_scripts/migrate_backport3 && pip3 install -r requirements.txt && python3 ./start_migration.py --lower_boundary 02e7b0db-b3c3-4446-bbdd-0f0d9a566058"

Stop LUNA PLATFORM 3 services#

Stop and disable all the LUNA PLATFORM 3 services

systemctl stop luna-image-store luna-faces luna-broker luna-extractor@1 luna-matcher@1 luna-stat-lpse.service luna-stat-sm.service luna-api luna-admin_back luna-admin_tasks aerospike
systemctl disable luna-image-store luna-faces luna-broker luna-extractor@1 luna-matcher@1 luna-stat-lpse.service luna-stat-sm.service luna-api luna-admin_back luna-admin_tasks aerospike
systemctl status luna-image-store luna-faces luna-broker luna-extractor@1 luna-matcher@1 luna-stat-lpse.service luna-stat-sm.service luna-api luna-admin_back luna-admin_tasks aerospike

Image Store#

Samples migrations#

Samples migration is required to add an account for each sample.

Create a backup of all the samples buckets before launching the following script.

Implied that Luna-Image-Store storage from LUNA PLATFORM 3 will be used with LUNA PLATFORM 5. Storage transfer not provided during the migration.

You should use existing buckets during the LUNA PLATFORM 5 Image Store launching.

Change the default bucket used for the samples storage to "visionlabs-warps".

  • Go to the Configurator service user interface (http://<server_name>:5070).
  • Enter "LUNA_IMAGE_STORE_FACES_SAMPLES_ADDRESS" in the "Setting name" filter.
  • Specify the "bucket" name:
"bucket": "visionlabs-warps"

By default, the samples bucket in LUNA PLATFORM 3 was called "visionlabs-warps".

  • Press the [Save] button.

You should specify the current directory with buckets ("/var/lib/luna/luna_v.3.3.8/luna-image-store/luna_image_store/local_storage/" by default) instead of "/var/lib/luna/current/example-docker/image_store/" during the Image Store container launching: -v /var/lib/luna/current/example-docker/image_store/:/srv/local_storage/ See section Image Store container launch.

Portraits migration#

Backport uses samples as portraits by default. Thus it is not required to store portraits and samples simultaneously.

If samples will not be used as portraits, its required to migrate portraits (run migration with --migrate_portraits flag).

If portraits are required, you should turn off the USE_SAMPLES_AS_PORTRAITS setting of Backport 3.

You should follow one of these steps if you are going to use portraits:

  • If you store portraits in the IMAGE STORE service (the SEND_TO_LUNA_IMAGE_STORE setting of the API service in LUNA PLATFORM 3 is enabled), you should set up the LUNA_IMAGE_STORE_PORTRAITS_ADDRESS setting. To do this, use the values of LUNA_IMAGE_STORE_ORIGIN and LUNA_IMAGE_STORE_BUCKET settings that can be found in the configuration file of the API service (LUNA PLATFORM 3).

  • If you use a plugin to store portraits, you should move the existing portraits to the Image Store service of LUNA PLATFORM 5. See the "./docs/ReferenceManuals/ImageStoreReferenceManual.html" document in the LUNA PLATFORM 5 distribution package for details about creating a bucket and saving images to the service.

You can configure all the listed settings in the Configurator service of LUNA PLATFORM 5 or configuration files of the corresponding services (if the Configurator service is not utilized).

Image Store container launch#

Use the following command to launch the Image Store service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5020 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /var/lib/luna/current/example-docker/image_store/:/srv/local_storage/ \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/image-store:/srv/logs \
--name=luna-image-store \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-image-store:v.3.6.17

-v /var/lib/luna/current/example-docker/image_store/:/srv/local_storage/ - the data from the specified folder is added to the Docker container when it is launched. All the data from the specified Docker container folder is saved to this directory.

If you already have a directory with LP buckets you should specify it instead of /var/lib/luna/current/example-docker/image_store/.

Buckets creation#

Buckets are required to store data in Image Store. The Image Store service should be launched before the commands execution.

When upgrading from the previous version, it is recommended to launch the bucket creation commands one more time. Hence you make sure that all the required buckets were created.

If the "error_code":13006,"desc":"Unique constraint error","detail":"Bucket with name 'task-result' already exist"} error appears during launching of the listed above commands, the bucket is already created.

There are two ways to create buckets in LP.

  1. You can run the listed above scripts to create buckets.

Run this script to create general buckets:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/api:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-api:v.6.9.0 \
python3 ./base_scripts/lis_bucket_create.py -ii --luna-config http://localhost:5070/1

If you are going to use the Tasks service, use the following command to additionally create the "task-result" in the Image Store service:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/tasks:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-tasks:v.3.13.0 \
python3 ./base_scripts/lis_bucket_create.py -ii --luna-config http://localhost:5070/1

If you are going to use the portraits, use the following command to additionally create the "portraits".

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/api:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7 \
python3 ./base_scripts/lis_bucket_create.py -ii --luna-config http://localhost:5070/1
  1. You can use direct requests to create required buckets.

The curl utility is required for the following requests.

The "visionlabs-samples" bucket is used for face samples storage. The bucket is required for LP utilization.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=visionlabs-samples

The "portraits" bucket is used for portraits storage. The bucket is required for Backport 3 utilization.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=portraits

The "visionlabs-bodies-samples" bucket is used for human bodies samples storage. The bucket is required for LP utilization.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=visionlabs-bodies-samples

The "visionlabs-image-origin" bucket is used for source images storage. The bucket is required for LP utilization.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=visionlabs-image-origin

The "visionlabs-objects" bucket is used for objects storage. The bucket is required for LP utilization.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=visionlabs-objects

The "task-result" bucket for the Tasks service. Do not use it if you are not going to use the Tasks service.

curl -X POST http://127.0.0.1:5020/1/buckets?bucket=task-result

Accounts#

Accounts container launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5170 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/accounts:/srv/logs \
--name=luna-accounts \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-accounts:v.0.0.17

Licenses#

Licenses container launch#

Make sure that you have specified the license server address in the "hasp_30147.ini" file. See section "Specify license server address for LP".

Add the access right for the "luna" user to the "hasp_redirect" directory.

chown -R 1001:0 /var/lib/luna/current/example-docker/hasp_redirect/

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5120 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/licenses:/srv/logs \
-v /var/lib/luna/current/example-docker/hasp_redirect/hasp_30147.ini:/home/luna/.hasplm/hasp_30147.ini \
--name=luna-licenses \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-licenses:v.0.3.81

Faces#

Create VLMatch function for Faces DB#

The Faces service requires the VLMatch additional function to be added to the utilized database. LUNA PLATFORM cannot perform matching calculations without this function. The VLMatch function can be added to the PostgreSQL or Oracle database.

The VLMatch library is compiled for your particular database version.

Note! Do not use the library built for another version of DB. For example, the library build for the PostgreSQL of version 12 cannot be used for the PostgreSQL of version 9.6.

This section describes the function creation for PostgreSQL.

The instruction for the Oracle DB is given in the "VLMatch for Oracle" section.

Build VLMatch for PostgreSQL#

You can find all the required files for the VLMatch user-defined extension (UDx) compilation in the following directory:

/var/lib/luna/current/extras/VLMatch/postgres/

The following instruction describes installation for PostgreSQL 12.

For VLMatch UDx function compilation one needs to:

  • Make sure, that PostgreSQL of the required version is installed and launched.

  • Install the required PostgreSQL development environment. You can find more information on the official web site.

  • The llvm-toolset-7-clang is required for postgresql12-devel. Install it from the centos-release-scl-rh repository.

yum -y install centos-release-scl-rh
yum -y --enablerepo=centos-sclo-rh-testing install llvm-toolset-7-clang
  • Install epel-release for access to extended package repository
yum -y install epel-release
  • Install the development environment.
yum -y install postgresql12 postgresql12-server postgresql12-devel 
  • Install the gcc-c++ package. The package version 4.8 or higher is required.
yum -y install gcc-c++.x86_64 
  • Install CMAKE. The version 3.5 or higher is required.

  • Open the make.sh script using a text editor. It includes paths to the currently used PostgreSQL version. Change the following values (if necessary):

SDK_HOME specifies the path to PostgreSQL home directory. The default value is /usr/pgsql-12/include/server;

LIB_ROOT specifies the path to PostgreSQL library root directory. The default value is /usr/pgsql-12/lib.

Go to the make.sh script directory and run it:

cd /var/lib/luna/current/extras/VLMatch/postgres/ 
chmod +x make.sh
./make.sh

Add VLMatch function to Faces database#

The VLMatch function should be applied to the PostgreSQL DB.

  • Define the function inside the Faces database:
sudo -u postgres -h 127.0.0.1 -- psql -d luna_faces_5 -c "CREATE FUNCTION VLMatch(bytea, bytea, int) RETURNS float8 AS 'VLMatchSource.so', 'VLMatch' LANGUAGE C PARALLEL SAFE;"
  • Test function by sending re following request to the service database:
sudo -u postgres -h 127.0.0.1 -- psql -d luna_faces_5 -c "SELECT VLMatch('\x1234567890123456789012345678901234567890123456789012345678901234'::bytea, '\x0123456789012345678901234567890123456789012345678901234567890123'::bytea, 32);"

The result returned by the database must be "0.4765625".

Faces container launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5030 \
--env=WORKER_COUNT=2 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/faces:/srv/logs \
--name=luna-faces \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-faces:v.4.6.5

Events#

Events DB creation#

Create the database for the Events service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/
  • Create database

  • Grant privileges to database and the user

  • Enable the user to login into DB

runuser -u postgres -- psql -c 'CREATE DATABASE luna_events;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_events TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Create VLMatch function for Events DB#

The Events service requires the VLMatch additional function to be added to the utilized database. LUNA PLATFORM cannot perform matching calculations without this function. The VLMatch function can be added to the PostgreSQL.

The VLMatch library is compiled for your particular database version.

Note! Do not use the library built for another version of DB. For example, the library build for the PostgreSQL of version 12 cannot be used for the PostgreSQL of version 9.6.

This section describes the function creation for PostgreSQL. If you use the PostgreSQL database, you have already created and moved the created library during the Faces service launch. See section "Build VLMatch UDx".

Add VLMatch function to Events database#

The VLMatch function should be applied to the PostgreSQL DB.

Define the function inside the Events database:

sudo -u postgres -h 127.0.0.1 -- psql -d luna_events -c "CREATE FUNCTION VLMatch(bytea, bytea, int) RETURNS float8 AS 'VLMatchSource.so', 'VLMatch' LANGUAGE C PARALLEL SAFE;"

Test function within call:

sudo -u postgres -h 127.0.0.1 -- psql -d luna_events -c "SELECT VLMatch('\x1234567890123456789012345678901234567890123456789012345678901234'::bytea, '\x0123456789012345678901234567890123456789012345678901234567890123'::bytea, 32);"

The result returned by the database must be "0.4765625".

PostGIS installation for Events#

The Events service requires PostGIS for working with coordinates.

This instruction describes the PostGIS installation for PostgreSQL 12 database. The PostGIS version depends on the PostgreSQL version.

  • Install epel-release for access to extended package repository (necessary for RabbitMQ and other dependencies)
yum -y install epel-release
  • Install PostGIS:
yum -y install postgis25_12
  • Activate PostGIS in your database:
sudo -u postgres -h 127.0.0.1 -- psql -d luna_events -c "CREATE EXTENSION postgis;"; 

See additional information about PostGIS on its website:

https://postgis.net/

Events DB tables creation#

Note. If you are not going to use the Events service, do not launch this container and disable the service utilization in Configurator. See section "Optional services usage".

Use the following command to create the Events DB tables:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/events:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-events:v.4.5.1 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Events container launch#

Note. If you are not going to use the Events service, do not launch this container and disable the service utilization in Configurator. See section "Optional services usage".

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5040 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/events:/srv/logs \
--name=luna-events \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-events:v.4.5.1

Matcher services#

For matching tasks, you can use either only the Python Matcher service, or additionally use the Python Matcher Proxy service, which redirects matching requests to either the Python Matcher service or matching plugins. This section describes how to use Python Matcher without Python Matcher Proxy.

Note. You need to use the Python Matcher Proxy service only if you are going to use matching plugins. Using Python Matcher Proxy and running the corresponding docker container are described in the "Use Python Matcher with Python Matcher Proxy" section.

See the description and usage of matching plugins in the administrator manual.

Use Python Matcher without Python Matcher Proxy#

The Python Matcher service with matching by the Faces DB is enabled by default after launching.

The Python Matcher service with matching by the Events is also enabled by default. You can disable it by specifying USE_LUNA_EVENTS = 0 in the ADDITIONAL_SERVICES_USAGE section. Thus, the Events service will not be used for LUNA PLATFORM.

The Python Matcher that matches using the matcher library is enabled when CACHE_ENABLED is set to "true" in the DESCRIPTORS_CACHE setting.

Note. A single image is downloaded for the Python Matcher service and the Python Matcher Proxy service.

Python Matcher container launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5100 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/python-matcher:/srv/logs \
--name=luna-python-matcher \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-python-matcher:v.1.2.6

Handlers#

Handlers DB creation#

Create the database for the Handlers service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/

The sequence of actions corresponds to the commands below:

  • Create a database
  • Grant privileges to the database and the user
  • Enable the user to login into DB
runuser -u postgres -- psql -c 'CREATE DATABASE luna_handlers;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_handlers TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Handlers DB tables creation#

Use the following command to create the Handlers DB tables:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/handlers:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-handlers:v.2.13.0 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Handlers container launch#

You can run the Handlers service utilizing CPU (set by default) or GPU.

By default, the Handlers service is launched with all estimators and detectors enabled. If necessary, you can disable the use of some estimators or detectors when launching the Handlers container. Disabling unnecessary estimators enables you to save RAM or GPU memory, since when the Handlers service launches, the possibility of performing these estimates is checked and neural networks are loaded into memory. If you disable the estimator or detector, you can also remove its neural network from the Handlers container. See the "Enable/disable several estimators and detectors" section of the administrator manual for more information.

Run the Handlers service using one of the following commands according to the utilized processing unit.

Run Handlers utilizing CPU#

Use the following command to launch the Handlers service using CPU:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5090 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/handlers:/srv/logs \
--name=luna-handlers \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-handlers:v.2.13.0

Run Handlers utilizing GPU#

The Handlers service does not utilize GPU by default. If you are going to use the GPU, then you should enable its use for the Handlers service in the Configurator service.

If you need to use the GPU for all estimators and detectors at once, then you need to use the global_device_class parameter in the "LUNA_HANDLERS_RUNTIME_SETTINGS" section. All estimators and detectors will use the value of this parameter if the device_class parameter of their settings like "LUNA_HANDLERS__SETTINGS.runtime_settings" is set to global (by default for all estimators and detectors).

If you need to use the GPU for a specific estimator or detector, then you need to use the device_class parameter in sections like "LUNA_HANDLERS__SETTINGS.runtime_settings".

See section "Calculations using GPU" for additional requirements for GPU utilization.

Use the following command to launch the Handlers service using GPU:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5090 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--gpus device=0 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/handlers:/srv/logs \
--name=luna-handlers \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-handlers:v.2.13.0
  • --gpus device=0 - the parameter specifies the used GPU device and enables GPU utilization. A single GPU can be utilized per Handlers instance. Multiple GPU utilization per instance is not available.

Tasks#

Note. If you are not going to use the Tasks service, do not launch the Tasks container and the Tasks Worker container. Disable the service utilization in Configurator. See section "Optional services usage".

Tasks DB creation#

Create the database for the Tasks service. It is assumed that the DB user is already created.

Go to the directory.

cd /var/
  • Create the database

  • Grant privileges to the database user

  • Allow user to authorize in the DB

runuser -u postgres -- psql -c 'CREATE DATABASE luna_tasks;'
runuser -u postgres -- psql -c 'GRANT ALL PRIVILEGES ON DATABASE luna_tasks TO luna;'
runuser -u postgres -- psql -c 'ALTER ROLE luna WITH LOGIN;'

Tasks DB tables creation#

Use the following command to create Tasks DB tables:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/tasks:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-tasks:v.3.13.0 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Tasks and Tasks worker containers launch#

Luna Tasks Docker image includes the Tasks service and the Tasks worker. They both must be launched.

The "task-result" bucket should be created for the Tasks service before the service launch. The buckets creation is described in the "Buckets creation".

If it is necessary to use the Estimator task using a network disk, then you should first mount the directory with images from the network disk into special directories of Tasks and Tasks Worker containers. See the "Estimator task" section in the administrator manual for details.

Tasks Worker launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5051 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--env=SERVICE_TYPE="tasks_worker" \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/tasks-worker:/srv/logs \
--name=luna-tasks-worker \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-tasks:v.3.13.0

Tasks launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5050 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/tasks:/srv/logs \
--name=luna-tasks \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-tasks:v.3.13.0

Sender#

Sender container launch#

Note. If you are not going to use the Sender service, do not launch this container and disable the service utilization in Configurator. See section "Optional services usage".

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5080 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/sender:/srv/logs \
--name=luna-sender \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-sender:v.2.5.6

API#

API container launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5000 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--name=luna-api \
--restart=always \
--detach=true \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/api:/srv/logs \
--network=host \
dockerhub.visionlabs.ru/luna/luna-api:v.6.9.0

Admin#

Admin container launch#

Note. If you are not going to use the Admin service, do not launch this container.

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5010 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/admin:/srv/logs \
--name=luna-admin \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-admin:v.4.7.16 

Monitoring data about the number of executed requests is saved in the luna-admin bucket of the InfluxDB. To enable data saving use the following command:

docker exec -it luna-admin python3 ./base_scripts/influx2_cli.py create_usage_task --luna-config http://127.0.0.1:5070/1

Backport 3#

The section describes launching of Backport 3 service.

Note. The service is not mandatory for utilizing LP5 and is required for emulation of LP 3 API only.

Backport 3 container launch#

Use the following command to launch the service:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5140 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--name=luna-backport3 \
--restart=always \
--detach=true \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/backport3:/srv/logs \
--network=host \
dockerhub.visionlabs.ru/luna/luna-backport3:v.0.6.7

User Interface 3#

The User Interface 3 is used with the Backport 3 service only.

User Interface 3 container launch#

Use the following command to launch the service:

docker run \
--env=PORT=4100 \
--env=LUNA_API_URL=http://127.0.0.1:5140 \
--name=luna-ui-3 \
--restart=always \
--detach=true \
--network=host \
-v /etc/localtime:/etc/localtime:ro \
dockerhub.visionlabs.ru/luna/luna3-ui:v.0.5.6

--env=LUNA_API_URL - specifies the URL of the Backport 3 service.

--env=PORT - specifies the port of the User Interface 3 service.

Grafana#

Grafana is required to visualize LP monitoring. You can use it to create dashboards of the LP state (for more information, see the "LUNA Dashboards" section in the administrator's manual).

To work with Grafana you need to use InfluxDB version 2.

Note! If you already have Grafana installed or are not going to use it, skip this step.

Run Grafana container#

Use the docker run command with these parameters to run Grafana:

docker run \
--restart=always \
--detach=true \
--network=host \
--name=grafana \
-v /etc/localtime:/etc/localtime:ro \
dockerhub.visionlabs.ru/luna/luna-dashboards:v.0.0.4

Create dashboards inside the container using the following command:

docker exec -it grafana create_dashboards

Use "http://IP_ADDRESS:3000" to go to the Grafana web interface when the Grafana and Influx containers are running.