client.task_resources
The client Task Resources with the resources initiation and binding to Task ID.
Attributes
Classes
An object representing the resources for a specific task. |
Module Contents
- client.task_resources.logger
- class client.task_resources.TaskResources(requested_resources: Dict[str, Any], queue: jobmon.core.cluster_protocol.ClusterQueue, requester: jobmon.core.requester.Requester | None = None)
An object representing the resources for a specific task.
Initialize the task resource object.
- requested_resources
- queue
- requester = None
- async bind_async(session: aiohttp.ClientSession) None
Bind TaskResources to the database (asynchronous).
- Parameters:
session – An aiohttp ClientSession for making async HTTP requests.
- coerce_resources() TaskResources
Coerce TaskResources to fit on queue. If resources change return a new object.
- adjust_resources(resource_scales: Dict[str, numbers.Number | Callable | Iterator[numbers.Number]], fallback_queues: List[jobmon.core.cluster_protocol.ClusterQueue] | None = None) TaskResources
Adjust TaskResources after a resource error, returning a new object if it changed.
- Parameters:
resource_scales – Specifies how much to scale the failed Task’s resources by. Scale factor can be a numeric value, a Callable that will be applied to the existing resources, or an Iterator. Any Callable should take a single numeric value as its sole argument. Any Iterator should only yield numeric values. Any Iterable can be easily converted to an Iterator by using the iter() built-in (e.g. iter([80, 160, 190])).
fallback_queues – list of queues that users specify. If their jobs exceed the resources of a given queue, Jobmon will try to run their jobs on the fallback queues.
- static convert_memory_to_gib(memory_str: str) int
Given a memory request with a unit suffix, convert to GiB.