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:
- Databases, Balancers, HASP service and other third-party party software
- Configurator
- Image Store
- Accounts
- Licenses
- Faces
- Events
- Python Matcher
- Python Matcher Proxy. The service is disabled by default.
- Handlers
- Tasks
- Sender
- API
- Admin
Next, you need to launch the Backport 4 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#
Note. Make sure that the old InfluxDB container is deleted.
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#
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
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.
Back up the PostgreSQL 9.6 database by exporting the data to the SQL migration script. The script will be saved to the current directory.
docker exec -t postgres pg_dumpall -c -U luna > db9_6.sql
Delete the old PostgreSQL 9.6 database container:
docker rm -f postgres
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
Activate PostGIS in your database:
docker exec postgres psql -U luna -d luna_events -c "CREATE EXTENSION postgis;"
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
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 |
Image Store | API, Admin, Handlers, Tasks |
Tasks | API, Admin, Handlers |
Sender | API, Admin, Handlers |
Python Matcher Proxy (disabled by default) | API, Admin, Handlers, Tasks, Events |
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.
See the detailed information in the "Disableable services" section of the administrator manual.
Configurator DB recreation#
It is not required to migrate Configurator database as it should be created from scratch and filled in manually.
Use the following commands to delete and create the Configurator service database.
Delete the old database:
docker exec -it postgres psql -U luna -c "DROP DATABASE luna_configurator;"
Create the new database:
docker exec -it postgres psql -U luna -c "CREATE DATABASE luna_configurator;"
Grant privileges to the database user:
docker exec -it postgres psql -U luna -c "GRANT ALL PRIVILEGES ON DATABASE luna_configurator TO luna;"
Allow user to authorize in the DB:
docker exec -it postgres psql -U luna -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.1.29 \
-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.29
At this stage, you can activate logging to file if you need to save them on the server (see the "Logging to server" section).
Image Store#
Samples migrations#
To migrate from LUNA PLATFORM 4 you can assign an account to all the samples in your Image Store bucket. Otherwise all the objects created for the LUNA PLATFORM 4 can be accessed within any account, and also without any account.
You can skip the following script execution if the samples should not be linked to any account and can be accessed from any account.
Create a backup of all the samples buckets before launching the following script.
You should launch the "migrate_4_to_5.py" script to update account information for the stored samples.
You should use existing buckets during the samples migration script execution. Set up actual storage configurations for the Image Store service in the Configurator service user interface.
Run migration script:
docker run \
--rm -t \
-v /tmp/logs/image-store:/srv/logs \
-v /var/lib/luna/image_store/:/srv/luna_image_store/local_storage/ \
--network=host \
--entrypoint bash dockerhub.visionlabs.ru/luna/luna-image-store:v.3.9.7 \
-c "python3 ./base_scripts/accounting/migrate_4_to_5.py --account_id=<account_id> --bucket=visionlabs-samples"
-v /var/lib/luna/image_store
- path to the local_storage of the Image Store samples.
<account_id>
- you should specify the account ID which will have access to all the samples from the specified bucket (visionlabs-samples
).
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.7
-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.5 \
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.15.9 \
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.8 \
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#
Admin DB transformation#
Note. Follow the steps below only if you have used the Admin service before. Otherwise, skip this section.
By default, the Accounts service creates its own luna_accounts
database, but if the Admin service was previously used, then the luna_admin
should must be transformed to work with the Accounts service. To do this, you need to change the default luna_accounts
database used by the Accounts service to luna_admin
in the Configurator and run the data migration script.
Admin DB migration#
Run migration script to update the structure of the Admin database and transform it to work with the Accounts service.
Note that after the migration, the database will be named luna_admin
, but will be used exclusively by the Accounts service.
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/accounts:/srv/logs \
--rm \
--network=host \
dockerhub.visionlabs.ru/luna/luna-accounts:v.0.1.12 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head
Accounts DB tables creation#
Note. Perform the steps below only if you are launching the Accounts service for the first time and have not used the Admin service before. If you used the Admin service before, skip this section and make sure you have completed the steps in the "Admin DB transformation" section.
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.12 \
python3 ./base_scripts/db_create.py --luna-config http://localhost:5070/1
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.12
Licenses#
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.6
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.8.12 \
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.8.12
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.4.8.12 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head
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.12
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.3
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.19.4 \
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.
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.19.4
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_
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_
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.19.4
--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 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.15.9 \
alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head
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.15.9
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.15.9
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.12
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.5
Account creation using API service#
The account is created using an HTTP request to the "create account" resource of the API service.
You can also create an account using the Admin service. This method requires an existing login and password (or the default login and password) and enables you to create an "admin" account. See the "Admin service" section of the administrator manual for details.
To create the account using a request to the API service, you need to provide the following mandatory data:
- login — email address
- password — password
- account_type — account type ("user" or "advanced_user")
Create the account using your authentication details.
If you want to keep the ability to use the "account_id" that was used as the "Luna-Account-Id" header in previous LP versions (without creating an account in the Admin service), then you need to link the old "account_id" to the account being created.
Example of CURL-request to the "create account" resource:
curl --location --request POST 'http://127.0.0.1:5000/6/accounts' \
--header 'Content-Type: application/json' \
--header 'Luna-Account-Id: <your_old_account_id>' \
--data '{
"login": "user@mail.com",
"password": "password",
"account_type": "user",
"description": "description"
}'
It is necessary to replace the authentication data from the example with your own.
To work with tokens, you must have an account.
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.9
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 4#
The section describes launching of Backport 4 service.
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.3.12
User Interface 4#
The User Interface 4 is used with the Backport 4 service only.
User Interface 4 container launch#
Note. You should have the account with account type user before launching the User Interface 4 container. Its login and password in Base64 format will be used to work with the user interface.
Use the following command to launch the service:
docker run \
--env=PORT=4200 \
--env=LUNA_API_URL=http://<server_external_ip>:5130 \
--env=BASIC_AUTH=dXNlckBtYWlsLmNvbTpwYXNzd29yZA== \
--name=luna-ui-4 \
--restart=always \
--detach=true \
--network=host \
-v /etc/localtime:/etc/localtime:ro \
dockerhub.visionlabs.ru/luna/luna4-ui:v.0.1.5
--env=PORT
- specifies the port for running User Interface 4.
--env=BASIC_AUTH
- sets the Basic authorization for the account which data is displayed in the user interface. It is necessary to convert login:password
created at the stage "Account creation using API service" to Base64 format. The account type should be set to user.
--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).