client.task_template_version ============================ .. py:module:: client.task_template_version .. autoapi-nested-parse:: Task Templates are versioned to recognize changes to args and command templates. Attributes ---------- .. autoapisummary:: client.task_template_version.logger Classes ------- .. autoapisummary:: client.task_template_version.TaskTemplateVersion Module Contents --------------- .. py:data:: logger .. py:class:: TaskTemplateVersion(command_template: str, node_args: list, task_args: list, op_args: list, requester: Optional[jobmon.core.requester.Requester] = None) Task Templates are versioned to recognize changes to args and command templates. Initialization of task template version object. .. py:attribute:: command_template .. py:property:: node_args :type: set Return task template version node args. Any named arguments in command_template that make the command unique within this template for a given workflow run. Generally these are arguments that can be parallelized over. .. py:property:: task_args :type: set Task template version task args. Any named arguments in command_template that make the command unique across workflows if the node args are the same as a previous workflow. Generally these are arguments about data moving though the task. .. py:property:: op_args :type: set Return the task template version OP args. Any named arguments in command_template that can change without changing the identity of the task. Generally these are things like the task executable location or the verbosity of the script. .. py:attribute:: default_compute_resources_set :type: Dict[str, Dict[str, Any]] .. py:attribute:: default_resource_scales_set :type: Dict[str, Dict[str, float]] .. py:attribute:: default_cluster_name :type: str :value: '' .. py:attribute:: default_max_attempts :type: Optional[int] :value: None .. py:attribute:: requester :value: None .. py:method:: get_task_template_version(task_template: jobmon.client.task_template.TaskTemplate, command_template: str, node_args: List[str] = [], task_args: List[str] = [], op_args: List[str] = []) -> TaskTemplateVersion :classmethod: Get a bound TaskTemplateVersion object from parameters. :param task_template: TaskTemplate this version should be associated with. :param command_template: an abstract command representing a task, where the arguments to the command have defined names but the values are not assigned. eg: '{python} {script} --data {data} --para {para} {verbose}' :param node_args: any named arguments in command_template that make the command unique within this template for a given workflow run. Generally these are arguments that can be parallelized over. :param task_args: any named arguments in command_template that make the command unique across workflows if the node args are the same as a previous workflow. Generally these are arguments about data moving though the task. :param op_args: any named arguments in command_template that can change without changing the identity of the task. Generally these are things like the task executable location or the verbosity of the script. .. py:method:: from_wire(wire_tuple: Tuple, task_template: jobmon.client.task_template.TaskTemplate) -> TaskTemplateVersion :classmethod: Get a bound TaskTemplateVersion object from the http wire format. :param task_template: TaskTemplate this version should be associated with. :param wire_tuple: Wire format for ToolVersion defined in jobmon.serializers. .. py:method:: bind(task_template: jobmon.client.task_template.TaskTemplate) -> None Bind task template version to the DB. :param task_template: the TaskTemplate that this version is associated with. .. py:property:: is_bound :type: bool If the task template version has been bound to the database. .. py:property:: task_template :type: jobmon.client.task_template.TaskTemplate .. py:property:: id :type: int The unique ID of the task template version if it has been bound. .. py:property:: id_name_map :type: Dict[str, int] Map of arg ids to arg names if bound to the db. .. py:property:: template_args :type: set The argument names in the command template. .. py:property:: arg_mapping_hash :type: int Hash args to identify unique task_template. .. py:method:: filter_kwargs(arg_type: str, **kwargs: str) -> Dict[str, Any] Return the set of kwargs that are of arg_type. :param arg_type: either node_args, task_args, op_args :param kwargs: the key/value pairs to be filtered by type .. py:method:: convert_arg_names_to_ids(**kwargs: str) -> Dict[int, Any] Map from names to ids. .. py:method:: update_default_compute_resources(cluster_name: str, **kwargs: Any) -> None Update compute resources in place only overridding specified keys. If no default cluster is specified when this method is called, cluster_name will become the default cluster. :param cluster_name: name of cluster to modify default values for. :param \*\*kwargs: any key/value pair you want to update specified as an argument. .. py:method:: update_default_resource_scales(cluster_name: str, **kwargs: Any) -> None Update resource scales in place only overridding specified keys. If no default cluster is specified when this method is called, cluster_name will become the default cluster. :param cluster_name: name of cluster to modify default values for. :param \*\*kwargs: any key/value pair you want to update specified as an argument. .. py:method:: set_default_compute_resources_from_dict(cluster_name: str, compute_resources: Dict[str, Any]) -> None Set compute resources for a given cluster_name. If no default cluster is specified when this method is called, cluster_name will become the default cluster. :param cluster_name: name of cluster to set default values for. :param compute_resources: dictionary of default compute resources to run tasks with. Can be overridden at task template or task level. dict of {resource_name: resource_value} .. py:method:: set_default_resource_scales_from_dict(cluster_name: str, resource_scales: Dict[str, float]) -> None Set compute resources and scales for a given cluster_name. If no default cluster is specified when this method is called, cluster_name will become the default cluster. :param cluster_name: name of cluster to set default values for. :param resource_scales: dictionary of default resource scales to adjust task resources with. Can be overridden at task level. dict of {resource_name: scale_value} .. py:method:: set_default_max_attempts(value: int) -> None Set default max attempts at tool leve. :param value: the default max attempts value.