Before upgrade#
Make sure you are the root user before upgrade!
Before launching the LUNA Index Module, you must perform the following actions:
- Move the index store from the old distribution if it was located there
- Delete old symbolic link
- Unpack the distribution of the new version of LIM
- Create new symbolic link
- Configure SELinux and Firewall if not previously configured
- Login to VisionLabs registry if authorization was not previously performed
- Migrate old LIM settings
- Update LIM settings in Configurator
- Remove old containers
- Augment built indexes with descriptor version information
Move index storage#
By default, the index storage is located in the "/var/lib/luna/lim_storage" directory, without reference to the LIM version. You need to move the index storage to the "/var/lib/luna" directory if the directory was located elsewhere in previous versions.
Delete symbolic link#
Delete the symbolic link to the previous version directory using the following command:
rm -f /var/lib/luna/lim-current
Distribution unpacking#
The distribution package is an archive lim_v.5.45.3, where v.5.45.3 is a numerical identifier, describing the current LUNA Index Module 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.
Move the distribution to the /var/lib/luna/
directory.
mv /root/lim_v.5.45.3.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 lim_v.5.45.3.zip
Symbolic link creation#
Create a symbolic link. The link indicates that the current version of the distribution file is used to run LIM.
ln -s lim_v.5.45.3 lim-current
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.
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
docker login dockerhub.visionlabs.ru --username <username>
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.
Migrate LIM settings#
Run the following command to migrate the LIM settings in the LUNA Configurator service.
docker run \
-v /etc/localtime:/etc/localtime:ro \
--rm \
--entrypoint='' \
--network=host \
dockerhub.visionlabs.ru/luna/lim-configs:v.0.3.0 python3 -m configs.migrate head --config_db_url postgres://luna:luna@127.0.0.1:5432/luna_configurator
--config_db_url postgres://luna:luna@127.0.0.1:5432/luna_configurator
flag for specifying the luna_configurator
database address
Update settings in the Configurator#
Next, you need to enable the use of the Python Matcher Proxy service and add the matching plugin to the list of plugins used by the Python Matcher Proxy service.
Copy the file with the necessary settings to the Configurator container:
docker cp /var/lib/luna/lim-current/example-docker/configs/lim_settings.json luna-configurator:/srv/lim_settings.json
Update the settings in the Configurator service:
docker exec -it luna-configurator python3 ./base_scripts/db_create.py --dump-file /srv/lim_settings.json
As a result, the following settings will be updated in the Configurator service:
LUNA_MATCHER_PROXY_ACTIVE_PLUGINS = ["indexed_matcher"]
ADDITIONAL_SERVICES_USAGE = "luna_matcher_proxy":true
Remove old containers#
Before launching the containers of the current minor version, stop all LIM 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.
For example, to remove LIM containers only use the following command:
docker container rm -f lim-indexer lim-manager lim-matcher luna-python-matcher-proxy
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 LIM is successfully launched.
The command deletes all the unused images, not only the images related to LIM.
docker image prune -a -f
Augment built indexes with descriptor version information#
Note. Follow these steps only if you are upgrading from version 5.32.0.
In the LUNA Index Module v.5.34.0, accounting for descriptor versions of index set in the setting "DEFAULT_FACE_DESCRIPTOR_VERSION" 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 the version 5.32.0. 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.