flytekit.extend.context_manager

class ExecutionState.Mode(value)[source]

Defines the possible execution modes, which in turn affects execution behavior.

ExecutionState.Mode.TASK_EXECUTION

This is the mode that is used when a task execution mimics the actual runtime environment. NOTE: This is important to understand the difference between TASK_EXECUTION and LOCAL_TASK_EXECUTION LOCAL_TASK_EXECUTION, is the mode that is run purely locally and in some cases the difference between local and runtime environment may be different. For example for Dynamic tasks local_task_execution will just run it as a regular function, while task_execution will extract a runtime spec

alias of Mode.TASK_EXECUTION

ExecutionState.Mode.LOCAL_WORKFLOW_EXECUTION

This represents when flytekit is locally running a workflow. The behavior of tasks differs in this case because instead of running a task’s user defined function directly, it’ll need to wrap the return values in NodeOutput

alias of Mode.LOCAL_WORKFLOW_EXECUTION

ExecutionState.Mode.LOCAL_TASK_EXECUTION

This is the mode that is used to to indicate a purely local task execution - i.e. running without a container or propeller.

alias of Mode.LOCAL_TASK_EXECUTION

Classes

BranchEvalMode(value)

This is a 3-way class, with the None value meaning that we are not within a conditional context.

CompilationState(prefix[, mode, ...])

Compilation state is used during the compilation of a workflow or task.

ExecutionParameters(execution_date, tmp_dir, ...)

This is a run-time user-centric context object that is accessible to every @task method.

ExecutionState(working_dir[, mode, ...])

This is the context that is active when executing a task or a local workflow.

FlyteContext(file_access[, level, ...])

This is an internal-facing context object, that most users will not have to deal with.

FlyteContextManager()

FlyteContextManager manages the execution context within Flytekit.

FlyteEntities()

This is a global Object that tracks various tasks and workflows that are declared within a VM during the

SecretsManager([secrets_cfg])

This provides a secrets resolution logic at runtime. The resolution order is - Try env var first. The env var should have the configuration.SECRETS_ENV_PREFIX. The env var will be all upper cased - If not then try the file where the name matches lower case configuration.SECRETS_DEFAULT_DIR/<group>/configuration.SECRETS_FILE_PREFIX<key>.