Configuration

This script will help you set up information about your installation, such as the port, media input path, media output path, and more. We recommend using this script, but you can also follow the manual setup instructions.

To start the script, execute the following command. If Blurit OP is installed on Windows, please ensure that you are in the Windows Subsystem for Linux (WSL) environment by typing wsl inside the Command Prompt or PowerShell.

sudo ./configure.sh

Choice 2 : manual configuration

BlurIt OP read its configuration variable in the .env file, which is basically a list of key-value settings.

Edit values in .env file with your favorite text editor:

nano .env

S3 storage

You can leave these settings untouched if don't plan to store your files on a S3 compliant storage. Otherwise, please fill all the settings as they are all required.

STORAGE_S3_ACCESS_KEY=
STORAGE_S3_ENDPOINT_URL=
STORAGE_S3_SECRET_KEY=
STORAGE_S3_REGION_NAME=
STORAGE_S3_BUCKET=

Local storage

These settings defines the base directories where BlurIt OP will find the input files (to be processed) and where it will save the output files (blurred videos/images and detection JSONs) on the local server storage (i.e., on the server where BlurIt OP runs).

As you will see later in the documentation, BlurIt OP can process a subdirectory of LOCAL_STORAGE_INPUT_PATH but it will not be able to process files outside of this folder.

LOCAL_STORAGE_INPUT_PATH=
LOCAL_STORAGE_OUTPUT_PATH=

⚠️ Even if you store your files on an S3 storage, you still need to provide this path, even if it is an empty folder.

BlurIt execution device

❗️ WARNING: The following settings have been pre-configured for you by the BlurIt team. Changing them may prevent BlurIt OP to work properly. Please contact us at contact@blurit.io for any extra information.

The BLURIT_DEVICE_NUMBER variable corresponds to the CUDA device number used for GPU acceleration. It represents the ID of your graphics card, starting from 0.

For instance, if you have only one graphics card, the value of this variable should be 0. If you have two graphics cards and want BlurIt to use the second one, the value should be 1.

It's important to note that not all machines may have a GPU or a CUDA-compatible device. Therefore, it is recommended to check for compatibility and availability before configuring these variables.

The BLURIT_DEVICE_TYPE variable determines whether the code will execute on a CPU or GPU. If set to "cuda", the code will run on the GPU using CUDA. If set to "cpu", the code will run on the CPU. If you lack a graphics card or prefer not to use it, the value of this variable should be "cpu".

In the example below, BLURIT_DEVICE_NUMBER is set to 0, and BLURIT_DEVICE_TYPE is set to "cuda", indicating that BlurIt will use the first graphics card.

BLURIT_DEVICE_NUMBER=0
BLURIT_DEVICE_TYPE=cuda

Reencoding's maximum threads

This variable represents the maximum number of threads that the reencoding step will use on your CPU. Increasing this value can result in faster reencoding.

However, it's important to note that you should leave some threads available for other processes. Avoid using the maximum number of threads available on your server, as it may impact the performance of other applications.

REENCODING_MAX_THREADS=2

Flower

Flower is a queue monitoring tool that can be used for assistance by Wassa. You need to choose a login, a password, and the port through which Flower will be accessible.

# Basic Auth syntax: login:password
FLOWER_BASIC_AUTH=
FLOWER_PORT=

RabbitMQ

RabbitMQ is the queuing database. You need to choose a login and a password for it. Additionally, you need to select a port for its management interface.

RABBITMQ_DEFAULT_USER=
RABBITMQ_DEFAULT_PASS=
RABBITMQ_MANAGEMENT_PORT=

PostgreSQL

PostgreSQL is the database that will store the processing results. You need to choose a login, a password, and a database name for it.

POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=

API

Most of the time the following settings can left with the default values. Please contact us at contact@blurit.io if you need more information.

The port through which BlurIt's API will be accessible.

API_PORT=

Number of API workers.

WEB_CONCURRENCY=1

The Manager API Port and Nginx Port are set to allow access to the front interface and Manager API.

MANAGER_API_PORT=
NGINX_PORT=

Webhook (optional)

CUSTOM_WEBHOOK_ENDPOINT=

The variable "CUSTOM_WEBHOOK_ENDPOINT" is a configuration setting that represents a route or URL where a POST request can be sent. This endpoint is typically used to send JSON data to another system or service.

In this specific example, when the POST request is made to the "CUSTOM_WEBHOOK_ENDPOINT" route, the JSON payload being sent is:

{
  "status": "Succeeded",
  "task_id": "abc-123-456-789"
}

The JSON payload contains two key-value pairs:

  • "status" with a value of "Succeeded"

  • "task_id" with a value of "abc-123-456-789"

The purpose of this webhook is to notify or provide information to the system or service listening at the specified endpoint about the status of a task or operation. The receiving system can then process this data according to its requirements.

Set permissions to the input and output directories

To properly use the input and output paths, we need to ensure that group 1024 has the correct permissions on this directory.

To achieve this, run the following command as sudo:

sudo chgrp -R 1024 <directory input and ouput>
sudo chmod -R g+w <directory input and ouput>

Replace <directory input and output> with the actual path to the media directory.

Create the Docker Swarm node (if not already done)

docker swarm init

If you want to specify the IP binding, you can add the --advertise-addr parameter:

docker swarm init --advertise-addr 127.0.0.1

If the BlurIt stack must be done in a multi-servers environment, please follow the link below.

Multi-servers installation

Login to our container registry

In order to download the BlurIt OP Docker images, you need to log into our the container registry using the login and password provided in the archive you received. If the file is not in the archive, please contact us at contact@blurit.io.

docker login rg.fr-par.scw.cloud/blurit-on-premise -u <login> -p <password>

If you have a multiple-servers installation, you will also need to log into the worker machines.

Pull docker image

❗️Downloading the BlurIt OP images can take a long time depending on the machine and the connection speed❗️

docker-compose -f blurit_stack.yml pull

In case of a multiple-servers installation, pull the worker image on the worker machines:

docker pull rg.fr-par.scw.cloud/blurit-on-premise/worker:<image tag that you can retrieve in blurit_stack.yml>

Please note that the command docker-compose -f blurit_stack.yml pull will pull the necessary images specified in the blurit_stack.yml file. If you have multiple machine installation, you need to separately execute the command docker pull rg.fr-par.scw.cloud/blurit-on-premise/worker:<image tag> on each worker machine. Replace <image tag that you can retrieve in blurit_stack.yml> with the specific image tag you can find in the blurit_stack.yml file.

Changing configuration when BlurIt OP is already installed

While BlurIt OP is already installed, you have the ability to edit every variable in the .env file. Once the .env file is ready, please proceed to the "Run Blurit" section to re-deploy the stack.

❗️Note that deploying the same stack may interrupt certain services depending on the updated variables. It is important to ensure that all jobs are completed before deploying the stack. Please exercise caution and verify the status of all ongoing tasks before initiating the stack deployment.

Run BlurIt OP