- class flytekit.FlyteContextManager#
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
ExecutionStatefor 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()
- static initialize()#
Re-initializes the context and erases the entire context
- static push_context(ctx, f=None)#