Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 1.89 KB

worker.md

File metadata and controls

72 lines (57 loc) · 1.89 KB

Worker

The worker backend TBD.

Configuration

The worker backend does not require any special configuration, though overriding host and port values can be specified. The backend will use the diode settings specified in the common subsection to forward discovery results.

orb:
  backends:
    common:
      diode:
        target: grpc://192.168.0.100:8080/diode
        api_key: ${DIODE_API_KEY}
        agent_name: agent01
    worker:
      host: 192.168.5.11 # default 0.0.0.0
      port: 8857 # default 8071

Policy

Worker policies are broken down into two subsections: config and scope.

Config

Config defines data for the whole scope and is optional overall.

Parameter Type Required Description
package str yes custom python package that implements Backend Class
schedule cron format no If defined, it will execute scope following cron schedule time. If not defined, it will execute scope only once

Scope

The scope can be defined

Sample

A sample policy including all parameters supported by the device discovery backend.

orb:
  ...
  policies:
    worker:
      custom_policy:
        config:
          package: nbl_custom
          schedule: "* * * * *"
          custom_config: custom
        scope:
          custom: any

Custom Workers

To specify required custom workers packages, use the environment variable INSTALL_WORKERS_PATH. Ensure that the required files are placed in the mounted volume (/opt/orb).

Mounted folder example:

/local/orb/
├── agent.yaml
├── workers.txt
├── my-worker/
└── nbl-custom-worker-1.0.2.tar.gz

Example workers.txt:

my-custom-wkr==0.1.2 # try install from pypi
nbl-custom-worker-1.0.2.tar.gz # try install from a tar.gz
./my-worker # try to install from a folder that contains project.toml