Skip to main content

GetExecutionEnvVars

Generates a list of environment variables relevant to a Flyte task execution, including execution-level and task-definition-level details. It constructs environment variables such as execution ID, project, domain, attempt number, and optionally a console URL, as well as task-specific project, domain, name, and version.

def GetExecutionEnvVars(
id: pluginsCore.TaskExecutionID,
consoleURL: string
) - > []v1.EnvVar

Generates a list of environment variables relevant to a Flyte task execution. This function provides crucial context about the execution, project, domain, and task details, which can be used by tasks running within the Flyte platform.

Parameters

NameTypeDescription
idpluginsCore.TaskExecutionIDThe unique identifier for the task execution, containing details like node execution ID, task ID, and retry attempt. This ID is used to extract relevant project, domain, and task information.
consoleURLstringThe base URL of the Flyte console. If provided and not empty, it is used to construct a FLYTE_EXECUTION_URL environment variable, allowing tasks to link back to their execution in the UI.

Returns

TypeDescription
[]v1.EnvVarA slice of v1.EnvVar objects, each representing an environment variable with its name and value or value source. Returns an empty slice if the provided execution ID is incomplete.