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.

General launching 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 "LP_Administrator_Manual.pdf".

  • RELOAD_CONFIG_INTERVAL specifies the configurations check period (10 seconds by default). See the "Automatic configurations reload" section in "LP_Administrator_Manual.pdf".

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

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

Database tables 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.9 ./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.9 ./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.

Run third-party services#

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

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.

If a container with an older version of InfluxDB is running, use the delete container command:

docker container rm -f influxdb

Migration from version 1#

InfluxDB provides built-in tools for migration from version 1 to version 2. See documentation:

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

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=kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDUmmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA== \
-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

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

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.

PostgreSQL#

If you already have PostgreSQL installed, skip this step.

Use the following command to launch PostgreSQL.

docker run \
--env=POSTGRES_USER=luna \
--env=POSTGRES_PASSWORD=luna \
--shm-size=1g \
-v /var/lib/luna/current/example-docker/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.

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

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:5.0.6-alpine3.10

Luna Configurator#

Configurator database migration#

Migration from the previous LP build to LP build v.5.24.0 is described in this section.

The following instruction for Configurator DB migration assumes that you already have settings migration revision set in your database. This revision is set using the --profile platform head script. This script is included in the installation manuals of LP, starting with build 5.1.1. If you have performed installation according to the manual, you do not need to perform additional actions.Settings migration will be performed automatically.

If there is no revision, you should recreate the database structure and run the --profile platform head script. See the LP_Docker_Installation_Manual.html document section "Configurator DB tables creation" for instructions. Then you should specify all the required settings manually.

The migration from version 5.1.0 is described in "LP_Docker_Upgrade_Manual.html" in the distribution package of version 5.1.1. You can update your Configurator database using this instruction and distribution package of version 5.1.1. Otherwise, you should recreate the database structure for the Configurator service and specify all the required settings manually. See the LP_Docker_Installation_Manual.html document section "Configurator DB tables creation" for instructions.

Migration from pre-release builds (builds before v.5.1.0) of LP is not provided. You should transfer all the required settings to the Configurator DB of 5.1.1 build manually.

Configurator DB tables creation#

When upgrading the Configurator database with existing settings, you should perform database structure migration and saved settings migration.

Your current database should already have settings migration revision.

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 \
--network=host \
-v /tmp/logs/configurator:/srv/logs \
--rm \
--entrypoint bash \
dockerhub.visionlabs.ru/luna/luna-configurator:v.2.0.26 \
-c "alembic upgrade head; cd /srv/luna_configurator/configs/configs/; python3.9 -m configs.migrate --config /srv/luna_configurator/configs/config.conf --profile platform head;"

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

alembic upgrade head; - upgrades already existing database structure.

python3.9 -m configs.migrate --profile platform 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.

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

Replace /var/lib/luna/current/example-docker/luna_configurator/configs/luna_configurator_postgres.conf with the absolute path to your previous luna_configurator_postgres.conf backup file.

See "Upgrade notes" section.

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/

Note that the Configurator container name differs for manual (luna-configurator) and Compose (example-docker_configurator_1) installations.

  • Update settings in the Configurator.
docker exec -it luna-configurator python3.9 ./base_scripts/db_create.py --dump-file /srv/influx2.json

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

Luna Image Store#

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

-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.5.14.10 \
python3.9 ./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.8.5 \
python3.9 ./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.3.33 \
python3.9 ./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 "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

Luna Licenses launch#

Luna Licenses container launch#

Make sure that you have specified the license server address in the "hasp_111186.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_111186.ini:/home/luna/.hasplm/hasp_111186.ini \
--name=luna-licenses \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-licenses:v.0.3.33

Luna Faces#

Faces database migration#

You need to execute migration scripts to update your Faces database structure.

It is recommended to create the back up of your database before applying any changes.

Run the following command to perform the Faces DB migration.

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.4.35 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

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

Luna Events#

Events database migration#

You need to execute migration scripts to update your Events database structure.

It is recommended to create the back up of your database before applying any changes.

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/events:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-events:v.3.0.2 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

Luna 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.3.0.2

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.

Luna 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.0.5

Luna Handlers#

Change the used database for Handlers#

The database used for the Handlers service in LUNA PLATFORM 5 is the same database that was used for the API service in LUNA PLATFORM 4.

