Skip to content

Services launch#

This section gives examples for:

  • Databases tables migration
  • Buckets creation
  • Launching of containers

LUNA PLATFORM services must be launched in the following sequence:

Next, you need to launch the Backport 3 service and its user interface:

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

Some of these services are optional and you can disable their use. It is recommended to use Events, Tasks, Sender and Admin services by default. See the "Optional services usage" section for details.

When launching each service, certain parameters are used, for example, --detach, --network, etc. See the section "Launching parameters description" for more detailed information about all launch parameters of LUNA PLATFORM services and databases.

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

Monitoring configuration#

Monitoring LUNA PLATFORM services requires running the Influx 2.0.8-alpine database. Below are the commands to launch the InfluxDB container.

For more information, see the "Monitoring" section in the administrator manual.

If necessary, you can configure the visualization of monitoring data using the LUNA Dashboards service, which includes a configured Grafana data visualization system. In addition, you can launch the Grafana Loki tool for advanced work with logs. See the instructions for launching LUNA Dashboards and Grafana Loki in the "Monitoring and logs visualization using Grafana" section.

Migration from version 1#

If necessary, you can upgrade from the InfluxDB OSS 1 version.

The process of migrating InfluxDB from version 1 is not described in this documentation. InfluxDB provides built-in tools for migrating from version 1 to version 2. See the documentation:

https://docs.influxdata.com/influxdb/v2.0/upgrade/v1-to-v2/docker/

InfluxDB OSS 2#

You can use InfluxDB OSS 2 as a service, or run it in a Docker container.

If you plan to use InfluxDB OSS 2 as a service, skip this step and make sure you have migrated from InfluxDB OSS 1.

To run InfluxDB OSS 2 in a Docker container, follow the steps below:

  • stop the InfluxDB service
systemctl stop influxdb.service
  • run InfluxDB OSS 2 in Docker 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=kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDUmmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA== \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/influx:/var/lib/influxdb2 \
--restart=always \
--detach=true \
--network=host \
--name influxdb \
dockerhub.visionlabs.ru/luna/influxdb:2.0.8-alpine

If you need to set the custom settings of the InfluxDB (for example, set the IP address and port when launching InfluxDB on separate server), then you need to change them in the configurations of each LUNA PLATFORM service. See the section "Set custom InfluxDB settings" for more information.

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#

You can continue to use Redis as a service, or run it in a Docker container.

If you plan to use Redis as a service, skip this step.

To run Redis in a Docker container, follow the steps below:

  • stop the redis service
systemctl stop redis.service
  • run Redis in a Docker container:
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

Migrate PostgreSQL 9.6 database#

The new version of LUNA PLATFORM uses the PostgreSQL 12 database. It is necessary to migrate the PostgreSQL 9.6 database.

Below is an example of commands to migrate a PostgreSQL database from version 9.6 running on the server to version 12 running in a Docker container. If necessary, you can migrate to the version 12 running on the server as a service (not described in this documentation).

Back up the PostgreSQL 9.6 database by exporting the data to the SQL migration script.

The pg_dumpall command is only available to the superuser. It is necessary to grant the appropriate rights for the user luna, if they have not yet been granted. The rights can be granted using the following command:

psql -U postgres -c "ALTER USER luna SUPERUSER";

Export user data to the SQL migration script:

The script will be saved to the current directory.

pg_dumpall -c -U luna > db9_6.sql

Stop the PostgreSQL 9.6 service:

systemctl stop postgresql-9.6.service

Launch the PostgreSQL database container 12:

docker run \
--env=POSTGRES_USER=luna \
--env=POSTGRES_PASSWORD=luna \
--shm-size=1g \
-v /var/lib/luna/postgresql/data/:/var/lib/postgresql/data/ \
-v /var/lib/luna/current/example-docker/postgresql/entrypoint-initdb.d/:/docker-entrypoint-initdb.d/ \
-v /etc/localtime:/etc/localtime:ro \
--name=postgres \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/postgis-vlmatch:12

-v /var/lib/luna/current/example-docker/postgresql/entrypoint-initdb.d/:/docker-entrypoint-initdb.d/ \ - the "docker-entrypoint-initdb.d" script includes the commands for the creation of services databases. During database creation, a default username and password are automatically used.

