Before upgrade#
Make sure that you are the root user before upgrade!
Before upgrading the LUNA PLATFORM, you must perform the following actions:
- Introduce yourself with accounts migration notes
- Create backups
- Delete old symbolic link
- Unpack the distribution of the new version of LUNA PLATFORM
- Create new symbolic link
- Change group and owner for new directories
- Choose logging method
- Configure SELinux and Firewall if not previously configured
- Perform license activation steps
- Install Docker
- Set up GPU computing if you plan to use GPU
- Login to VisionLabs registry if authorization was not previously performed
- Remove LUNA PLATFORM 4 containers
Accounts migration notes#
All accounts created using the Admin service will be automatically migrated. The administrator account will be assigned the type "admin", and accounts created by requesting the resource "/accounts" will be assigned the type "advanced_user". The email address will be used as login and password. The name of the organization will be written in the "description" field.
Old account | New account |
---|---|
Organization name: VisionLabs | login: example@visionlabs.ai |
E-mail address: example@visionlabs.ai | password: example@visionlabs.ai |
Account id: e8531a5b-a429-4980-8d04-b38d8c220409 | description: VisionLabs |
account_id: e8531a5b-a429-4980-8d04-b38d8c220409 | |
account_type: admin |
In order to retain the ability to use the data created earlier by specifying the "account_id" in the "Luna-Account-Id" header, it is necessary in the "account creation" request specify "login", "password", "account_type" and the old identifier "account_id" in the "Luna-Account-Id" header of the request. Thus, the old "account_id" will be linked to the account being created.
Examples of linking account and creating new account are given in the "Account creation using API service" section.
Backups creation#
Create backups for all the databases used with LUNA PLATFORM before performing the migration procedures. You can restore your data if any problems occur during the migration.
It is recommended to create backups for Image Store buckets.
Backups creation for databases and buckets is not described in this document.
Delete old symbolic link#
Go to the "luna" directory.
cd /var/lib/luna
Delete the "current" symbolic link.
rm -f current
Distribution unpacking#
The distribution package is an archive luna_v.5.36.5, where v.5.36.5 is a numerical identifier, describing the current LUNA PLATFORM version.
The archive includes configuration files, required for installation and exploitation. It does not include Docker images for the services. They should be downloaded from the Internet.
Move the distribution package to the directory on your server before the installation. For example, move the files to /root/ directory. The directory should not contain any other distribution or license files except the target ones.
Create directory for distribution file unpacking
mkdir -p /var/lib/luna
Move the distribution to the created directory
mv /root/luna_v.5.36.5.zip /var/lib/luna
Install the unzip archiver if it is necessary
yum install -y unzip
Go to the folder with distribution
cd /var/lib/luna
Unzip files
unzip luna_v.5.36.5.zip
Symbolic link creation#
Create a symbolic link. The link indicates that the current version of the distribution file is used to run LUNA PLATFORM.
ln -s luna_v.5.36.5 current
Changing group and owner for directories#
LP services are launched inside the containers by the "luna" user. Therefore, it is required to set permissions for this user to use the mounted volumes.
Go to the LP "example-docker" directory:
cd /var/lib/luna/current/example-docker/
Set permissions for the user with UID 1001 and group 0 to use the mounted directories.
mkdir luna_configurator/used_dumps
chown -R 1001:0 luna_configurator/used_dumps
chown -R 1001:0 image_store
Choose logging method#
There are two methods to output logs in LUNA PLATFORM:
- standard log output (stdout);
- log output to a file.
Log output settings are set in the settings of each service in the <SERVICE_NAME>_LOGGER
section.
If necessary, you can use both methods of displaying logs.
For more information about the LUNA PLATFORM logging system, see the "Logging" section in the administrator manual.
Logging to stdout#
This method is used by default and requires no further action.
It is recommended to configure Docker log rotation to limit log sizes (see "Docker log rotation").
Logging to file#
Note. When you enable saving logs to a file, you should remember that logs occupy a certain place in the storage, and the process of logging to a file negatively affects system performance.
To use this method, you need to perform the following additional actions:
- before launching the services: create directories for logs on the server;
- after launching the services: activate log recording and set the location of log storage inside LP service containers;
- during the launch of services: configure synchronization of log directories in the container with logs on the server using the
volume
argument at the start of each container.
Examples of container launch commands in this documentation contain arguments for synchronizing log directories.
Note that the above steps must be performed before, during and after starting the services. Saving logs to file will not work if you perform all actions after starting the containers.
See the instructions for enabling logging to files in the "Logging the server" section.
SELinux and Firewall#
You must configure SELinux and Firewall so that they do not block LUNA PLATFORM services.
SELinux and Firewall configurations are not described in this guide.
If SELinux and Firewall are not configured, the installation cannot be performed
License key activation#
The HASP service is used for LUNA PLATFORM licensing. Without a license, you will be unable to run and use LUNA services.
A HASP key is required to work with LUNA PLATFORM. It uses the haspvlib_x86_64_30147.so vendor library, which located in the in the "/var/hasplm/" directory.
License key is provided by VisionLabs separately upon request.
A network license is required to use LUNA PLATFORM in Docker containers.
The license key is created using the fingerprint. The fingerprint is created based on the information about hardware characteristics of the server. Therefore, the received license key will only work on the same server where the fingerprint was obtained.
There is a possibility that a new license key will be required when you perform any changes on the license server.
LP license includes the following features:
- License expiration date.
- Maximum number of faces with linked descriptors or basic attributes.
- Liveness availability.
- Liveness current balance.
- Image check according to ISO/IEC 19794-5 standard availability.
- Body parameters estimation availability.
- Possibility of using the Index Matcher service in the LUNA Index Module.
- Maximum number of streams created by the LUNA Streams service.
When ordering the license, you need to inform technical support about the need to use any of the above features.
Follow these steps to set up the license:
- Install HASP utility on your server. HASP utility is usually installed on a separate server;
- Start the HASP utility;
- Create the fingerprint of your server and send it to VisionLabs;
- Activate your key, received from VisionLabs;
- Specify your HASP server address in the Configurator settings before starting the Licenses container (see "Specify license server address using Configurator").
The Sentinel Keys tab of the user interface (
<server_host_address>:1947
) shows activated keys.
Install HASP utility#
LP uses HASP utility of a certain version.
If an older version of HASP utility is installed, it is required to delete it before installation of a new version. See Delete old LP hasp utility.
Go to the HASP directory.
cd /var/lib/luna/current/extras/hasp/
Install HASP utility on you server.
yum -y install /var/lib/luna/current/extras/hasp/aksusbd-*.rpm
Launch HASP utility.
systemctl daemon-reload
systemctl start aksusbd
systemctl enable aksusbd
systemctl status aksusbd
Configure HASP utility#
You can configure the HASP utility using the "/etc/hasplm/hasplm.ini" file.
Note! You do not need to perform this action if you already have the configured INI file for the HASP utility.
Delete the old file if necessary.
rm -rf /etc/hasplm/hasplm.ini
Copy the INI file with configurations. Its parameters are not described in this document.
cp /var/lib/luna/current/extras/hasp/hasplm.ini /etc/hasplm/
Add vendor library#
Copy LP vendor library (x32 and x64). This library is required for using LP license key.
cp /var/lib/luna/current/extras/hasp/haspvlib_30147.so /var/hasplm/
cp /var/lib/luna/current/extras/hasp/haspvlib_x86_64_30147.so /var/hasplm/
Restart the utility
systemctl restart aksusbd
Create fingerprint#
Go to the HASP directory.
cd /var/lib/luna/current/extras/hasp/licenseassist
Run the script
./LicenseAssist fingerprint > fingerprint_30147.c2v
The fingerprint is saved to file "fingerprint_30147.c2v".
Send the file to VisionLabs. You license key will be created using this fingerprint.
You can also save the system fingerprint from the user interface at
<host_address>:1947
by clicking the "Fingerprint" button on the "Sentinel Keys" tab.
Add license file manually using user interface#
-
Go to:
<host_address>:1947
(if access is denied check your Firewall/ SELinux settings (the procedure is not described in this document); -
Select the Update/Attach at the left pane;
-
Press the "Select File..." button and select a license file(s) in the appeared window;
-
Press the "Apply File" button.

Delete LP old hasp utility#
Note. Delete the HASP utility only if you need to install a newer version. Otherwise, skip this step.
Stop and disable the utility.
systemctl stop aksusbd
systemctl disable aksusbd
systemctl daemon-reload
yum -y remove aksusbd haspd
Docker installation#
The Docker installation is described in the official documentation:
https://docs.docker.com/engine/install/centos/.
You do not need to install Docker if you already have an installed Docker of the latest version on your server.
Quick installation commands are listed below.
Check the official documentation for updates if you have any problems with the installation.
Install dependencies.
yum install -y yum-utils device-mapper-persistent-data lvm2
Add repository.
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install Docker.
yum -y install docker-ce docker-ce-cli containerd.io
Launch Docker.
systemctl start docker
systemctl enable docker
Check Docker status.
systemctl status docker
Calculations using GPU#
You can use GPU for the general calculations performed by Handlers.
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 LP distribution and should be downloaded from the Internet):
docker run --rm --gpus all nvidia/cuda:11.4-base 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.
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
docker login dockerhub.visionlabs.ru --username <username>
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.
Remove LUNA PLATFORM 4 containers#
Use the following command to stop and delete the default LUNA PLATFORM 4.5.3 containers.
You should remove all the containers of LUNA PLATFORM services if you have started a different number of containers or they have other names.
docker container rm -f admin api sender tasks tasks-worker events luna-matcher luna-detector luna-extractor licenses faces_2 faces_1 image-store configurator influxdb
Note! It is also recommended to remove NGINX or edit its settings, as this instruction does not involve scaling using NGINX.
docker container rm -f nginx