Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space RED and version 6.10-11
Sv translation
languageru

Файл конфигурации sample_compiler.conf

СодержимоеОписание
{

    "Statistics": {...},
см. Общая секция Statistics
    "Logging": {...},
см. Общая секция Logging
    "ThriftServers": {...},
см. Общая секция ThriftServers
    "Discovery": {...}
см. Общая секция Discovery
    "NookDir": "/opt/iw/tm5", 

В секции указывается рабочий каталог модуля. По умолчанию – /opt/iw/tm5

    "UnsafeSignalHandlers":false
Поддержка работы с необрабатываемыми сигналами. По умолчанию выключена (false). При установке значения true позволяется устанавливать в коде обработчики "небезопасных" сигналов (например, SIGSEVG). Добавлять, включать/выключать данную настройку не рекомендуется без предварительной консультации с разработчиками.
    "Bookworm": {...},

см. Общая секция Bookworm

    "EnableOCR": false, 

Включение использования экстрактора OCR, который позволяет сохранять отсканированные эталонные документы в качестве эталонов с текстовым контентом. Значение по умолчанию false

Примечание: необходимо включить OCR в конфигурационном файле warpd.conf (секция warp, параметр EnableOCR:true)

    "ErrorHandlers": {
Описание стратегии обработки ошибок для каждой технологии.
     "autoling": "NoErrorsAllowedHandler",
в данный момент не используется
     "exclusion": "NoErrorsAllowedHandler",
в данный момент не используется
     "form": "AtLeastOneSuccessHandlerWithCleanup",
Эталонные бланки. Значение по умолчанию - AtLeastOneSuccessHandlerWithCleanup (компиляция считается успешной, если был успешно скомпилирован хотя бы один эталонный документ. Эталонный документ считается успешно скомпилированным, если был успешно скомпилирован хотя бы один из составляющих его контентов.
При выборе данной стратегии информация об ошибках отдельных контентов вычищается из результата и клиент получает только информацию
об успешно скомпилированных контентах).
     "image_learn": "NoErrorsAllowedHandler",
в данный момент не используется
     "normal": "AtLeastOneSuccessHandlerNoCleanup",
Эталонные документы. Значение по умолчанию - AtLeastOneSuccessHandlerNoCleanup (аналогично "AtLeastOneSuccessHandlerWithCleanup", но информация об ошибках компиляции контентов передаётся вместе с результатом).
     "stamp": "NoErrorsAllowedHandler",
Эталонные печати. Значение по умолчанию - NoErrorsAllowedHandler (любая ошибка компиляции любого контента приводит к ошибке всей компиляции в целом).
     "table": "NoErrorsAllowedHandler"
Эталонные выгрузки из БД. Значение по умолчанию - NoErrorsAllowedHandler  (любая ошибка компиляции любого контента приводит к ошибке всей компиляции в целом).
    },
 
    "UnsafeSignalHandlers": false, 
Посылать ли при необходимости детали обработки сигнала после внесения соответствующих изменений. Служит для отладки
    "ExtractorCache": {
Параметры кэша экстракторов.
        "ExtractorCacheDepth": 0,
Максимальное количество сохраненных в кеше объектов, значение по умолчанию - 0 (кэш выключен).
        "ExtractorCacheClearExistingDir": true,
Флаг, сигнализирующий, надо ли удалять содержимое директории кэша демона при запуске, если она уже существует и не пустая. Значение по умолчанию true (удалять).
        "ExtractorCacheMaxSize": 107374182400,
Максимальный размер кэша, занимаемый на диске (в байтах).Значение по умолчанию - 107374182400 (100 Гб).
        "ExtractorCacheFileMaxSize": 10485760,
Максимальный размер файла для помещения в кэш (в байтах). Значение по умолчанию - 10485760 (10 Мб).
        "ExtractorCacheShards": 0
Количество потоков для хранения данных в кэше. Если указан 0 - берется количество потоков системы, иначе - указанное количество потоков, желательно не больше количества потоков системы, по умолчанию 0. 
    },
 
    "DebugBreak": false, 
Посылать ли SIGTRAP (SIGBREAK на Windows) при обработке любого исключения. Служит для отладки.
    "OutChunkSizeLimit": 1048576, 
Максимальный размер чанка, в который возвращаются результаты компиляции. Значение по умолчанию 1048576
    "ThreadsCount": 5, 
Количество потоков обработки.
    "Technologies": {
Секция конфигурирования отдельных технологий.
        "FingerprintMinBinFileSize": 256, 
Минимальный размер бинарного эталонного документа (в байтах).
        "FormDelimitersPath": "etc/config-perm/cas/form_delimiters.json", 
Путь до файла с разделителями. Используется для технологии эталонной формы.
        "FormStopWordsPath": "etc/config-perm/cas/form_stopwords.txt", 
Путь к словарю стоп-слов (игнорируемых слов), который используется при анализе форм (документов, в которых есть поля для заполнения).
        "FormMinRows": 2, 
Минимальное допустимое количество полей в эталонном бланке.
        "FingerprintMaxBinFileSize": 31457280, 
Максимально допустимый размер бинарного эталонного документа.
        "FingerprintMinTextFileSize": 256, 
Минимальный размер текстового эталонного документа (в байтах).
        "ImageMatcherConfig": "etc/config-perm/cas/image-matcher.yml", 

Путь к конфигурации технологий анализа изображений.

        "TableStopWordsPath": "etc/config-perm/cas/table_stopwords.txt", 
Путь к словарю стоп-слов для анализа выгрузок из БД.
        "FingerprintMaxTextFileSize": 31457280, 
Максимальный размер текстового эталонного документа (в символах).
        "TableMinRows": 2, 
Минимальное допустимое количество строк в эталонной таблице для выгрузок из БД.
        "TempDir": "tmp/analysis", 
Директория для хранения временных файлов. Значение по умолчанию – tmp/analysis
        "VectorObjectMinSize": 800
Минимальное количество примитивов, которое должно извлечься из векторного изображения для того, чтобы оно считалось эталонным. 
Если извлечётся меньше указанного количества, то выдается ошибка типа: "Файл не подходит в качестве эталона".
    }, 
 
}
 

