dummy ===== .. py:module:: dummy .. autoapi-nested-parse:: Dummy Executor fakes execution for testing purposes. Attributes ---------- .. autoapisummary:: dummy.logger dummy.__version__ Classes ------- .. autoapisummary:: dummy.DummyQueue dummy.DummyDistributor dummy.DummyWorkerNode Functions --------- .. autoapisummary:: dummy.get_cluster_queue_class dummy.get_cluster_distributor_class dummy.get_cluster_worker_node_class Package Contents ---------------- .. py:data:: logger .. py:data:: __version__ .. py:class:: DummyQueue(queue_id: int, queue_name: str, parameters: dict) Bases: :py:obj:`jobmon.core.cluster_protocol.ClusterQueue` Implementation of the dummy executor queue, derived from ClusterQueue. .. py:attribute:: _queue_id .. py:attribute:: _queue_name .. py:attribute:: _parameters .. py:method:: validate_resources(strict: bool = False, **kwargs: Union[str, int, float]) -> Tuple[bool, str] No resources defined for sequential execution. All resources valid. .. py:method:: coerce_resources(**kwargs: Union[str, int, float]) -> Dict Ensures that requested resources aren't greater than what's available. .. py:property:: queue_id :type: int Return the ID of the queue. .. py:property:: queue_name :type: str Return the name of the queue. .. py:property:: parameters :type: Dict Return the dictionary of parameters. .. py:property:: required_resources :type: List No required resources for dummy executor, return empty list. .. py:class:: DummyDistributor(cluster_name: str, *args: tuple, **kwargs: dict) Bases: :py:obj:`jobmon.core.cluster_protocol.ClusterDistributor` The Dummy Executor fakes the execution of a Task and acts as though it succeeded. .. py:attribute:: started :value: False .. py:attribute:: _cluster_name .. py:property:: worker_node_entry_point :type: str Path to jobmon worker_node_entry_point. .. py:property:: cluster_name :type: str Return the name of the cluster type. .. py:method:: start() -> None Start the executor. .. py:method:: stop() -> None Stop the executor. .. py:method:: get_queueing_errors(distributor_ids: List[str]) -> Dict[str, str] Dummy tasks never error, since they never run. So always return an empty dict. .. py:method:: get_submitted_or_running(distributor_ids: Optional[List[str]] = None) -> Set[str] Check which task instances are active. .. py:method:: terminate_task_instances(distributor_ids: List[str]) -> None No such thing as running Dummy tasks. Therefore, nothing to terminate. .. py:method:: 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 (e.g. sbatch or qsub). Here, since it's a dummy executor, we just get a random number and empty file paths. .. py:method:: get_remote_exit_info(distributor_id: str) -> Tuple[str, str] Get the exit info about the task instance once it is done running. .. py:class:: DummyWorkerNode Bases: :py:obj:`jobmon.core.cluster_protocol.ClusterWorkerNode` Get Executor Info for a Task Instance. .. py:attribute:: _distributor_id :type: Optional[str] :value: None .. py:property:: distributor_id :type: Optional[str] Distributor id of the task. .. py:method:: get_exit_info(exit_code: int, error_msg: str) -> Tuple[str, str] :staticmethod: Exit info, error message. .. py:method:: get_usage_stats() -> Dict :staticmethod: Usage information specific to the exector. .. py:method:: initialize_logfile(log_type: str, log_dir: str, name: str) -> str Error and exit code info from the executor. .. py:function:: get_cluster_queue_class() -> Type[jobmon.core.cluster_protocol.ClusterQueue] Return the queue class for the dummy executor. .. py:function:: get_cluster_distributor_class() -> Type[jobmon.core.cluster_protocol.ClusterDistributor] Return the cluster distributor for the dummy executor. .. py:function:: get_cluster_worker_node_class() -> Type[jobmon.core.cluster_protocol.ClusterWorkerNode] Return the cluster worker node class for the dummy executor.