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: 1>

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: 2>

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: 3>

Functions

get_image_config([img_name])

look_up_image_info(name, tag[, optional_tag])

Looks up the image tag from environment variable (should be set from the Dockerfile).

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.

EntrypointSettings([path, command, version])

This object carries information about the command, path and version of the entrypoint program that will be invoked to execute tasks at runtime.

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

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

FastSerializationSettings([enabled, ...])

This object hold information about settings necessary to serialize an object so that it can be fast-registered.

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

Image(name, fqn, tag)

Image is a structured wrapper for task container images used in object serialization.

ImageConfig([default_image, images])

ImageConfig holds available images which can be used at registration time.

SerializationSettings(project, domain, ...)

These settings are provided while serializing a workflow and task, before registration.