dummy

Dummy Executor fakes execution for testing purposes.

Attributes

logger

__version__

Classes

DummyQueue

Implementation of the dummy executor queue, derived from ClusterQueue.

DummyDistributor

The Dummy Executor fakes the execution of a Task and acts as though it succeeded.

DummyWorkerNode

Get Executor Info for a Task Instance.

Functions

get_cluster_queue_class(...)

Return the queue class for the dummy executor.

get_cluster_distributor_class(...)

Return the cluster distributor for the dummy executor.

get_cluster_worker_node_class(...)

Return the cluster worker node class for the dummy executor.

Package Contents

dummy.logger[source]
dummy.__version__[source]
class dummy.DummyQueue(queue_id: int, queue_name: str, parameters: dict)[source]

Bases: jobmon.core.cluster_protocol.ClusterQueue

Implementation of the dummy executor queue, derived from ClusterQueue.

_queue_id[source]
_queue_name[source]
_parameters[source]
validate_resources(strict: bool = False, **kwargs: str | int | float) Tuple[bool, str][source]

No resources defined for sequential execution. All resources valid.

coerce_resources(**kwargs: str | int | float) Dict[source]

Ensures that requested resources aren’t greater than what’s available.

property queue_id: int[source]

Return the ID of the queue.

property queue_name: str[source]

Return the name of the queue.

property parameters: Dict[source]

Return the dictionary of parameters.

property required_resources: List[source]

No required resources for dummy executor, return empty list.

class dummy.DummyDistributor(cluster_name: str, *args: tuple, **kwargs: dict)[source]

Bases: jobmon.core.cluster_protocol.ClusterDistributor

The Dummy Executor fakes the execution of a Task and acts as though it succeeded.

started = False[source]
_cluster_name[source]
property worker_node_entry_point: str[source]

Path to jobmon worker_node_entry_point.

property cluster_name: str[source]

Return the name of the cluster type.

start() None[source]

Start the executor.

stop() None[source]

Stop the executor.

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

Dummy tasks never error, since they never run. So always return an empty dict.

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

Check which task instances are active.

terminate_task_instances(distributor_ids: List[str]) None[source]

No such thing as running Dummy tasks. Therefore, nothing to terminate.

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

Run a fake execution of the task.

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

get_remote_exit_info(distributor_id: str) Tuple[str, str][source]

Get the exit info about the task instance once it is done running.

class dummy.DummyWorkerNode[source]

Bases: jobmon.core.cluster_protocol.ClusterWorkerNode

Get Executor Info for a Task Instance.

_distributor_id: str | None = None[source]
property distributor_id: str | None[source]

Distributor id of the task.

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

Exit info, error message.

static get_usage_stats() Dict[source]

Usage information specific to the exector.

initialize_logfile(log_type: str, log_dir: str, name: str) str[source]

Error and exit code info from the executor.

dummy.get_cluster_queue_class() Type[jobmon.core.cluster_protocol.ClusterQueue][source]

Return the queue class for the dummy executor.

dummy.get_cluster_distributor_class() Type[jobmon.core.cluster_protocol.ClusterDistributor][source]

Return the cluster distributor for the dummy executor.

dummy.get_cluster_worker_node_class() Type[jobmon.core.cluster_protocol.ClusterWorkerNode][source]

Return the cluster worker node class for the dummy executor.