Runner options
Set these options in runner.options of the Nornir configuration, or as arguments of
RayRunner(...). The names are the same in both places.
| Option | Type | Default | Meaning |
|---|---|---|---|
address | string | none | Address of the Ray cluster, host:port, for the roles server and worker. Without it, the role both uses the Ray already started in the process, or starts a local Ray |
role | both, server or worker | both without an address, worker with one | Where the workers run. See Roles |
workers_per_node | integer | 4 | Worker processes started on each node |
hosts_per_worker | integer | 16 | Hosts that one worker runs at the same time |
max_abandoned_calls | integer | 4 | Sync calls past their deadline that a worker may still be running before the runner replaces it at the start of the next run |
per_host_timeout | number | none | Seconds each host may run |
timeout | number | none | Seconds the whole run may take |
connect_timeout | number | 10 | Seconds to connect to the cluster, for the roles server and worker |
worker_start_timeout | number | 60 | Seconds to wait for a new worker to start |
site_key | string | none | Inventory data key that holds a host's site, in place of ray.site |
Where the runner reads an option
The runner reads each option from the first of these sources that sets it:
- the arguments given to
RayRunner(...)in code; - the Nornir configuration,
runner.options, whenrunner.pluginisray; - the environment variable
RAY_ADDRESS, foraddressonly; - the default.
When InitNornir builds the runner from runner.options, the source of those options is the
configuration.
Nornir reads per_host_timeout and timeout before the run starts. For a runner created in
code, they come from the arguments given to RayRunner(...) only.
An unknown option name or an invalid value raises
RunnerSettingsError, which names the option, the value and its source.
Roles
| Role | Workers run on | Address |
|---|---|---|
both | The machine that runs the script, with a local Ray. The runner starts a new local Ray when the process has none, even when the machine has joined a cluster | Must not be set |
server | Every node of the cluster except the driver's node | Required |
worker | Every node of the cluster, the driver's node included | Required |
Nodes that run workers are the live nodes with at least one CPU.
See Choose a deployment for when to use each role.
Environment variables
| Variable | Effect |
|---|---|
RAY_ADDRESS | Sets the option address when neither the code nor the configuration sets it. With the role both, an address from this variable is an error |
RAY_ENABLE_UV_RUN_RUNTIME_ENV | nornir_ray sets it to 0 on import when it is not set. See Installation |