Skip to content

LUNA PLATFORM launch#

The launch of Docker Compose is performed using a script "start_platform.sh", located in the "example-docker" directory.

If necessary, you can modify the Docker Compose startup script for user needs. Modification of the script is intended only for experienced users.

When the script is run, a default account of type user will be created with login user@mail.com and password password. Instructions for creating your own account are given below.

See detailed information about accounts in the "Accounts, tokens and authorization types" section of the administrator manual.

Launch services#

Go to the Docker Compose folder.

cd /var/lib/luna/current/example-docker

Make sure that LP containers are not launched before executing the script. An error will occur if you try to run a container with the same name as an existing container. If one or several LP containers are launched, you should stop them using the docker container rm -f <container_name> command. To stop all the containers, use docker container rm -f $(docker container ls -aq).

Launch Docker Compose.

You must be logged in the VisionLabs registry (see section "Login to registry").

./start_platform.sh --common

The script supports the following arguments:

  • --common - Prepare environment with common profile and launch LUNA PLATFORM without Backports and Video Manager and Video Agent services.
  • --extra backport3 - When used with --common, the backports profile will be used when preparing the environment, and the Backport3 service and its user interface will be launched.
  • --extra backport4 - When used with --common, the backports profile will be used when preparing the environment, and the Backport3 service and its user interface will be launched.
  • --extra videoanalytics - When used with --common, the use of the Video Manager and Video Agent services will be enabled in the "ADDITIONAL_SERVICES_USAGE" setting, and the Video Manager and Video Agent services will be launched.
  • --help/-h - Output help information.

Combination of the --extra backport3, --extra backport4, and --extra videoanalytics together with --common allows you to enable several additional services.

Using --extra flags without the --common flag is impossible.

If no arguments are provided, the script will deploy LUNA PLATFORM similarly to the --common argument.

Deploying containers takes some time. You have to wait until all the services are running before working with LUNA PLATFORM.

Check the state of launched Docker containers.

docker ps

Run Remote SDK utilizing GPU#

The Remote SDK service does not utilize GPU by default. If you are going to use the GPU, then you should enable its use for the Remote SDK service in the Configurator service.

If you need to use the GPU for all estimators and detectors at once, then you need to use the "global_device_class" parameter in the "LUNA_REMOTE_SDK_RUNTIME_SETTINGS" section. All estimators and detectors will use the value of this parameter if the "device_class" parameter of their settings like "LUNA_REMOTE_SDK__SETTINGS.runtime_settings" is set to "global" (by default for all estimators and detectors).

If you need to use the GPU for a specific estimator or detector, then you need to use the "device_class" parameter in sections like "LUNA_REMOTE_SDK__SETTINGS.runtime_settings".

See section "Calculations using GPU" for additional requirements for GPU utilization.

Account creation#

Note: When you run the Docker Compose script, an account of type "user" is automatically created with login "user@mail.com" and password "password". Instructions for creating an account with your authentication data are given below.

The account is created using an HTTP request to the "create account" resource of the API service.

You can also create an account using the Admin service. This method requires an existing login and password (or the default login and password) and enables you to create an "admin" account. See the "Admin service" section of the administrator manual for details.

To create the account using a request to the API service, you need to provide the following mandatory data:

  • "login" — Email address.
  • "password" — Password.
  • "account_type" — Account type ("user" or "advanced_user").

Create the account using your authentication details.

Example of CURL-request to the "create account" resource:

curl --location --request POST 'http://127.0.0.1:5000/6/accounts' \
--header 'Content-Type: application/json' \
--data '{
  "login": "user@mail.com",
  "password": "password",
  "account_type": "user",
  "description": "description"
}'

It is necessary to replace the authentication data from the example with your own.

To work with tokens, you must have an account.

Activate GC task schedule#

Before you start working with the LUNA PLATFORM, you can create a schedule for the Garbage collection task.

To do this, make a "create tasks schedule" request to the API service, specifying the necessary rules for the schedule.

An example of a schedule creation command for an account created in section "Account creation" is given below.

The example sets a schedule for the Garbage collection task for events older than 30 days with the removal of the samples and the source images. The task will be repeated once a day at 05:30 am.

curl --location --request POST 'http://127.0.0.1:5000/6/tasks/schedules' \
--header 'Authorization: Basic dXNlckBtYWlsLmNvbTpwYXNzd29yZA==' \
--header 'Content-Type: application/json' \
--data '{
    "task": {
        "task_type": 4,
        "content": {
            "target": "events",
            "filters": {
                "create_time__lt": "now-30d"
            },
            "remove_samples": true,
            "remove_image_origins": true
        }
    },
    "trigger": {"cron": "30 5 * * *", "cron_timezone": "utc"},
    "behaviour": {"start_immediately": false, "create_stopped": false}
}'

If necessary, you can create a schedule without automatically activating it. To do this, specify the parameter "create_stopped": "true". In this case, after creating the schedule, it must be activated manually using the "action" = "start" parameter of the "patch tasks schedule" request.

For more information, see the "Running scheduled tasks" section of the administrator manual.

Enable Grafana and Loki#

Note: Follow these steps if you want to use LUNA Dashboards (Grafana) and Loki. Otherwise, skip this step.

To use Grafana and Loki, you can execute a script start_logging.sh, launching the LUNA Dashboards, Loki and Promtail service. This script must be executed after executing the main Docker Compose script.

See detailed information about monitoring visualization in the "LUNA Dashboards" and "Grafana Loki" section of the administrator manual.

Go to the Docker Compose folder.

cd /var/lib/luna/current/example-docker

Launch Docker Compose.

./start_logging.sh

Check the state of launched Docker containers.

docker ps