-v /var/lib/luna/current/example-docker/postgresql/data/:/var/lib/postgresql/data/ - the volume command enables you to mount the "data" folder to the PostgreSQL container. The folder on the server and the folder in the container will be synchronized. The PostgreSQL data from the container will be saved to this directory.

--network=host - if you need to change the port for PotgreSQL, 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.

You should create all the databases for LP services manually if you are going to use an already installed PostgreSQL.

Copy the SQL migration script to the PostgreSQL 12 database container:

docker cp db9_6.sql postgres:/db9_6.sql

Perform the migration:

docker exec -t postgres psql -U luna -f /db9_6.sql

Delete the used SQL migration script from the PostgreSQL 12 database container:

docker exec postgres rm /db9_6.sql 

Delete the used SQL migration script from the current directory:

rm -f db9_6.sql

If an external PostgreSQL database is used, then you must additionally activate the Postgis software. See the "External DB" section of the LUNA PLATFORM 5 installation manual for details and examples of using an external database outside of a Docker container.

Configurator#

Optional services usage#

The listed below services are not mandatory for LP:

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

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.

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.1.40 \
-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.1.40 

At this stage, you can activate logging to file if you need to save them on the server (see the "Logging to server" section).

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.

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 create a new database for LUNA PLATFORM 5 (for example, "luna_faces_5") and change the default name for the Faces DB in the "LUNA_FACES_DB" section of the Faces/Configurator configuration file.

The second method is described in this manual below.

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.

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 for LUNA PLATFORM 5#

Create a new database:

docker exec -it postgres psql -U luna -c "CREATE DATABASE luna_faces_5;"

Grant privileges to the database user:

docker exec -it postgres psql -U luna -c "GRANT ALL PRIVILEGES ON DATABASE luna_faces_5 TO luna;"

Allow user to authorize in the DB:

docker exec -it postgres psql -U luna -c "ALTER ROLE luna WITH LOGIN;"

Add VLMatch function to perform matching:

docker exec -it postgres psql -U luna -d luna_faces_5 -c "CREATE OR REPLACE FUNCTION VLMatch(bytea, bytea, int) RETURNS float8 AS '/srv/VLMatchSource.so', 'VLMatch' LANGUAGE C PARALLEL SAFE;";

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.8.17 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Backport 3 DB 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.8.14 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

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.1.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.

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/image_store:/local_storage \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.8.14 -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/image_store:/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 log files "luna-backport3_ERROR_migration.txt" and "luna-backport3_WARNING_migration.txt" 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.8.14 -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 Image Store service
  • 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/image_store:/local_storage \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-backport3:v.0.8.14 -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.8.14 -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 Image Store 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":

By default, the samples bucket in LUNA PLATFORM 3 was called "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"
  • Press the [Save] button.

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 was enabled), you should set up the corresponding settings in the "LUNA_IMAGE_STORE_PORTRAITS_ADDRESS" section in the Backport 3 settings. You can find old values in the "LUNA_IMAGE_STORE_ORIGIN" and "LUNA_IMAGE_STORE_BUCKET" settings in the configuration file of the API service (LUNA PLATFORM 3)

  • If you had used a plugin to store portraits, you should move the existing portraits to the Image Store service of LUNA PLATFORM 5. See the "Image Store" section in the administrator manual 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#

Note. If you are not going to use the Image Store 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 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/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.9.12

-v /var/lib/luna/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/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 with code 13006 appears during launching of the listed above commands, the bucket is already created.

There are two ways to create buckets in LP.

Run the listed below 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.16.10 \
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.16.1 \
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.8.14 \
python3 ./base_scripts/lis_bucket_create.py -ii --luna-config http://localhost:5070/1

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.1.17

Licenses#

Note. To use a trial license, it is required to launch the Licenses service on the same server where trial license is being used.

Specify license settings using Configurator#

Follow the steps below to set the settings for HASP-key or Guardant-key.

Specify HASP license settings#

Note. Perform these actions only if the HASP key is used. See the "Specify Guardant license settings" section if the Guardant key is used.

To set the license server address, follow these steps:

  • go to the Configurator service interface http://<configurator_server_ip>:5070/

  • specify the "LICENSE_VENDOR" value in the "Setting name" field and click "Apply Filters"

  • set the IP address of the server with your HASP key in the field "server_address"

  • click "Save"