Unit-файл iw_sample_compiler.service 

КодОписание

[Unit]

Раздел для определения метаданных демона и настройки его взаимодействия с другими демонами
Description=InfoWatch Traffic Monitor Configuration Sample Compiler

Название демона

After=network-online.service iwtm-consul.service  iw_bookworm.service licensed.serviceДемоны, которые будут запущены до запуска текущего демона
  
[Service]Раздел настройки запуска демона

Type=simple

Тип запуска демона. simple - демон запускается и переходит в режим ожидания на консоли

PermissionsStartOnly=true

Запуск команд из ExecStartPre под пользователем root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_sample_compiler

Полный путь и аргументы команды, которые должны быть выполнены до запуска основного процесса

ExecStart=/opt/iw/tm5/bin/iw_sample_compiler -p /opt/iw/tm5/etc --backend $DB_BACKEND

Полный путь и аргументы команды, которая должна быть выполнена для запуска демона. Запускается от пользователя, указанного в User

ExecStop=/bin/kill -s SIGQUIT $MAINPID

Команда для остановки демона. Если не указано, процесс будет немедленно уничтожен, когда демон будет остановлен. Запускается от пользователя, указанного в User

ExecReload=/bin/kill -s SIGHUP $MAINPID

Команда для перезагрузки конфигурации демона, если она доступна. Запускается от пользователя, указанного в User

Restart=on-failure

Команда для рестарта демона, если он остановится или упадет. Значение on-failure означает, что демон будет перезапускаться, если он остановился с ненулевым кодом возврата или был завершен по сигналу (kill <pid_демона>)

RestartSec=5

Время ожидания перед попыткой перезапуска демона

RestartPreventExitStatus=SIGKILL

Команда, по которой можно принудительно завершить работу демона

TimeoutStopSec=0

