Executor
In pypz each operator is self-contained, which means that there is no external dependencies for its
runtime (like an executor infrastructure) i.e., you can execute it for example on your local machine or in a Kubernetes
cluster as well. This requires an embedded OperatorExecutor
,
which controls the execution flow of the entire operator incl. plugins.
The executor has the following main components:
state machine (embedded into the
OperatorExecutor
)
Execution Context
The ExecutionContext
is
responsible to maintain all the necessary information during execution.
It can be forwarded to the states of the state machine as well.
The execution context has the following responsibilities:
check, if all required parameters are set
maintain exit code
register plugins along their types
traverse plugin dependency graph
store information about execution mode
State machine
You can find more information incl. invoked plugin methods in the corresponding
states module
.
Execution modes
As you might see on the state machine diagram, there are different routes from start to end. Which route the state machine will take depends not just on the execution results of the states, but on the specified execution mode as well.
Imagine the case, where your one or more operators in your pipeline crashed. Resources might not have been released in this case. Since pypz does not know anything about your resources, only you do, pypz cannot provide an integrated feature to clean up your resources. However, what pypz can provide is an execution mode, where only resources will be deleted instead of running the actual business logic.
Check pypz.executors.commons.ExecutionMode
for more details.