InProcessRunner#

class InProcessRunner[source]#

Bases: Runner

Runs each command sequentially within a single process.

Useful for testing and debugging.

__init__()#

Methods

__init__()

get_split_ind()

Get the split_ind for the process.

run(cfg_json_uri, pipeline, commands[, ...])

Run commands in a Pipeline using a serialized PipelineConfig.

run_command(cmd)

Run a single command.

get_split_ind() Optional[int]#

Get the split_ind for the process.

For split commands, the split_ind determines which split of work to perform within the current OS process. The CLI has a –split-ind option, but some runners may have their own means of communicating the split_ind, and this method should be overridden in such cases. If this method returns None, then the –split-ind option will be used. If both are null, then it won’t be possible to run the command.

Return type

Optional[int]

run(cfg_json_uri, pipeline, commands, num_splits=1, pipeline_run_name: str = 'raster-vision')[source]#

Run commands in a Pipeline using a serialized PipelineConfig.

Parameters
  • cfg_json_uri – URI of a JSON file with a serialized PipelineConfig

  • pipeline – the Pipeline to run

  • commands – names of commands to run

  • num_splits – number of splits to use for splittable commands

  • pipeline_run_name (str) –

run_command(cmd: List[str])[source]#

Run a single command.

Parameters

cmd (List[str]) – The command to run.