Skip to content

Services launch#

This section gives examples for launching LIM 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 Index Module 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.

Description of launch parameters#

Common parameters for launching containers are described in this section.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • /var/lib/luna/lim_storage:/srv/local_storage - enables you to mount a directory for storing indexes in local storage. The location and name of the directory for storing indexes inside LIM containers is set in the "INDEX_STORAGE_LOCAL" settings of the LIM services. Note that the directory must be the same for all three services. The local directory can be changed according to your needs.

Important information#

In the current version, accounting for descriptor versions of index set in the "DEFAULT_FACE_DESCRIPTOR_VERSION" setting of the Index Manager service has been added.

After starting the Index Manager service, it will automatically start rebuilding all indexes that lack information about descriptors, i.e. all created in a previous version of LIM. Rebuilding the index can take a long time, depending on the number of faces on the lists.

In order to avoid the lengthy process of rebuilding the index, you need to add the "descriptor_version" field with the corresponding version of the descriptor to the "meta.json" files of all previously created indexes before starting the Index Manager service.

Python Matcher proxy 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=5110 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
--env=SERVICE_TYPE="proxy" \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/python-matcher-proxy:/srv/logs \
--name=luna-python-matcher-proxy \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/luna-python-matcher:v.1.2.6

Indexer 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=5180 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/lim-indexer:/srv/logs \
-v /var/lib/luna/lim_storage:/srv/local_storage \
--name=lim-indexer \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/lim-indexer:v.0.1.0

The deployment of the Indexer service should be done on a separate server, because building an index takes a lot of resources for a long time. One Indexer instance can only build one index at a time, so it is recommended to run multiple indexer instances. The indexer must be also configured with storage, which must be large enough.

Index Manager 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=5190 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/lim-manager:/srv/logs \
-v /var/lib/luna/lim_storage:/srv/local_storage \
--name=lim-manager \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/lim-manager:v.0.1.0

It is recommended to run at least two manager instances for redundancy purposes. Since task management is carried out through the Redis, if one manager is down, the second one will be able to continue its work from the instant step.

Indexed 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=5200 \
--env=WORKER_COUNT=1 \
--env=RELOAD_CONFIG=1 \
--env=RELOAD_CONFIG_INTERVAL=10 \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/logs/lim-matcher:/srv/logs \
-v /var/lib/luna/lim_storage:/srv/local_storage \
--name=lim-matcher \
--restart=always \
--detach=true \
--network=host \
dockerhub.visionlabs.ru/luna/lim-matcher:v.0.1.0

Indexed Matcher does not communicate with other LIM services. It only monitors the storage, and when indices appear it loads them into memory. Since matching requests processing is carried out through the Redis streams, any number of matcher instances could be run without any system config updates. The number of Indexed Matcher instances should be determined by performance requirements.