Installation
Deployment preparation
Preparation
Image API is delivered in the distribution kit. The distribution kit contains files necessary for Image API deployment. The link to download the distribution kit and the attached license file are sent to the client by email.
Unpack the distribution kit and replace a license file face_sdk.lic to the setup folder. Further commands should be performed relative to the setup directory.
Configuration
| Configuration file | Description |
| ./cfg/image-api.values.yaml | A configuration file of Image API instance deployment |
| ./cfg/package.settings.cfg | A configuration file of dependencies for installation of Kubernetes cluster |
| ./cfg/smc.settings.cfg | A configuration file of Kubernetes cluster |
1. Open a deployment configuration file ./cfg/smc.settings.cfg in a text editor and set values for the following variables:
apiserver_advertise_addressis the internal IP address of the machine for deployment.external_ip_addressis the public IP address of the machine which DNS will be configured to.
If there is no public IP address, use the internal IP address.
2. Open a deployment configuration file ./cfg/image-api.values.yaml in a text editor and set values for the following variables:
ingress.hostis a domain name used in ingress to route requests to Kubernetes services.
Example:
ingress:
host: image-api.example.com
IP address for domain name <ingress.host> should be configured at DNS server.
3. Configure cluster parameters in ./cfg/image-api.settings.cfg:
echo kube_provider=kubeadm >> modules/image-api/settings.cfg
echo kube_cri=containerd >> modules/image-api/settings.cfg
Install dependencies
If the system has no Docker, Kubernetes or Helm, run the command below:
./cli.sh smc package ubuntu install
Upload images
Upload docker-images image-api to local registry:
./cli.sh image-api load-images
Upload the smc docker images to your local registry:
./cli.sh smc load-images
Uploading can last for about five minutes.
Install and configure a cluster
To create and configure the cluster, run the following command:
./cli.sh smc install
This command is used to:
- Set docker and host network.
- Install the cluster.
- Install ingress-controller.
- Install flannel.
[Optional]To use GPU, install nvidia-device-plugin:
./cli.sh smc nvidia install
[Optional] To use Horizontal Pod Autoscaler, install metric-server:
./cli.sh smc metric-server install
To create image-api secrets in a cluster, run the command below:
./cli.sh image-api install-secrets
Cluster health check
After initializing the master node, make sure that all nodes are ready for operation. You can check this by running the command below:
kubectl get nodes
As a result, the following output will be displayed in the terminal:
NAME STATUS ROLES AGE VERSION
control-plane-node Ready control-plane 2m51s v1.32.2
Deployment
Install Image API to the cluster
Launch the script below to install Image API to the cluster:
./cli.sh image-api install
Then run the following command to get the deployment status:
kubectl get pods
As a result, the console will display a list of pods (deployment instances), their statuses, the number of restarts, and the pod age. The example of console output:
NAME READY STATUS RESTARTS AGE
image-api-age-estimator-dep-5d84b6d87b-nft8l 1/1 Running 0 2m22s
image-api-body-detector-dep-7f4b796b9d-zkxgh 1/1 Running 0 2m22s
image-api-deepfake-estimator-dep-c6bd6569f-rcv5r 1/1 Running 0 2m22s
image-api-emotion-estimator-dep-6548558875-7ds5n 1/1 Running 0 2m21s
image-api-face-detector-face-fitter-dep-77f64c9c94-mkx9n 1/1 Running 0 2m21s
image-api-face-detector-liveness-estimator-dep-6f9c8b94f5-cqbjf 1/1 Running 0 2m21s
image-api-face-detector-template-extractor-dep-5c7547c968-6hk7n 1/1 Running 0 2m21s
image-api-gender-estimator-dep-7b676fbd85-hrq6k 1/1 Running 0 2m20s
image-api-glasses-estimator-dep-7f9845d67f-6vn26 1/1 Running 0 2m20s
image-api-liveness-estimator-dep-5b5dcddff9-vvdbg 1/1 Running 0 2m21s
image-api-mask-estimator-dep-5cf7fc55f4-cdbmg 1/1 Running 0 2m22s
image-api-quality-assessment-estimator-dep-7c7967785d-mrx4r 1/1 Running 0 2m22s
image-api-quality-core-dep-695c8d5c8-mfgnp 1/1 Running 0 2m21s
image-api-quality-estimation-dep-fdf4f5df8-hhxj8 1/1 Running 0 2m21s
image-api-template-extractor-dep-86b8f78795-mmwcz 1/1 Running 1 (92s ago) 2m21s
image-api-verify-matcher-dep-554c446cb7-rcd5v 1/1 Running 0 2m22s
Status Running for all pods shows that all containers are successfully launched.
Configure DNS
To allow DNS access, your network server should contain a record that <domain> is available at <external_ip_address>. Variable values can be obtained from the ./cfg/smc.settings.cfg and ./cfg/image-api.values.yaml files filled in in para. Configuration. To perform this configuration, contact your network administrator.
For testing you can specify the IP address and domain in the /etc/hosts file on Linux or C:\Windows\System32\drivers\etc\hosts on Windows. To do this, add a new line <external_ip_address> <host> with the values of the corresponding variables to the end of this file. Please note that you must have administrator rights to edit the hosts file.
To use Image API at the same machine where it is deployed, you can use a script that will automatically add the necessary record to the /etc/hosts file.
echo "<external_ip_address> <host>" | sudo tee -a /etc/hosts
Testing
To make sure that the system works properly, use the command below:
./cli.sh image-api test - http://<host>
Test output should be the following:
face-detector-face-fitter ✓
age-estimator ✓
emotion-estimator ✓
gender-estimator ✓
face-detector-liveness-estimator ✓
liveness-estimator ✓
mask-estimator ✓
quality-assessment-estimator ✓
face-detector-template-extractor ✓
template-extractor ✓
body-detector ✓
verify-matcher ✓
Deletion
To delete Image API, run the command below:
./cli.sh image-api uninstall
Licensing
Install a license
Unpack Image API distribution kit and move a license file face_sdk.lic (the file is attached to the e-mail) to setup directory.
Update a license
Reinstall the secrets:
./cli.sh image-api install-secretsDelete Image API release from the cluster:
./cli.sh image-api uninstallInstall Image API release into the cluster:
./cli.sh image-api install