client.commands.workflow ======================== .. py:module:: client.commands.workflow .. autoapi-nested-parse:: Workflow-related commands. Commands for querying and managing workflow state, including: - Status queries - Task listings - Reset and resume operations - Concurrency limits - Log file paths Attributes ---------- .. autoapisummary:: client.commands.workflow.logger Functions --------- .. autoapisummary:: client.commands.workflow.workflow_status client.commands.workflow.workflow_tasks client.commands.workflow.workflow_reset client.commands.workflow.concurrency_limit client.commands.workflow.get_filepaths client.commands.workflow.resume_workflow_from_id Module Contents --------------- .. py:data:: logger .. py:function:: workflow_status(workflow_id: Optional[List[int]] = None, user: Optional[List[str]] = None, json: bool = False, limit: Optional[int] = 5, requester: Optional[jobmon.core.requester.Requester] = None) -> pandas.DataFrame Get metadata about workflow progress. :param workflow_id: workflow_id/s to retrieve info for. If not specified will pull all workflows by user :param user: user/s to retrieve info for. If not specified will return for current user. :param limit: return # of records order by wf id desc. Return 5 if not provided; return all if [], [<0]. :param json: Flag to return data as JSON :param requester: object to communicate with the flask services :returns: dataframe of all workflows and their status .. py:function:: workflow_tasks(workflow_id: int, status: Optional[List[str]] = None, json: bool = False, limit: int = 5, requester: Optional[jobmon.core.requester.Requester] = None) -> pandas.DataFrame Get metadata about task state for a given workflow. :param workflow_id: workflow_id/s to retrieve info for :param status: limit task state to one of [PENDING, RUNNING, DONE, FATAL] tasks :param json: Flag to return data as JSON :param limit: return # of records order by wf id desc. Return 5 if not provided :param requester: object to communicate with the flask services :returns: Dataframe of tasks for a given workflow .. py:function:: workflow_reset(workflow_id: int, partial_reset: bool = False, requester: Optional[jobmon.core.requester.Requester] = None) -> str Reset a workflow to allow re-running. :param workflow_id: the workflow id to be reset. :param partial_reset: if False, tasks in D state will be reset as well :param requester: http server interface. :returns: A string indicating the workflow_reset result. .. py:function:: concurrency_limit(workflow_id: int, max_tasks: int, requester: Optional[jobmon.core.requester.Requester] = None) -> str Update a workflow's max_concurrently_running field in the database. Used to dynamically adjust the allowed number of jobs concurrently running. :param workflow_id: ID of the running workflow whose max_running value needs to be reset :param max_tasks: new allowed value of parallel tasks :param requester: object to communicate with the flask services :returns: String displaying success or failure of the update. .. py:function:: get_filepaths(workflow_id: int, array_name: str = '', job_name: str = '', limit: int = 5, requester: Optional[jobmon.core.requester.Requester] = None) -> dict Get the stdout/stderr paths of tasks in a workflow. :param workflow_id: ID of the workflow to query :param array_name: Optional filter by array name :param job_name: Optional filter by job name :param limit: Maximum number of results to return :param requester: object to communicate with the flask services :returns: Dictionary of file paths for task instances .. py:function:: resume_workflow_from_id(workflow_id: int, cluster_name: str, reset_if_running: bool = True, log: bool = True, timeout: int = 180, seconds_until_timeout: int = 36000, increase_resource: bool = True, force_cleanup: bool = False) -> None Resume a workflow from its ID. Given a workflow ID, resume the workflow. Raises an error if the workflow is not completed successfully on resume. :param workflow_id: The workflow ID to resume :param cluster_name: Name of the cluster to run on :param reset_if_running: Whether to reset currently running jobs (cold resume) :param log: Whether to configure client logging :param timeout: Timeout for distributor heartbeat and waiting for resume :param seconds_until_timeout: Overall execution timeout :param increase_resource: Whether to increase resources for failed tasks :param force_cleanup: Force cleanup of stuck KILL_SELF task instances