Время, в течение которого система будет ждать остановки демона, прежде чем пометить его недоступный или завершенный принудительно

User=iwtm

Имя пользователя, от которого осуществляется запуск демона

Group=iwtm

Имя группы пользователя

LimitNOFILE=32768

Максимальное количество открытых файлов

LimitFSIZE=infinity

Максимальный размер файла (КБ). infinity - без ограничений

LimitNPROC=65536

Максимальное количество процессов

LimitCORE=infinity

Ограничение на размер coredump-файла (КБ)

LimitMEMLOCK=infinity

Максимальное заблокированное в памяти адресное пространство (КБ)

 

 
  

[Install]

Определение поведения демона, если он включен или отключен

WantedBy=multi-user.target

Запускать этот демон, когда система грузится в multi-user режиме
Sv translation
languageen

sample_compiler.conf configuration file

ContentDescription
{

"Statistics": {...},See General section Statistics
    "Logging": {...},
See General section Logging
    "ThriftServers": {...},
See General section ThriftServers
    "Discovery": {...}
See Common section Discovery
    "NookDir": "/opt/iw/tm5", 

In this section, the module working directory is specified. By default, /opt/iw/tm5.

"UnsafeSignalHandlers":false
Unhandled signals support. Disabled by default (false). Once true is set, it is allowed to use unsafe handlers in code (e.g. SIGSEVG). Adding, enabling/disabling this parameter is not recommended without consultation with developers.
    "Bookworm": {...},

See General section Bookworm

    "EnableOCR": false, 

Enabling OCR extractor, able to store scanned standard documents like a text content standard. Default value - false

Note: it is required to enable OCR in warpd.conf configuration file (warp section, value EnableOCR:true).

    "ErrorHandlers": {
Errors processing strategy description for each technology.
"autoling": "NoErrorsAllowedHandler",Is not used at present time.
    "exclusion": "NoErrorsAllowedHandler",
Is not used at present time.
    "form": "AtLeastOneSuccessHandlerWithCleanup",

Reference blanks. Default value - AtLeastOneSuccessHandlerWithCleanup (the compilation is considered to be successful if any reference document was successfully compiled. Reference document is considered to be compiled if any component of this document was successfully compiled.

Choosing this strategy should admit that separate contents error information is wiped from the result and a client can get only successful contents compilations info).

    "image_learn": "NoErrorsAllowedHandler",
Is not used at present time
    "normal": "AtLeastOneSuccessHandlerNoCleanup",
Reference documents. Default value - AtLeastOneSuccessHandlerNoCleanup (similar to "AtLeastOneSuccessHandlerWithCleanup", but the content compilations error information is to be provided in conjuction with result).
    "stamp": "NoErrorsAllowedHandler",
Reference stamps. Default value - NoErrorsAllowedHandler (any compilation error of any content results in an error of the whole compilation).
    "table": "NoErrorsAllowedHandler"
Reference unloadings from DB. Default value - NoErrorsAllowedHandler (any compilation error of any content results in an error of the whole compilation).
     },
 
    "UnsafeSignalHandlers": false, 
If the processing details should be sent after the changes have been implemented. Used for debugging purposes.
    "ExtractorCache": {
Extractors cache parameters
    "ExtractorCacheDepth": 0,
Maximum number of objects stored in cache, default value - 0 (cache is disabled).
    "ExtractorCacheClearExistingDir": true,
Flag specifying if the daemon cache directory content should be removed once started if it exists and not empty. The default value is - true (to remove).
    "ExtractorCacheMaxSize": 107374182400,
Maximum size of cache on the drive (in bytes) The default value is 107374182400 (100 GB).
    "ExtractorCacheFileMaxSize": 10485760,
Maximum file size to be placed into cache (bytes). The default value is 10485760 (10 MB).
    "ExtractorCacheShards": 0
Number of streams to store data in cache. If 0 is specified the number of System's streams is considered, otherwise - the number of streams specified, preferable that it wasn't bigger than the system's streams number. Default value is - 0.
     },
 
    "DebugBreak": false, 
If SIGTRAP should be sent (SIGBREAK to Windows) while any exception handling. Used for debugging purposes.
    "OutChunkSizeLimit": 1048576, 
Maximum size of chunk where the compilation results are returned. Default value - 1048576
    "ThreadsCount": 5, 
Number of handling streams
    "Technologies": {
Separate technologies configuration section
        "FingerprintMinBinFileSize": 256, 
Minimum size of binary reference document (bytes)
        "FormDelimitersPath": "etc/config-perm/cas/form_delimiters.json",
Path to delimiters file. Used for reference form technology
        "FormStopWordsPath": "etc/config-perm/cas/form_stopwords.txt", 
Path to stop words glossary (ignored words) used to analyze forms (documents containing fields to be filled in).
        "FormMinRows": 2, 
Minimum number of fields in reference blank form
        "FingerprintMaxBinFileSize": 31457280, 
Maximum size of binary reference document
        "FingerprintMinTextFileSize": 256, 
Minimum size of text reference document (bytes)
        "ImageMatcherConfig": "etc/config-perm/cas/image-matcher.yml", 

Path to configuration of technology image analysis

        "TableStopWordsPath": "etc/config-perm/cas/table_stopwords.txt", 
Path to stop words glossary to analyze DB unloadings
        "FingerprintMaxTextFileSize": 31457280, 
Maximum size of text sample document (characters)
        "TableMinRows": 2, 
Minimum number of rows in a sample table for DB unloadings
        "TempDir": "tmp/analysis", 
Directory to store temporary files. Default value - tmp/analysis
        "VectorObjectMinSize": 800
Minimum number of primitives to be extracted from vector image to be considered the standard ones. If it is extracted less than the number specified, the error occures: "File does not fit the standard".
    }, 
 
}
 

