Factory Configuration File

Every Video Recognition Gateway (VIRGO) daemon on Linux ships with factory settings which define the default configuration that the daemon should use the first time it starts up. Virgod also reverts the current configuration back to the factory settings if it is unable to load the current configuration because of a version mismatch and it is unable to automatically convert the old configuration to the new format.

The factory settings are stored in a JSON file with the name virgo-factory.conf. Virgod looks in the following locations to find a factory configuration file:

Virgod loads the first factory configuration file that it finds. If it can't find any factory configuration file, it falls back to hardcoded defaults.

Factory Configuration File Format

The factory configuration file is a JSON file which is organized into (optional) sections:

{
   "global": {            // [optional]
      // global state
   },
   "environments": {      // [optional]
      "Foo": {
         // environment-specific URLs
      }
   },
   "feeds": {             // [optional]
      "camera_1": {
         // feed state
      }
   }
}

Note: Nearly all keys in a factory configuration file are optional. Only those keys that you explicitly want to override with a custom value need to be specified. Virgod uses hardcoded default values for keys that are missing from a factory configuration file.

The Global Section

The following properties are supported in the global section:

Property Type Default Description
status-interval Int? 5000 Status reporting time interval in ms.
environment String? PROD The name of the environment which should be used by virgod. See the "Environments Section" below for a list of pre-defined environment names.
machine-id-prefix String? empty string The machine ID prefix. The default machine ID prefix is the empty string.
machine-id String? OS defined machine ID The machine ID. The default machine ID is derived from the OS provided machine ID. The concatenation of the machine-id-prefix and the machine-id is sent to the cloud in the X-CLIENT-ID header.
client-type String? OS defined client type The client type. This value is sent to the cloud in the X-CLIENT-TYPE header.
user-id String The user ID for the cloud account.
user-password String The password for the cloud account. Note that the password is stored in clear text. Use user-encrypted-password whenever possible instead.
user-encrypted-password String The encrypted password for the cloud account.
administrator String? cloud Specifies whether VIRGO should be administrated by VIRGA or whether it should be self-administrated. A self-administrated VIRGO allows you to manage feeds via the VIRGO command line tool.
visible-accelerator-ids [Int]? Allows you to specify which GPUs/accelerators VIRGO is allowed to use for video decoding and detection tasks. Only the accelerators listed in this array will be used by VIRGO; all others will be ignored. The value is an array of accelerator IDs. VIRGO will use all available accelerators if this property is not set.

Note that feeds which are assigned to a specific accelerator ID will fail with an error at startup if that accelerator is not in the set of visible accelerator IDs.

The Environments Section

The environments section defines the available cloud environments. Each environment has a name and a set of URLs that point to the hosts in the cloud that provide the required services. An environment may override one of the pre-defined environments. The environment name is used to identify the environment and to switch among environments with the virgo environment set command.

The following properties are supported in the environments section:

Property Type Default Description
covi-server-url URL none The face recognition service.
rncv-server-url URL? none The face detection service.
event-server-url URL none The detection and recognition event recording service.
object-server-url URL none The service which stores objects such as images and logs.
admin-server-url URL none The VIRGO administration service.

The following table lists the pre-defined environments:

Name Alternative name
SAFR Local LOCAL
SAFR Developer Cloud DEV
SAFR Partner Cloud INT2
SAFR Cloud PROD

You can use the alternative environment name in place of the full environment name.

The Client ID

VIRGO computes the client ID by concatenating the machine-id-prefix and the machine-id properties.

Example Configuration Files

The following subsections show some typical factory configuration files.

Using VIRGO with a VIRGA Server

This is an example of a configuration file which configures VIRGO to run as a slave to a Video Recognition Gateway Admin (VIRGA) server. VIRGO will continuously report its status to the VIRGA server and the VIRGA server is responsible for pushing state changes to VIRGO.

{
   "global" : {
      "environment": "PROD",
      "machine-id-prefix": "foo",
      "user-id": <user ID>,
      "user-password": <password>
   }
}

Using VIRGO Standalone

This is an example of a configuration file which configures VIRGO to run as a standalone daemon which does not connect to a VIRGA server. VIRGO starts processing the declared feeds as soon as it starts up. Note that you still have to provide a user ID and a password to allow VIRGO to use the (cloud-based) face recognition and event recording service.

{
   "global":{
      "environment": "PROD",
      "machine-id": "argusrn",
      "user-id": <user ID>,
      "user-password": <password>,
      "administrator":"self"
   },
   "feeds":{
      "camera_1":{
         "directory":"test",
         "input.type":"stream",
         "input.stream.url":"file://<absolute path to a movie file>",
         "recognizer.learning-enabled":true,
         "enabled":true
      }
   }
}

Defining Custom Environments

This is an example of a configuration file which defines two custom cloud environments. Note that the first custom environment has a new unique name that is separate from any of the pre-defined environments. The second custom environment, on the other hand, overrides the pre-defined environment name PROD. Consequently VIRGO will use the URLs of the custom environment if the PROD environment is selected. This allows you to replace the built-in definition of the pre-defined environment.

{
   "global": {
      "environment": "Test"
   },
   "environments": {
      "Test": {
         "covi-server-url": "https://covi.test.real.com",
         "event-server-url": "https://event.test.real.com",
         "object-server-url": "https://object.test.real.com",
         "admin-server-url": "https://admin.test.real.com"
      },
      "PROD": {
         "covi-server-url": "https://covi.sim.real.com",
         "event-server-url": "https://event.sim.real.com",
         "object-server-url": "https://object.sim.real.com",
         "admin-server-url": "https://admin.sim.real.com"
      }
   }
}

See Also