Installation on Linux using Docker images
This documentation guides you through the installation process of SmartFace prerequisites and SmartFace Platform on Linux OS using docker images. SmartFace Platform for Linux is distributed in form of docker images. For successful installation it is required that you have an admin level experience with Linux OS and minimal basic knowledge of docker technology - understanding docker images, docker compose, docker container and docker registry.
There are several requirements on an operation system and other software that is needed for successful installation of SmartFace Platform on Linux.
SmartFace version 4.10 and higher versions require the CPU support AVX2 instruction set , eg Intel Haswell microarchitecture or AMD Zen family
Required Linux OS distribution
Distributed docker images of SmartFace Platform requires Docker engine with Linux containers. The deployment is limited only to Linux platforms that are supported by Docker technology. For more information see Docker Install documentation.
Required Docker and Docker Compose
It is required that you have Docker engine and Docker CLI installed on your machine. SmartFace Platform requires Docker version 20.10.0 and higher.
In case you want to perform default deployment, it is required that you have Docker Compose installed on your machine. SmartFace Platform requires Docker Compose version 1.29.0 and higher.
SmartFace Platform distribution for Linux
SmartFace Platform on Linux is distributed as a set of Docker images hosted on GitLab Container Registry and zip archive with a docker-compose files, scripts and configuration files hosted on GitHub. To pull (download) the docker images you will need credentials (name and password) available on our CRM portal (for the old CRM please visit the old CRM).
In case you would like to perform basic deployment and install SmartFace Platform as fast as possible with a default configuration, ie. do not want to perform custom large deployment, for example on multiple servers, you can use provided scripts. Provided docker-compose files and scripts will deploy one instance of every service (container), expect camera service, which will be spawned 5 times. By default, the script will deploy MS SQL database and SmartFace Platform will be configured to process only on CPU. Scripts will also use Docker Compose orchestration engine. This kind of deployment can be used for demonstration and presentation purposes. It is not aimed for large production deployments.
Docker Compose is only a one way how to orchestrate SmartFace Platform containers. You can find more information about the Docker Compose here. Docker Compose is used as an orchestration engine because it is simple and easy to use. There are more robust orchestration engines for production workloads available, such as Kubernetes, Nomad or Docker Swarm. It is up to you which engine you will use for a deployment of SmartFace Platform docker images.
In case you would like to perform custom or large deployment of SmartFace Platform, eg. spawn more instances of respective services, deploy Postgre SQL database instead of MS SQL, use different orchestration engine, or do any other custom change, you can use provided docker-compose files and scripts and change them to your need and to your use case for which SmartFace Platform will be used.
Obtain the SmartFace license
To obtain your license please follow these steps:
Login to container registry on your device. The credentials are available in our CRM portal (for the old CRM please visit the old CRM).
docker login registry.gitlab.com -u <username> -p <password>
Identify hardware ID (HWID) for your machine with command
docker run registry.gitlab.com/innovatrics/smartface/license-manager:3.2.7
This process work for native Linux. For WSL2 (e.g. Linux containers on Windows) you need a special license for which you need to contact our sales.
- Obtain the license for your HWID from our CRM portal (for the old CRM portal please visit the old CRM) for product SmartFace
- Download the license file
Deployment of SmartFace Platform
Before you start the deployment you need to manually perform following steps:
Download zip archive file containing docker-compose files, scripts and configuration files from our public GitHub repository.
Alternatively you can download the required files using the GIT by running command below in the desired location:
git clone https://github.com/innovatrics/smartface.git
Unzip downloaded files.
iengine.liclicense file to the directory with docker-compose file and scripts where run.sh script is located.
Login to the container registry using the provided credentials.
- Run command:
docker login registry.gitlab.com
- Enter provided credentials
- Run command:
Steps performed by the run.sh script
When you run the script on a machine with an empty docker engine (no previous images/containers), the script performs following steps:
Checks the presence of
iengine.licfile. If not present, the script ends.
Creates a docker network called
sf-network. This docker network is used by all other containers created by this script and enables containers to communicate with each other.
Sets up services from sf_dependencies that SmartFace Platform needs to run properly. Docker will check the presence of these images on local docker host. In case the images are not present, images are pulled from the container registry. The download can take up to several minutes.
Docker spawns containers from prerequisites images, for example:
- MSSQL/PGSQL database
- Minio NoSQL database
Parses SmartFace Version and registry information from
Creates MSSQL database named “SmartFace”.
Uses sf-admin image to perform database migration - creates required table structure and seeding the database. The image is pulled from the container registry if it is not present on the machine. This step will fail if the docker login was not performed correctly and script ends.
Executes the SmartFace Platform Docker Compose file. This results in SmartFace Platform services to be up and running on the machine. The execution does the following
a) Pulls SmartFace Platform images from container registry. The download can take up to several minutes.
b) Builds new SmartFace Platform images that will contain the provided license file. This is done using the license.Dockerfile which just adds a new layer containing the license file to an arbitrary existing image. This step can be replaced by mounting the license file to the containers.
c) Spawns containers from images, for example:
- camera service
- detector service
- extractor service
d) Uses the values from .env file to properly configure SmartFace Platform containers so everything works properly. To use this file to configure SmartFace Platform for different deployment than described here see docker documentation.
When the script finishes, SmartFace will be available to use on the local machine with all services up and running.
Uninstallation of SmartFace Platform on Linux
In case you would like to uninstall SmartFace Platform, you can simply delete created containers and other data in the Docker. To do so , follow these steps:
Stop Docker Compose for SmartFace Platform containers by running this command in the main directory where
docker-composefile is located:
Stop Docker Compose for prerequisites containers by running this command in sf_dependencies directory where
docker-composefile for prerequisites is located:
Remove and delete SmartFace data, docker containers, volumes, networks and images by running this command:
docker system prune -af --volumes