.. _deployment:

**************************************
Deploy and Remove FindFace CIBR
**************************************

.. rubric:: Docker platform 

FindFace CIBR 2.1.1 is Docker-based. You must install and start a set of Docker products before proceeding with the FindFace CIBR deployment. For your convenience, this chapter contains :ref:`Ubuntu <deploy-prepare-server>`, :ref:`CentOS <deploy-prepare-centos>`, and :ref:`Debian <deploy-prepare-debian>` server preparation sections covering the intricacies of installing Docker on the above-mentioned operating systems. For other platforms, please refer to the `Docker documentation <https://docs.docker.com/engine/install/>`__. 

.. rubric:: NVIDIA driver and NVIDIA Container Runtime (GPU only)

If you intend to deploy FindFace CIBR with GPU-acceleration, you need to install the NVIDIA driver and NVIDIA Container Runtime. Again, you will find the relevant information in the server preparation sections.  

.. rubric:: Deployment options

After you are finished with the server preparation, you are all set for the FindFace CIBR deployment. You are provided with the following options here: 

#. Automatically install FindFace CIBR standalone in one run. Being the simplest, this installation type is excellent to kick-start your experience with FindFace CIBR. We recommend choosing it if you are a first-timer. See :ref:`installer` for guidance.  
#. Fully customized installation. It requires fundamental understanding of the product architecture. See :ref:`custom-installation`.

.. note::
   If you select the installation type #2, keep in mind to :ref:`install necessary neural network models <deploy-models>` along with the ``findface-extraction-api`` component.

.. rubric:: Installer questions and automatic deployment from the installation file

Before starting the actual installation, the installer asks you a few questions and performs several automated checks to ensure that the host meets the system requirements. After filling out each prompt, press :kbd:`Enter`. 

To install the same configuration of FindFace CIBR on a different host, use the automatic deployment from the installation file. In this case, you won't have to answer the installation questions again. The exact path to the installation file is displayed right after the last question, before the installer starts off active progress:

.. code::

   [I 2023-10-06 13:30:48,766 main:142] Your answers were saved to /tmp/findface-installer-p01n9sn3.json

.. important::

   Be sure to remove fields ``*.config``, ``exp_ip``, and ``int_ip`` before installing FindFace CIBR on a host with a different IP address.

To launch the automatic deployment from the ``/tmp/<findface-installer-*>.json`` file, execute:

.. code::

   sudo ./<findface-*>.run -f /tmp/<findface-installer-*>.json

 
.. rubric:: Post-development procedures and how-to's

Browse through the :ref:`docker-commands` section to learn how to set the time zone, license your instance, and configure logging. This section will also provide you with few basic commands that will help you to kick-start your work with FindFace CIBR containers, in case you are a newbie to Docker.

.. important::
   Starting the GPU-accelerated services ``findface-extraction-api`` and ``findface-video-worker`` for the first time after deployment may take a considerable amount of time due to the caching process (up to 45 minutes).

.. important::
   Although FindFace CIBR provides tools to ensure its protection from unauthorized access, they are not replacing a properly configured firewall. Be sure to use a firewall to heighten the FindFace CIBR network protection.

.. rubric:: Instance removal

To remove your instance, you must run a set of commands. See the :ref:`remove-instance` section.


.. toctree::
   :maxdepth: 1
   :caption: In this chapter:

   deploy-prepare-server
   deploy-prepare-centos
   deploy-prepare-debian
   deploy-installer
   custom-installation
   deploy-models
   docker-commands
   remove_instance