flytekit.core.base_task.TaskMetadata#
- class flytekit.core.base_task.TaskMetadata(cache=False, cache_serialize=False, cache_version='', interruptible=None, deprecated='', retries=0, timeout=None, pod_template_name=None)[source]#
Metadata for a Task. Things like retries and whether or not caching is turned on, and cache version are specified here.
See the IDL for the protobuf definition.
- Parameters
cache (bool) – Indicates if caching should be enabled. See Caching
cache_serialize (bool) – Indicates if identical (ie. same inputs) instances of this task should be executed in serial when caching is enabled. See Caching
cache_version (str) – Version to be used for the cached value
interruptible (Optional[bool]) – Indicates that this task can be interrupted and/or scheduled on nodes with lower QoS guarantees that can include pre-emption. This can reduce the monetary cost executions incur at the cost of performance penalties due to potential interruptions
deprecated (str) – Can be used to provide a warning message for deprecated task. Absence or empty str indicates that the task is active and not deprecated
retries (int) – for retries=n; n > 0, on failures of this task, the task will be retried at-least n number of times.
timeout (Optional[Union[datetime.timedelta, int]]) – the max amount of time for which one execution of this task should be executed for. The execution will be terminated if the runtime exceeds the given timeout (approximately)
pod_template_name (Optional[str]) – the name of existing PodTemplate resource in the cluster which will be used in this task.
- Return type
None
- __init__(cache=False, cache_serialize=False, cache_version='', interruptible=None, deprecated='', retries=0, timeout=None, pod_template_name=None)#
Methods
__init__
([cache, cache_serialize, ...])to_taskmetadata_model
()Converts to _task_model.TaskMetadata
Attributes
cache
cache_serialize
cache_version
deprecated
interruptible
pod_template_name
retries
retry_strategy
timeout