dml_util.runners.local#

Local execution runners.

This module provides runners for executing tasks in local environments. These runners can execute scripts, Python code, conda environments, and other local execution contexts.

Classes

CondaRunner(config, input)

Runs a script in a Conda environment.

HatchRunner(config, input)

Runs a script in a Hatch environment.

ScriptRunner(config, input)

Runs a script locally.

WrappedRunner(config, input)

Runs a script that wraps another runner.

class dml_util.runners.local.CondaRunner(config, input)[source]#

Bases: WrappedRunner

Runs a script in a Conda environment.

Parameters:
classmethod funkify(name, sub, conda_loc=None)[source]#
class dml_util.runners.local.HatchRunner(config, input)[source]#

Bases: WrappedRunner

Runs a script in a Hatch environment.

Parameters:
classmethod funkify(name, sub, path=None, hatch_path=None)[source]#
class dml_util.runners.local.ScriptRunner(config, input)[source]#

Bases: RunnerBase

Runs a script locally.

Parameters:
classmethod funkify(script, cmd=('python3',), suffix='.py')[source]#
gc(state)[source]#

Clean up any resources.

submit()[source]#
update(state)[source]#

Update the state and return the new state, message, and response.

The gc method is called if and only if the returned state is None.

class dml_util.runners.local.WrappedRunner(config, input)[source]#

Bases: RunnerBase

Runs a script that wraps another runner.

Parameters:
classmethod funkify(script, sub)[source]#
run()[source]#

Run the task and return the result.

This method handles acquiring the job lock, updating the state, and returning the response and message. The main logic of the task is implemented in the update method, which must be defined by subclasses.