dummy.dummy_distributor

Dummy distributor that runs one task at a time.

Attributes

logger

Classes

LimitedSizeDict

Dictionary for exit info.

DummyDistributor

Executor to run tasks one at a time.

DummyWorkerNode

Get Executor Info for a Task Instance.

Module Contents

dummy.dummy_distributor.logger
class dummy.dummy_distributor.LimitedSizeDict(*args: int, **kwds: int)

Bases: collections.OrderedDict

Dictionary for exit info.

Initialization of LimitedSizeDict.

size_limit
class dummy.dummy_distributor.DummyDistributor(cluster_name: str, exit_info_queue_size: int = 1000, *args: tuple, **kwargs: dict)

Bases: jobmon.core.cluster_protocol.ClusterDistributor

Executor to run tasks one at a time.

Initialization of the dummy distributor.

Parameters:
  • cluster_name (str) – name of the cluster

  • exit_info_queue_size (int) – how many exit codes to retain

started = False
property worker_node_entry_point: str

Path to jobmon worker_node_entry_point.

property cluster_name: str

Return the name of the cluster type.

start() None

Start the distributor.

stop() None

Stop the distributor.

get_queueing_errors(distributor_ids: List[str]) Dict[str, str]

Get the task instances that have errored out.

Dummy runs synchronously so queueing errors aren’t possible.

get_remote_exit_info(distributor_id: str) jobmon.core.exit_info.RemoteExitInfo

Get exit info from task instances that have run.

get_submitted_or_running(distributor_ids: List[str] | None = None) Set[str]

Check status of running task.

Dummy tasks complete before submit_to_batch_distributor returns, so nothing is ever submitted or running at heartbeat time.

terminate_task_instances(distributor_ids: List[str]) None

Terminate task instances.

If implemented, return a list of (task_instance_id, hostname) tuples for any task_instances that are terminated.

submit_to_batch_distributor(command: str, name: str, requested_resources: Dict[str, Any]) str

Run a fake execution of the task.

In a real executor, this is where submission to the cluster would happen. Here, since it’s a dummy executor, we just get a random number and empty file paths.

class dummy.dummy_distributor.DummyWorkerNode

Bases: jobmon.core.cluster_protocol.ClusterWorkerNode

Get Executor Info for a Task Instance.

Initialization of the dummy executor worker node.

property distributor_id: str | None

Distributor id of the task.

initialize_logfile(log_type: str, log_dir: str, name: str) str

Error and exit code info from the executor.

static get_exit_info(exit_code: int, error_msg: str) Tuple[str, str]

Exit info, error message.

static get_usage_stats() Dict

Usage information specific to the exector.