Skip to content

Before upgrade#

Make sure you are the root user before upgrade!

Before upgrade FaceStream, you need to do the following:

  1. Create backups.
  2. Delete symbolic link.
  3. Unpack the distribution of the new version of FaceStream.
  4. Create new symbolic link.
  5. Set up GPU computing if you plan to use GPU.
  6. Login to VisionLabs registry, if authorization was not performed earlier.
  7. Remove old containers.

After the steps have been performed, you can start manually or automatically launching LUNA Streams and FaceStream.

Create backups#

It is recommended to create the following backups:

  • Backup of LUNA Streams database (not described in this documentation).
  • Backup of LUNA PLATFORM services, LUNA Streams service and FaceStream configurations.

Creating backups will enable you to restore in case of any problems during the migration process.

Backup of services configurations#

Custom configurations for LUNA PLATFORM services (all except the Configurator service), LUNA Streams and FaceStream are automatically migrated using the Configurator service migration mechanism. This backup will not be used during the normal installation of FaceStream.

To create a dump-file, use the following options (may be executed from anywhere on your server):

wget -O /var/lib/fs/settings_dump_backup.json 127.0.0.1:5070/1/dump

or

curl 127.0.0.1:5070/1/dump > /var/lib/fs/settings_dump_backup.json

Delete the symbolic link to the previous minor version directory using the following command:

rm -f /var/lib/fs/fs-current

Unpack distribution#

It is recommended to move the archive to a pre-created directory for FaceStream and unpack the archive there.

The following commands should be performed under the root user.

Create a directory for FaceStream.

mkdir -p /var/lib/fs

Move the archive to the created directory. It is considered that the archive is saved to the "/root" directory.

mv /root/facestream_docker_v.5.2.0.zip /var/lib/fs/

Go to the directory.

cd /var/lib/fs/

Install the unzip utility if it is not installed.

yum install unzip

Unpack the archive.

unzip facestream_docker_v.5.2.0.zip

Create a symbolic link. The link indicates that the current version of the distribution file is used to run the software package.

ln -s facestream_docker_v.5.2.0 fs-current

Install GPU dependencies#

Skip this section if you are not going to utilize GPU for your calculations.

You need to install NVIDIA Container Toolkit to use GPU with Docker containers.

The example of the installation is given below.

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | tee /etc/yum.repos.d/nvidia-docker.repo
yum install -y nvidia-container-toolkit
systemctl restart docker

Check the NVIDIA Container toolkit operating by running a base CUDA container (this container is not provided in the FaceStream distribution and should be downloaded from the Internet):

docker run --rm --gpus all nvidia/cuda:11.4.3-base-centos7 nvidia-smi

See the documentation for additional information:

https://github.com/NVIDIA/nvidia-docker#centos-7x8x-docker-ce-rhel-7x8x-docker-ce-amazon-linux-12.

Attributes extraction on the GPU is engineered for maximum throughput. The input images are processed in batches. This reduces computation cost per image but does not provide the shortest latency per image.

GPU acceleration is designed for high load applications where request counts per second consistently reach thousands. It won’t be beneficial to use GPU acceleration in non-extensively loaded scenarios where latency matters.

Actions to launch FaceStream with GPU through Docker Compose#

To launch FaceStream with GPU through Docker Compose, it is necessary, in addition to the above actions, to add the deploy section in the facestream field to the docker-compose.yml file.

Before starting the FaceStream container with GPU, it is required to enable GPU for calculations in the FaceStream settings using the "enable_gpu_processing" parameter (see the "FaceStream configuration" section in the administrator manual).

vi /var/lib/fs/fs-current/example-docker/docker-compose.yml
  facestream:
    image: ${REGISTRY_ADDRESS}:${DOCKER_REGISTRY_PORT}/facestream:${FS_VER}
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: all
            capabilities: [gpu]
    restart: always
    environment:
      CONFIGURATOR_HOST: ${HOST_CONFIGURATOR}
      CONFIGURATOR_PORT: 5070

Here:

  • driver — Specifies the driver for the reserved device(s).
  • count — Specifies the number of GPU devices that should be reserved (providing the host holds that number of GPUs).
  • capabilities — Expresses both generic and driver specific capabilities. It must be set, otherwise, an error will be returned when deploying the service.

See the documentation for additional information:

https://docs.docker.com/compose/gpu-support/#enabling-gpu-access-to-service-containers.

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.

Login and password can be requested from the VisionLabs representative.

Enter login .

After running the command, you will be prompted for a password. Enter password.

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.

Remove old containers#

Before launching the containers of the current minor version, stop all FaceStream related containers of the previous minor version.

To delete a container use the next command:

docker container rm -f [container_name]

where [container_name] is the service docker container name or ID.

To remove the FaceStream and LUNA Streams containers, use the following command:

docker container rm -f facestream luna-streams

To see the containers names or IDs, use the following command:

docker ps -a

It is also recommended to delete old images of the containers to free space. You can use the following command to delete all unused images.

If there is enough space on the server it is recommended to perform this action only after new version of FaceStream is successfully launched.

The command deletes all the unused images, not only the images related to FaceStream.

docker image prune -a -f