Skip to main content

TaskExecutionMetadata

This interface represents any execution information for a Task. It is used to communicate meta information about the execution or any previously stored information. It provides methods to retrieve details such as the owner ID, task execution ID, namespace, owner reference, overrides, labels, and annotations.

Methods


GetOwnerID()

@classmethod
def GetOwnerID() - > types.NamespacedName

Returns the owning Kubernetes object.

Returns

TypeDescription
types.NamespacedNameThe NamespacedName of the owning Kubernetes object.

GetTaskExecutionID()

@classmethod
def GetTaskExecutionID() - > [TaskExecutionID](taskexecutionid.md?sid=flyteplugins_go_tasks_pluginmachinery_core_taskexecutionid)

GetTaskExecutionID is a specially generated task execution id, that is guaranteed to be unique and consistent for subsequent calls.

Returns

TypeDescription
[TaskExecutionID](taskexecutionid.md?sid=flyteplugins_go_tasks_pluginmachinery_core_taskexecutionid)A unique and consistent identifier for the task execution.

GetNamespace()

@classmethod
def GetNamespace() - > string

Retrieves the Kubernetes namespace associated with the task execution. Callers use this to determine the deployment context of the task.

Returns

TypeDescription
stringThe Kubernetes namespace where the task is executing.

GetOwnerReference()

@classmethod
def GetOwnerReference() - > v12.OwnerReference

Fetches the Kubernetes OwnerReference for the task execution. This is used to establish ownership relationships between Kubernetes objects.

Returns

TypeDescription
v12.OwnerReferenceThe Kubernetes OwnerReference object.

GetOverrides()

@classmethod
def GetOverrides() - > [TaskOverrides](taskoverrides.md?sid=flyteplugins_go_tasks_pluginmachinery_core_taskoverrides)

Retrieves any task-specific overrides applied to the execution. Callers use this to understand custom configurations or modifications for the task.

Returns

TypeDescription
[TaskOverrides](taskoverrides.md?sid=flyteplugins_go_tasks_pluginmachinery_core_taskoverrides)The TaskOverrides object containing custom configurations for the task.

GetLabels()

@classmethod
def GetLabels() - > map[string]string

Fetches the Kubernetes labels associated with the task execution. These labels are used for organizing and selecting Kubernetes objects.

Returns

TypeDescription
map[string]stringA map of string keys to string values representing the Kubernetes labels.

GetMaxAttempts()

@classmethod
def GetMaxAttempts() - > uint32

Retrieves the maximum number of attempts configured for the task execution. This value determines how many times the task can be retried upon failure.

Returns

TypeDescription
uint32The maximum number of attempts allowed for the task execution.

GetAnnotations()

@classmethod
def GetAnnotations() - > map[string]string

Fetches the Kubernetes annotations associated with the task execution. Annotations are used to attach non-identifying metadata to Kubernetes objects.

Returns

TypeDescription
map[string]stringA map of string keys to string values representing the Kubernetes annotations.

GetK8sServiceAccount()

@classmethod
def GetK8sServiceAccount() - > string

Retrieves the Kubernetes Service Account name used for the task execution. This service account dictates the permissions available to the task within the Kubernetes cluster.

Returns

TypeDescription
stringThe name of the Kubernetes Service Account.

GetSecurityContext()

@classmethod
def GetSecurityContext() - > *core.SecurityContext

Fetches the Kubernetes SecurityContext applied to the task execution. This context defines privilege and access control settings for the task's containers.

Returns

TypeDescription
*core.SecurityContextA pointer to the Kubernetes SecurityContext object.

IsInterruptible()

@classmethod
def IsInterruptible() - > bool

Checks if the task execution is configured to be interruptible. Callers use this to determine if the task can be preempted or stopped gracefully.

Returns

TypeDescription
boolTrue if the task is interruptible, false otherwise.

GetPlatformResources()

@classmethod
def GetPlatformResources() - > *v1.ResourceRequirements

Retrieves the platform resource requirements for the task execution. This includes CPU, memory, and other resource limits and requests.

Returns

TypeDescription
*v1.ResourceRequirementsA pointer to the Kubernetes ResourceRequirements object specifying resource needs.

GetInterruptibleFailureThreshold()

@classmethod
def GetInterruptibleFailureThreshold() - > int32

Retrieves the failure threshold for interruptible tasks. This value determines how many failures an interruptible task can tolerate before being marked as permanently failed.

Returns

TypeDescription
int32The number of failures an interruptible task can sustain.

GetEnvironmentVariables()

@classmethod
def GetEnvironmentVariables() - > map[string]string

Fetches the environment variables configured for the task execution. These variables provide runtime configuration to the task's processes.

Returns

TypeDescription
map[string]stringA map of string keys to string values representing the environment variables.

GetExternalResourceAttributes()

@classmethod
def GetExternalResourceAttributes() - > [ExternalResourceAttributes](externalresourceattributes.md?sid=flyteplugins_go_tasks_pluginmachinery_core_externalresourceattributes)

Retrieves attributes related to external resources used by the task. Callers use this to understand dependencies on resources outside the immediate execution environment.

Returns

TypeDescription
[ExternalResourceAttributes](externalresourceattributes.md?sid=flyteplugins_go_tasks_pluginmachinery_core_externalresourceattributes)The ExternalResourceAttributes object containing details about external resources.

GetConsoleURL()

@classmethod
def GetConsoleURL() - > string

Fetches the URL for the console or UI where the task execution can be monitored. Callers use this to provide direct links to task status and logs.

Returns

TypeDescription
stringThe URL to the console or UI for the task execution.