If the license is activated using the HASP key, then two parameters "vendor" and "server_address" must be specified. If you want to change the HASP protection to Guardant, then you need to add the "license_id" field.

Specify Guardant license settings#

Note. Perform these actions only if the Guardant key is used. See the "Specify HASP license settings" section if the HASP key is used.

To set the license server address, follow these steps:

  • go to the Configurator service interface http://<configurator_server_ip>:5070/

  • enter the value "LICENSE_VENDOR" in the "Setting name" field and click "Apply Filters"

  • set the IP address of the server with your Guardant key in the "server_address" field

  • set the license ID in the format 0x<your_license_id>, obtained in the section "Save license ID" in the License activation manual, in the "license_id" field

  • click "Save"

If the license is activated using the Guardant key, then three parameters "vendor", "server_address" and "license_id" must be specified. If you want to change the Guardant protection to HASP, then you need to delete the "license_id" field.

Licenses 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=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 \
--name=luna-licenses \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-licenses:v.0.7.17

Faces#

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.8.17

Events#

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.8.17 \
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.8.17

Python 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.

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" settings of Configurator (see "Optional 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.

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.6.8

Remote SDK#

Change the neural network model for extracting descriptors#

In this version of the LUNA PLATFORM, the following changes have occurred regarding neural network models for extracting body descriptors:

  • The 105th model has been removed from the Remote SDK container.
  • The default model 107th has been changed to 110th.

If the 105th model was previously used, then launching the Remote SDK service will fail if you do not perform one of the actions described in the section "Prepare to change the neural network version".

If the 107th model was previously used, then launching the Remote SDK service will not fail, however, since this model is considered outdated, it is recommended to update the model to the 110th in the "DEFAULT_HUMAN_DESCRIPTOR_VERSION" setting, and then perform the "Additional extraction" task after launching the Admin service.

Example of actions for changing the neural network model in Configurator:

  • open the Configurator user interface http://<configurator_server_ip>:5070;
  • enter the name of the setting "DEFAULT_HUMAN_DESCRIPTOR_VERSION" in the "Setting name" field and click "Apply Filters";
  • set the neural network model "110" in the "DEFAULT_HUMAN_DESCRIPTOR_VERSION" setting;
  • save the changes by clicking the "Save" button.

Remote SDK container launch#

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

By default, the Remote SDK service is launched with all estimators and detectors enabled. If necessary, you can disable the use of some estimators or detectors when launching the Remote SDK container. Disabling unnecessary estimators enables you to save RAM or GPU memory, since when the Remote SDK 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 Remote SDK container. See the "Enable/disable several estimators and detectors" section of the administrator manual for more information.

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

Run Remote SDK utilizing CPU#

Use the following command to launch the Remote SDK service using CPU:

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

Run Remote SDK utilizing GPU#

The Remote SDK service does not utilize GPU by default. If you are going to use the GPU, then you should enable its use for the Remote SDK 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_REMOTE_SDK_RUNTIME_SETTINGS" section. All estimators and detectors will use the value of this parameter if the "device_class" parameter of their settings like "LUNA_REMOTE_SDK__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_REMOTE_SDK__SETTINGS.runtime_settings".

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

Use the following command to launch the Remote SDK service using GPU:

docker run \
--env=CONFIGURATOR_HOST=127.0.0.1 \
--env=CONFIGURATOR_PORT=5070 \
--env=PORT=5220 \
--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/remote-sdk:/srv/logs \
--network=host \
--name=luna-remote-sdk \
--restart=always \
--detach=true \
dockerhub.visionlabs.ru/luna/luna-remote-sdk:v.0.1.3
  • --gpus device=0 - the parameter specifies the used GPU device and enables GPU utilization. A single GPU can be utilized per Remote SDK instance. Multiple GPU utilization per instance is not available.

Handlers#

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

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.3.0.3 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Handlers 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=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.3.0.3

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 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.16.1 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1

Tasks and Tasks Worker containers launch#

Tasks service 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.16.1

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.16.1

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.6.17

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.16.10

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.5.2.14 

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.

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.8.14

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.9

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

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