flytekit.FlyteContextManager#
- class flytekit.FlyteContextManager[source]#
FlyteContextManager manages the execution context within Flytekit. It holds global state of either compilation or Execution. It is not thread-safe and can only be run as a single threaded application currently. Context’s within Flytekit is useful to manage compilation state and execution state. Refer to
CompilationState
andExecutionState
for more information. FlyteContextManager provides a singleton stack to manage these contexts.Typical usage is
FlyteContextManager.initialize() with FlyteContextManager.with_context(o) as ctx: pass # If required - not recommended you can use FlyteContextManager.push_context() # but correspondingly a pop_context should be called FlyteContextManager.pop_context()
Methods
- static with_context(b)[source]#
- Parameters
b (flytekit.core.context_manager.FlyteContext.Builder) –
- Return type
Generator[flytekit.core.context_manager.FlyteContext, None, None]