iw_sample_compiler.service unit file

CodeDescription

[Unit]

A section where the daemon metadata is determined and interaction settings with other daemons are specified
Description=InfoWatch Traffic Monitor Configuration Sample Compiler

Daemon name

After=network-online.service iwtm-consul.service  iw_bookworm.service licensed.serviceDaemons that will be started before the current one
  
[Service]A section where the daemon start settings are specified

Type=simple

Daemon start type. simple - the daemon is started and goes into standby on the console

PermissionsStartOnly=true

Running commands from ExecStartPre under root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_sample_compiler

The full path and arguments of the command that should be executed before the main process is started

ExecStart=/opt/iw/tm5/bin/iw_sample_compiler -p /opt/iw/tm5/etc --backend $DB_BACKEND

The full path and command arguments that should be executed before starting the daemon. The command is run under user specified in the User field

ExecStop=/bin/kill -s SIGQUIT $MAINPID

A command to stop the daemon. If the command is not specified, the process will be killed once the daemon is stopped. The command is run under user specified in the User field

ExecReload=/bin/kill -s SIGHUP $MAINPID

A command that reloads the daemon configuration if it is available. The command is run under user specified in the User field

Restart=on-failure

A command that restarts the daemon when it stops or crashes. The on-failure value indicates that the daemon will be restarted if it has stopped with a non-zero return code or was ended by signal (kill <daemon_pid>)

RestartSec=5

A timeout before attempting to restart the daemon

RestartPreventExitStatus=SIGKILL

A command that forcibly ends the daemon operation

TimeoutStopSec=0

The time during which the system waits for the signal to stop before marking the process as unavailable or terminated

User=iwtm

The name of the user under whose account the daemon is started

Group=iwtm

Name of the user group

LimitNOFILE=32768

The maximum number of open files

LimitFSIZE=infinity

The maximum size of a file (KB). The infinity value means that the size is unlimited

LimitNPROC=65536

The maximum number of processes

LimitCORE=infinity

Limit for core dump size (KB)

LimitMEMLOCK=infinity

The maximum size of memory locked address space (KB)

 

 
  

[Install]

Defines the behavior of a daemon when it is enabled/disabled

WantedBy=multi-user.target

Start the daemon when the system is loaded in multi-user mode