Skip to main content

NewTaskExecutionContext

Creates a TaskExecutionContext from a TaskAction and supporting dependencies.

def NewTaskExecutionContext(
taskAction: *flyteorgv1.TaskAction,
dataStore: *storage.DataStore,
pluginStateMgr: *PluginStateManager,
secretManager: pluginsCore.SecretManager,
resourceManager: pluginsCore.ResourceManager,
catalogClient: catalog.AsyncClient
) - > *taskExecutionContext, error

Creates a TaskExecutionContext from a TaskAction and supporting dependencies. This function initializes various components like task readers, input/output handlers, and metadata, which are essential for executing a task within the Flyte system.

Parameters

NameTypeDescription
taskAction*flyteorgv1.TaskActionThe TaskAction object containing the task's specification and current status.
dataStore*storage.DataStoreThe data store client used for reading and writing task inputs and outputs.
pluginStateMgr*PluginStateManagerThe plugin state manager responsible for managing the state of task plugins.
secretManagerpluginsCore.SecretManagerThe secret manager used to access and manage secrets required by the task.
resourceManagerpluginsCore.ResourceManagerThe resource manager for handling and allocating resources needed by the task.
catalogClientcatalog.AsyncClientThe asynchronous catalog client for interacting with the Flyte catalog service.

Returns

TypeDescription
*taskExecutionContext, errorA new TaskExecutionContext object or an error if initialization fails.