Skip to main content

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.

OptionTypeDefaultMeaning
addressstringnoneAddress 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
roleboth, server or workerboth without an address, worker with oneWhere the workers run. See Roles
workers_per_nodeinteger4Worker processes started on each node
hosts_per_workerinteger16Hosts that one worker runs at the same time
max_abandoned_callsinteger4Sync 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_timeoutnumbernoneSeconds each host may run
timeoutnumbernoneSeconds the whole run may take
connect_timeoutnumber10Seconds to connect to the cluster, for the roles server and worker
worker_start_timeoutnumber60Seconds to wait for a new worker to start
site_keystringnoneInventory 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:

  1. the arguments given to RayRunner(...) in code;
  2. the Nornir configuration, runner.options, when runner.plugin is ray;
  3. the environment variable RAY_ADDRESS, for address only;
  4. 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​

RoleWorkers run onAddress
bothThe 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 clusterMust not be set
serverEvery node of the cluster except the driver's nodeRequired
workerEvery node of the cluster, the driver's node includedRequired

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​

VariableEffect
RAY_ADDRESSSets 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_ENVnornir_ray sets it to 0 on import when it is not set. See Installation