You should change the database used for the Handlers service to the "luna_api" database in the Configurator service.

  • Go to the Configurator interface (http://<server_address>:5070 by default);
  • Specify the LUNA_HANDLERS_DB in the "Setting name" field of the filter and press [Apply filters] or select "luna-handlers" in the "Service name field" and find the setting there;
  • Set the "db_name": "luna_api" parameter in the value field.
  • Press [Save].

Handlers database migration#

You need to execute migration scripts to update your Handlers database structure.

It is recommended to create the back up of your database before applying any changes.

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.2.10 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

Handlers container launch#

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

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

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.

See the device_class parameter of the following settings:

  • LUNA_HANDLERS_WARP_ESTIMATOR_RUNTIME_SETTINGS
  • LUNA_HANDLERS_HUMAN_EXTRACTOR_RUNTIME_SETTINGS
  • LUNA_HANDLERS_HUMAN_DETECTOR_RUNTIME_SETTINGS
  • LUNA_HANDLERS_EXTRACTOR_RUNTIME_SETTINGS
  • LUNA_HANDLERS_DETECTOR_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.2.10
  • --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.

Luna Tasks#

Tasks database migration#

You need to execute migration scripts to update your Tasks database structure.

It is recommended to create the back up of your database before applying any changes.

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.8.5 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

Tasks and Tasks worker containers launch#

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

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

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.

Luna 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.8.5

Luna 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.8.5

Luna Sender#

Luna 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.3.33

Luna API#

Luna 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.5.14.10

Luna Admin#

Admin database migration#

You need to execute migration scripts to update your Admin database structure.

It is recommended to create the back up of your database before applying any changes.

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/admin:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-admin:v.4.6.23 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

Luna Admin 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=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.6.23 

Monitoring data about the number of executed requests is saved in the Admin service database. To enable data saving use the following command:

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

Luna 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 database migration#

You need to execute migration scripts to update your Backport 3 DB structure.

It is recommended to create the back up of your database before applying any changes.

Run the following command to perform the Backport 3 DB migration.

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.3.33 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head

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

Luna User Interface 3#

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

Luna 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.3

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

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

Luna Backport 4#

The section describes launching of Backport 4 service.

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

Backport 4 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=5130 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--name=luna-backport4 \
--restart=always \
--detach=true \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/backport4:/srv/logs \
--network=host \
dockerhub.visionlabs.ru/luna/luna-backport4:v.1.2.33

Luna User Interface 4#

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

Luna User Interface 4 container launch#

Use the following command to launch the service:

docker run \
--env=PORT=4200 \
--env=LUNA_API_URL=http://<server_external_ip>:5130 \
--env=LUNA_ACCOUNT_ID=6d071cca-fda5-4a03-84d5-5bea65904480 \
--name=luna-ui-4 \
--restart=always \
--detach=true \
--network=host \
-v /etc/localtime:/etc/localtime:ro \
dockerhub.visionlabs.ru/luna/luna4-ui:v.0.0.5

--env=PORT - specifies the port for running User Interface 4.

--env=LUNA_ACCOUNT_ID - specifies the account ID which data is displayed in the user interface.

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

  • You should use the external IP of the service, not localhost.

  • You should specify the Backport 4 service port (5130 is set by default).

Liveness service activation#

If you are not going to use the Liveness feature, skip this section.

The Liveness service used is specified in the HASP license.

If you are going to use the Liveness V2:

  • the Liveness feature should be set to "2" in your LUNA PLATFORM HASP key. This feature is set by VisionLabs engineers when the license is requested.
  • the "liveness": false should be set in the "ADDITIONAL_SERVICES_USAGE" setting. It is set to "false" by default. Therefore, Liveness V2 is activated by default when the Liveness feature is set to "2".

It is not required to launch any additional services to use Liveness V2. It is a part of the Handlers service.

If you are going to use the Liveness V1, follow the steps below.

Enable Liveness V1 service#

The Liveness V1 service is disabled by default.

You can enable Liveness service following these steps.

Get Liveness license#

The Liveness feature should be set to "1" in your LUNA PLATFORM HASP key. This feature is set by VisionLabs engineers when the license is requested.

The Liveness service also requires an additional Liveness license key for activation.

See section "Liveness license".

Enable Liveness#

Enable the Liveness service utilization in the Configurator service:

  • Open the Configurator user interface.
  • Set the "liveness": true in the "ADDITIONAL_SERVICES_USAGE" setting.
  • Save changes using the "Save" button

See section "Optional services usage" for more details.

Launch Liveness#

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

Use the following command to launch the service:

docker run \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/luna/current/example-docker/hasp_redirect/hasp_107506.ini:/home/luna/.hasplm/hasp_107506.ini \
--cap-add=SYS_PTRACE \
--name=luna-liveness \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/idface-server-eval:v.1.11.0

Restart API service#

It is recommended to restart the API service if it was already running. An example of the command:

docker restart luna-api