From d13394d066795867b0038b4fa2e93ce51f724448 Mon Sep 17 00:00:00 2001
From: Vijay Vammi
-
- ,////,
- /// 6|
- // _|
- _/_,-'
- _.-/'/ \ ,/;,
- ,-' /' \_ \ / _/
- `\ / _/\ ` /
- | /, `\_/
- | \'
- /\_ /` /\
- /' /_``--.__/\ `,. / \
- |_/` `-._ `\/ `\ `.
- `-.__/' `\ |
- `\ \
- `\ \
- \_\__
- \___)
@@ -32,364 +13,200 @@
-
python SDK | -yaml | -
---|---|
+```diff -Example present at: ```examples/python-tasks.py``` +- X, Y = load_data() ++load_data_task = PythonTask( ++ function=load_data, ++ name="load_data", ++ returns=[pickled("X"), pickled("Y")], (1) ++ ) -Run it as: ```python examples/python-tasks.py``` +-logreg = model_fit(X, Y, C=1.0) ++model_fit_task = PythonTask( ++ function=model_fit, ++ name="model_fit", ++ returns=[pickled("logreg")], ++ ) -```python -from runnable import Pipeline, Task +-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) ++ ) -def main(): - step1 = Task( - name="step1", - command="examples.functions.return_parameter", - ) - step2 = Task( - name="step2", - command="examples.functions.display_parameter", - terminate_with_success=True, - ) - step1 >> step2 ++pipeline = Pipeline( ++ steps=[load_data_task, model_fit_task, generate_plots_task], (3) - pipeline = Pipeline( - start_at=step1, - steps=[step1, step2], - add_terminal_nodes=True, - ) +``` + - pipeline.execute() +--- -if __name__ == "__main__": - main() -``` +- [x] ```Domain``` code remains completely independent of ```driver``` code. +- [x] The ```driver``` function has an equivalent and intuitive runnable expression +- [x] Reproducible by default, runnable stores metadata about code/data/config for every execution. +- [x] The pipeline is `runnable` in any environment. - |
-
-- -Example present at: ```examples/python-tasks.yaml``` - - -Execute via the cli: ```runnable execute -f examples/python-tasks.yaml``` - -```yaml -dag: - description: | - This is a simple pipeline that does 3 steps in sequence. - In this example: - 1. First step: returns a "parameter" x as a Pydantic model - 2. Second step: Consumes that parameter and prints it - - This pipeline demonstrates one way to pass small data from one step to another. - - start_at: step 1 - steps: - step 1: - type: task - command_type: python # (2) - command: examples.functions.return_parameter # (1) - next: step 2 - step 2: - type: task - command_type: python - command: examples.functions.display_parameter - next: success - success: - type: success - fail: - type: fail -``` - |
+## Documentation
-