Skip to content

Additional information#

This section provides the following additional information:

Docker commands#

Show containers#

To show the list of launched Docker containers use the command:

docker ps

To show all the existing Docker containers use the command:

docker ps -a 

Copy files to container#

You can transfer files into the container. Use the docker cp command to copy a file into the container.

docker cp <file_location> <container_name>:<folder_inside_container>

Enter container#

You can enter individual containers using the following command:

docker exec -it <container_name> bash

To exit the container, use the command:

exit

Images names#

You can see all the names of the images using the command:

docker images

Show container logs#

You can view the container logs with the following command:

docker logs <container_name>

Delete image#

If you need to delete an image:

  • Run the docker images command.
  • Find the required image, for example: dockerhub.visionlabs.ru/luna/v.5.2.8.
  • Copy the corresponding image ID from the IMAGE ID, for example, \"61860d036d8c\".
  • Specify it in the deletion command:
docker rmi -f 61860d036d8c

Delete all the existing images:

docker rmi -f $(docker images -q)

Stop container#

You can stop the container using the command:

docker stop <container_name>

Stop all the containers:

docker stop $(docker ps -a -q)

Delete container#

If you need to delete a container:

  • Run the docker ps command.
  • Stop the container (see Stop container).
  • Find the required image, for example: dockerhub.visionlabs.ru/luna/v.5.2.8.
  • Copy the corresponding container ID from the CONTAINER ID column, for example, "23f555be8f3a".
  • Specify it in the deletion command:
docker container rm -f 23f555be8f3a

Delete all the containers:

docker container rm -f $(docker container ls -aq)

Launching keys#

To launch FaceStream with Configurator, the keys are set using environment variables:

  • --env= — this parameter sets the environment variables required to start the container. The following basic values are specified:

    • CONFIGURATOR_HOST — Host on which the Configurator service is running. The local host is set if the container is running on the same server where the Configurator is running.
    • CONFIGURATOR_PORT — Listening port for the Configurator service. By default, port 5070 is used.
    • PORT — Port where FaceStream will listen.
    • STREAMS_ID — Tag specifies a list of stream IDs that will be requested from LUNA Streams for processing. Other streams will be filtered. The "stream_id" parameter is given in response to the "create stream" request.

      If the value is " " or the "STREAMS_ID" tag is not set, then FaceStream will take all existing "stream_id" from the queue.

      If a non-existent value is set, an error about an incorrect UUID will be indicated when launching FaceStream.

      By default, the value equals " ".

      To use the key, the "CONFIGURATOR_HOST" and "CONFIGURATOR_PORT" variables should be specified.

    • STREAMS_NAME — List of streams names sets in this tag. Streams names are set using the "name" parameter at the time of their creation ("create streams" request). Streams with these names will be requested from LUNA Streams for processing. Other streams will be filtered.

      Otherwise, the principle of operation is similar to the "STREAMS_ID" tag.

    • GROUPS_ID and GROUPS_NAME — Tags specify a list of group IDs or a list of group names. The parameters "group_id" or "group_name" are set during stream creation ("create stream" request). Streams with these parameters will be requested from LUNA Streams for processing. Other streams will be filtered.

      If the value is " " or the "GROUPS_ID"/"GROUPS_NAME" tags are not set, then FaceStream will not filter streams by groups.

      If a non-existent value is set, an error about an incorrect UUID will be indicated when launching FaceStream.

      By default, the value equals " ".

      To use the keys, the "CONFIGURATOR_HOST" and "CONFIGURATOR_PORT" variables should be specified.

      You can set multiple values for "STREAMS_NAME", "STREAMS_ID", "GROUPS_NAME" and "GROUPS_ID" tags. Syntax example: --env=STREAMS_ID="037f3196-c874-4eca-9d7c-91fd8dfc9593 4caf7cf7-dd0d-4ad5-a35e-b263e742e28a"

    • CONFIGS_ID="" — Tag is used to set a LUNA Configurator tag, which relates to the FaceStream main configurations. The same tag should be set for "TRACK_ENGINE_CONFIG" and "FACE_STREAM_CONFIG".

      If the value is set to " " then the "TRACK_ENGINE_CONFIG" and "FACE_STREAM_CONFIG" records will be used by default. If the record by default does not exist or has an invalid JSON syntax, the configuration file from the distribution package will be used.

      By default, the value equals " ".

      To use the key, the "CONFIGURATOR_HOST" and "CONFIGURATOR_PORT" variables should be specified.

    • CONFIG_RELOAD = 1 — Tag that enables checking for changes in the "FACE_STREAM_CONFIG" section of the LUNA Configurator service and takes the following values: — "1" — Change tracking is enabled, if there are changes in the configuration, all FaceStream containers will be automatically restarted. — "0" — Change tracking is disabled.

      By default, the value equals "1".

    • PULLING_TIME = 10 — Tag that sets the period for receiving new parameters from the "FACE_STREAM_CONFIG" section of the LUNA Configurator service in the range [1...3600] sec. Used in conjunction with the CONFIG-RELOAD tag.

      By default, the value equals "10".

  • --device= — This parameter is required to specify the address to the USB device. The address must be specified in the stream source when it is created. Example: --device=/dev/video0.

See how FaceStream works with LUNA Configurator in the section "Use FaceStream with LUNA Configurator" of the administrator manual.

Description of container launch parameters#

Below is a description of the container launch commands:

  • docker run — Command to launch the selected image as a new container.
  • -v — Enables you to load the contents of the server folder into the volume of the container. This way the content is synchronized.
  • -v /var/lib/fs/fs-current/extras/conf/configs/faceengine.conf:/srv/facestream/data/faceengine.conf \ — This parameter enables you to use the FaceEngine settings from the configuration file "faceengine.conf".
  • -v /var/lib/fs/fs-current/extras/conf/configs/runtime.conf:/srv/facestream/data/runtime.conf \ — This parameter enables you to mount the runtime configuration file into the FaceStream container. Before changing the default settings, you need to consult with VisionLabs specialists.
  • --network=host — This parameter specifies that there is no network simulation and a server network is used. If you need to change the port for third-party containers, replace this line with -p 5440:5432. Here, the first port 5440 is the local port, and 5432 is the port used in the container.
  • /etc/localtime:/etc/localtime:ro — Sets the current time zone used by the container system.
  • --name=facestream — This parameter specifies the name of the container to be launched. The name must be unique. If a container with the same name already exists, an error will occur.
  • --restart=always — This parameter defines the restart policy. Daemon always restarts the container regardless of the completion code.
  • --detach=true — Running the container in the background.

Docker log rotation#

To limit the size of logs generated by Docker, you can set up automatic log rotation. To do this, add the following data to the /etc/docker/daemon.json file:

{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "100m",
        "max-file": "5"
    }
}

This will allow Docker to store up to 5 log files per container, with each file being limited to 100MB.

After changing the file, you need to restart Docker:

systemctl reload docker

The above changes are the default for any newly created container, they do not apply to already created containers.