Runnable¶
Runner icons created by Leremy - Flaticon
Example¶
The below data science flavored code is a well-known iris example from scikit-learn.
- Return two serialized objects X and Y.
- Store the file
iris_logistic.png
for future reference. - Define the sequence of tasks.
- Define a pipeline with the tasks
The difference between native driver and runnable orchestration:
Notebooks and Shell scripts
You can execute notebooks and shell scripts too!!
They can be written just as you would want them, plain old notebooks and scripts.
- X, Y = load_data()
+load_data_task = PythonTask(
+ function=load_data,
+ name="load_data",
+ returns=[pickled("X"), pickled("Y")], (1)
+ )
-logreg = model_fit(X, Y, C=1.0)
+model_fit_task = PythonTask(
+ function=model_fit,
+ name="model_fit",
+ returns=[pickled("logreg")],
+ )
-generate_plots(X, Y, logreg)
+generate_plots_task = PythonTask(
+ function=generate_plots,
+ name="generate_plots",
+ terminate_with_success=True,
+ catalog=Catalog(put=["iris_logistic.png"]), (2)
+ )
+pipeline = Pipeline(
+ steps=[load_data_task, model_fit_task, generate_plots_task], (3)
-
Domain
code remains completely independent ofdriver
code. - The
driver
function has an equivalent and intuitive runnable expression - Reproducible by default, runnable stores metadata about code/data/config for every execution.
- The pipeline is
runnable
in any environment.