runnable 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {runnable-0.2.0 → runnable-0.3.0}/PKG-INFO +53 -53
- {runnable-0.2.0 → runnable-0.3.0}/README.md +52 -52
- {runnable-0.2.0 → runnable-0.3.0}/pyproject.toml +1 -1
- {runnable-0.2.0 → runnable-0.3.0}/runnable/catalog.py +2 -2
- {runnable-0.2.0 → runnable-0.3.0}/runnable/cli.py +5 -5
- {runnable-0.2.0 → runnable-0.3.0}/runnable/datastore.py +3 -2
- {runnable-0.2.0 → runnable-0.3.0}/runnable/defaults.py +21 -18
- {runnable-0.2.0 → runnable-0.3.0}/runnable/entrypoints.py +41 -77
- {runnable-0.2.0 → runnable-0.3.0}/runnable/executor.py +6 -16
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/file_system/implementation.py +2 -1
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/__init__.py +20 -9
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/argo/implementation.py +6 -5
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/argo/specification.yaml +1 -1
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/k8s_job/implementation_FF.py +4 -4
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/local/implementation.py +1 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/local_container/implementation.py +4 -10
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/mocked/implementation.py +2 -33
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/nodes.py +40 -60
- {runnable-0.2.0 → runnable-0.3.0}/runnable/integration.py +2 -2
- {runnable-0.2.0 → runnable-0.3.0}/runnable/interaction.py +9 -4
- {runnable-0.2.0 → runnable-0.3.0}/runnable/nodes.py +19 -7
- {runnable-0.2.0 → runnable-0.3.0}/runnable/parameters.py +1 -1
- {runnable-0.2.0 → runnable-0.3.0}/runnable/sdk.py +27 -25
- {runnable-0.2.0 → runnable-0.3.0}/runnable/tasks.py +124 -121
- {runnable-0.2.0 → runnable-0.3.0}/runnable/utils.py +11 -11
- {runnable-0.2.0 → runnable-0.3.0}/LICENSE +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/context.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/exceptions.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/experiment_tracker.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/file_system/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/k8s_pvc/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/k8s_pvc/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/catalog/k8s_pvc/integration.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/argo/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/k8s_job/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/k8s_job/integration_FF.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/local/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/local_container/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/executor/mocked/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/experiment_tracker/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/experiment_tracker/mlflow/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/experiment_tracker/mlflow/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/chunked_file_system/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/chunked_file_system/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/chunked_k8s_pvc/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/chunked_k8s_pvc/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/chunked_k8s_pvc/integration.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/db/implementation_FF.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/db/integration_FF.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/file_system/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/file_system/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/generic_chunked.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/k8s_pvc/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/k8s_pvc/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/run_log_store/k8s_pvc/integration.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/secrets/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/secrets/dotenv/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/secrets/dotenv/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/secrets/env_secrets/__init__.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/extensions/secrets/env_secrets/implementation.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/graph.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/names.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/pickler.py +0 -0
- {runnable-0.2.0 → runnable-0.3.0}/runnable/secrets.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: runnable
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: A Compute agnostic pipelining software
|
5
5
|
Home-page: https://github.com/vijayvammi/runnable
|
6
6
|
License: Apache-2.0
|
@@ -36,53 +36,53 @@ Description-Content-Type: text/markdown
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
# Hello from
|
39
|
+
# Hello from runnable
|
40
40
|
|
41
41
|
|
42
42
|
<p align="center">
|
43
|
-
<img src="https://github.com/AstraZeneca/
|
43
|
+
<img src="https://github.com/AstraZeneca/runnable-core/blob/main/assets/logo-readme.png?raw=true" alt="Logo"/>
|
44
44
|
</p>
|
45
45
|
<hr style="border:2px dotted orange">
|
46
46
|
|
47
47
|
<p align="center">
|
48
|
-
<a href="https://pypi.org/project/
|
49
|
-
<a href="https://pypi.org/project/
|
50
|
-
<a href="https://github.com/AstraZeneca/
|
48
|
+
<a href="https://pypi.org/project/runnable/"><img alt="python:" src="https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue.svg"></a>
|
49
|
+
<a href="https://pypi.org/project/runnable/"><img alt="Pypi" src="https://badge.fury.io/py/runnable.svg"></a>
|
50
|
+
<a href="https://github.com/AstraZeneca/runnable-core/blob/main/LICENSE"><img alt"License" src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"></a>
|
51
51
|
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
52
52
|
<a href="https://github.com/python/mypy"><img alt="MyPy Checked" src="https://www.mypy-lang.org/static/mypy_badge.svg"></a>
|
53
|
-
<a href="https://github.com/AstraZeneca/
|
54
|
-
<a href="https://github.com/AstraZeneca/
|
53
|
+
<a href="https://github.com/AstraZeneca/runnable-core/actions/workflows/release.yaml"><img alt="Tests:" src="https://github.com/AstraZeneca/runnable-core/actions/workflows/release.yaml/badge.svg">
|
54
|
+
<a href="https://github.com/AstraZeneca/runnable-core/actions/workflows/docs.yaml"><img alt="Docs:" src="https://github.com/AstraZeneca/runnable-core/actions/workflows/docs.yaml/badge.svg">
|
55
55
|
</p>
|
56
56
|
<hr style="border:2px dotted orange">
|
57
57
|
|
58
|
-
|
58
|
+
runnable is a simplified workflow definition language that helps in:
|
59
59
|
|
60
|
-
- **Streamlined Design Process:**
|
61
|
-
[stubbed nodes](https://astrazeneca.github.io/
|
62
|
-
[tasks](https://astrazeneca.github.io/
|
63
|
-
in both [yaml](https://astrazeneca.github.io/
|
60
|
+
- **Streamlined Design Process:** runnable enables users to efficiently plan their pipelines with
|
61
|
+
[stubbed nodes](https://astrazeneca.github.io/runnable-core/concepts/stub), along with offering support for various structures such as
|
62
|
+
[tasks](https://astrazeneca.github.io/runnable-core/concepts/task), [parallel branches](https://astrazeneca.github.io/runnable-core/concepts/parallel), and [loops or map branches](https://astrazeneca.github.io/runnable-core/concepts/map)
|
63
|
+
in both [yaml](https://astrazeneca.github.io/runnable-core/concepts/pipeline) or a [python SDK](https://astrazeneca.github.io/runnable-core/sdk) for maximum flexibility.
|
64
64
|
|
65
|
-
- **Incremental Development:** Build your pipeline piece by piece with
|
66
|
-
implementation of tasks as [python functions](https://astrazeneca.github.io/
|
67
|
-
[notebooks](https://astrazeneca.github.io/
|
65
|
+
- **Incremental Development:** Build your pipeline piece by piece with runnable, which allows for the
|
66
|
+
implementation of tasks as [python functions](https://astrazeneca.github.io/runnable-core/concepts/task/#python_functions),
|
67
|
+
[notebooks](https://astrazeneca.github.io/runnable-core/concepts/task/#notebooks), or [shell scripts](https://astrazeneca.github.io/runnable-core/concepts/task/#shell),
|
68
68
|
adapting to the developer's preferred tools and methods.
|
69
69
|
|
70
|
-
- **Robust Testing:** Ensure your pipeline performs as expected with the ability to test using sampled data.
|
71
|
-
also provides the capability to [mock and patch tasks](https://astrazeneca.github.io/
|
70
|
+
- **Robust Testing:** Ensure your pipeline performs as expected with the ability to test using sampled data. runnable
|
71
|
+
also provides the capability to [mock and patch tasks](https://astrazeneca.github.io/runnable-core/configurations/executors/mocked)
|
72
72
|
for thorough evaluation before full-scale deployment.
|
73
73
|
|
74
74
|
- **Seamless Deployment:** Transition from the development stage to production with ease.
|
75
|
-
|
76
|
-
to adapt to different environments, including support for [argo workflows](https://astrazeneca.github.io/
|
75
|
+
runnable simplifies the process by requiring [only configuration changes](https://astrazeneca.github.io/runnable-core/configurations/overview)
|
76
|
+
to adapt to different environments, including support for [argo workflows](https://astrazeneca.github.io/runnable-core/configurations/executors/argo).
|
77
77
|
|
78
|
-
- **Efficient Debugging:** Quickly identify and resolve issues in pipeline execution with
|
79
|
-
debugging features. Retrieve data from failed tasks and [retry failures](https://astrazeneca.github.io/
|
78
|
+
- **Efficient Debugging:** Quickly identify and resolve issues in pipeline execution with runnable's local
|
79
|
+
debugging features. Retrieve data from failed tasks and [retry failures](https://astrazeneca.github.io/runnable-core/concepts/run-log/#retrying_failures)
|
80
80
|
using your chosen debugging tools to maintain a smooth development experience.
|
81
81
|
|
82
|
-
Along with the developer friendly features,
|
83
|
-
such as [data catalog](https://astrazeneca.github.io/
|
84
|
-
[experiment tracking](https://astrazeneca.github.io/
|
85
|
-
and secure [access to secrets](https://astrazeneca.github.io/
|
82
|
+
Along with the developer friendly features, runnable also acts as an interface to production grade concepts
|
83
|
+
such as [data catalog](https://astrazeneca.github.io/runnable-core/concepts/catalog), [reproducibility](https://astrazeneca.github.io/runnable-core/concepts/run-log),
|
84
|
+
[experiment tracking](https://astrazeneca.github.io/runnable-core/concepts/experiment-tracking)
|
85
|
+
and secure [access to secrets](https://astrazeneca.github.io/runnable-core/concepts/secrets).
|
86
86
|
|
87
87
|
<hr style="border:2px dotted orange">
|
88
88
|
|
@@ -95,19 +95,19 @@ and secure [access to secrets](https://astrazeneca.github.io/magnus-core/concept
|
|
95
95
|
|
96
96
|
## Documentation
|
97
97
|
|
98
|
-
[More details about the project and how to use it available here](https://astrazeneca.github.io/
|
98
|
+
[More details about the project and how to use it available here](https://astrazeneca.github.io/runnable-core/).
|
99
99
|
|
100
100
|
<hr style="border:2px dotted orange">
|
101
101
|
|
102
102
|
## Installation
|
103
103
|
|
104
|
-
The minimum python version that
|
104
|
+
The minimum python version that runnable supports is 3.8
|
105
105
|
|
106
106
|
```shell
|
107
|
-
pip install
|
107
|
+
pip install runnable
|
108
108
|
```
|
109
109
|
|
110
|
-
Please look at the [installation guide](https://astrazeneca.github.io/
|
110
|
+
Please look at the [installation guide](https://astrazeneca.github.io/runnable-core/usage)
|
111
111
|
for more information.
|
112
112
|
|
113
113
|
<hr style="border:2px dotted orange">
|
@@ -153,7 +153,7 @@ def return_parameter() -> Parameter:
|
|
153
153
|
def display_parameter(x: int, y: InnerModel):
|
154
154
|
"""
|
155
155
|
Annotating the arguments of the function is important for
|
156
|
-
|
156
|
+
runnable to understand the type of parameters you want.
|
157
157
|
|
158
158
|
Input args can be a pydantic model or the individual attributes.
|
159
159
|
"""
|
@@ -174,7 +174,7 @@ my_param = return_parameter()
|
|
174
174
|
display_parameter(my_param.x, my_param.y)
|
175
175
|
```
|
176
176
|
|
177
|
-
### Orchestration using
|
177
|
+
### Orchestration using runnable
|
178
178
|
|
179
179
|
<table>
|
180
180
|
<tr>
|
@@ -189,7 +189,7 @@ Example present at: ```examples/python-tasks.py```
|
|
189
189
|
Run it as: ```python examples/python-tasks.py```
|
190
190
|
|
191
191
|
```python
|
192
|
-
from
|
192
|
+
from runnable import Pipeline, Task
|
193
193
|
|
194
194
|
def main():
|
195
195
|
step1 = Task(
|
@@ -224,7 +224,7 @@ if __name__ == "__main__":
|
|
224
224
|
Example present at: ```examples/python-tasks.yaml```
|
225
225
|
|
226
226
|
|
227
|
-
Execute via the cli: ```
|
227
|
+
Execute via the cli: ```runnable execute -f examples/python-tasks.yaml```
|
228
228
|
|
229
229
|
```yaml
|
230
230
|
dag:
|
@@ -267,9 +267,9 @@ No code change, just change the configuration.
|
|
267
267
|
executor:
|
268
268
|
type: "argo"
|
269
269
|
config:
|
270
|
-
image:
|
270
|
+
image: runnable:demo
|
271
271
|
persistent_volumes:
|
272
|
-
- name:
|
272
|
+
- name: runnable-volume
|
273
273
|
mount_path: /mnt
|
274
274
|
|
275
275
|
run_log_store:
|
@@ -278,9 +278,9 @@ run_log_store:
|
|
278
278
|
log_folder: /mnt/run_log_store
|
279
279
|
```
|
280
280
|
|
281
|
-
More details can be found in [argo configuration](https://astrazeneca.github.io/
|
281
|
+
More details can be found in [argo configuration](https://astrazeneca.github.io/runnable-core/configurations/executors/argo).
|
282
282
|
|
283
|
-
Execute the code as ```
|
283
|
+
Execute the code as ```runnable execute -f examples/python-tasks.yaml -c examples/configs/argo-config.yam```
|
284
284
|
|
285
285
|
<details>
|
286
286
|
<summary>Expand</summary>
|
@@ -289,12 +289,12 @@ Execute the code as ```magnus execute -f examples/python-tasks.yaml -c examples/
|
|
289
289
|
apiVersion: argoproj.io/v1alpha1
|
290
290
|
kind: Workflow
|
291
291
|
metadata:
|
292
|
-
generateName:
|
292
|
+
generateName: runnable-dag-
|
293
293
|
annotations: {}
|
294
294
|
labels: {}
|
295
295
|
spec:
|
296
296
|
activeDeadlineSeconds: 172800
|
297
|
-
entrypoint:
|
297
|
+
entrypoint: runnable-dag
|
298
298
|
podGC:
|
299
299
|
strategy: OnPodCompletion
|
300
300
|
retryStrategy:
|
@@ -306,7 +306,7 @@ spec:
|
|
306
306
|
maxDuration: '3600'
|
307
307
|
serviceAccountName: default-editor
|
308
308
|
templates:
|
309
|
-
- name:
|
309
|
+
- name: runnable-dag
|
310
310
|
failFast: true
|
311
311
|
dag:
|
312
312
|
tasks:
|
@@ -321,9 +321,9 @@ spec:
|
|
321
321
|
depends: step-2-task-772vg3.Succeeded
|
322
322
|
- name: step-1-task-uvdp7h
|
323
323
|
container:
|
324
|
-
image:
|
324
|
+
image: runnable:demo
|
325
325
|
command:
|
326
|
-
-
|
326
|
+
- runnable
|
327
327
|
- execute_single_node
|
328
328
|
- '{{workflow.parameters.run_id}}'
|
329
329
|
- step%1
|
@@ -346,9 +346,9 @@ spec:
|
|
346
346
|
cpu: 250m
|
347
347
|
- name: step-2-task-772vg3
|
348
348
|
container:
|
349
|
-
image:
|
349
|
+
image: runnable:demo
|
350
350
|
command:
|
351
|
-
-
|
351
|
+
- runnable
|
352
352
|
- execute_single_node
|
353
353
|
- '{{workflow.parameters.run_id}}'
|
354
354
|
- step%2
|
@@ -371,9 +371,9 @@ spec:
|
|
371
371
|
cpu: 250m
|
372
372
|
- name: success-success-igzq2e
|
373
373
|
container:
|
374
|
-
image:
|
374
|
+
image: runnable:demo
|
375
375
|
command:
|
376
|
-
-
|
376
|
+
- runnable
|
377
377
|
- execute_single_node
|
378
378
|
- '{{workflow.parameters.run_id}}'
|
379
379
|
- success
|
@@ -404,7 +404,7 @@ spec:
|
|
404
404
|
volumes:
|
405
405
|
- name: executor-0
|
406
406
|
persistentVolumeClaim:
|
407
|
-
claimName:
|
407
|
+
claimName: runnable-volume
|
408
408
|
|
409
409
|
```
|
410
410
|
|
@@ -415,23 +415,23 @@ spec:
|
|
415
415
|
### Linear
|
416
416
|
|
417
417
|
A simple linear pipeline with tasks either
|
418
|
-
[python functions](https://astrazeneca.github.io/
|
419
|
-
[notebooks](https://astrazeneca.github.io/
|
418
|
+
[python functions](https://astrazeneca.github.io/runnable-core/concepts/task/#python_functions),
|
419
|
+
[notebooks](https://astrazeneca.github.io/runnable-core/concepts/task/#notebooks), or [shell scripts](https://astrazeneca.github.io/runnable-core/concepts/task/#shell)
|
420
420
|
|
421
421
|
[](https://mermaid.live/edit#pako:eNpl0bFuwyAQBuBXQVdZTqTESpxMDJ0ytkszhgwnOCcoNo4OaFVZfvcSx20tGSQ4fn0wHB3o1hBIyLJOWGeDFJ3Iq7r90lfkkA9HHfmTUpnX1hFyLvrHzDLl_qB4-1BOOZGGD3TfSikvTDSNFqdj2sT2vBTr9euQlXNWjqycsN2c7UZWFMUE7udwP0L3y6JenNKiyfvz8t8_b-gavT9QJYY0PcDtjeTLptrAChriBq1JzeoeWkG4UkMKZCoN8k2Bcn1yGEN7_HYaZOBIK4h3g4EOFi-MDcgKa59SMja0_P7s_vAJ_Q_YOH6o)
|
422
422
|
|
423
|
-
### [Parallel branches](https://astrazeneca.github.io/
|
423
|
+
### [Parallel branches](https://astrazeneca.github.io/runnable-core/concepts/parallel)
|
424
424
|
|
425
425
|
Execute branches in parallel
|
426
426
|
|
427
427
|
[](https://mermaid.live/edit#pako:eNp9k01rwzAMhv-K8S4ZtJCzDzuMLmWwwkh2KMQ7eImShiZ2sB1KKf3vs52PpsWNT7LySHqlyBeciRwwwUUtTtmBSY2-YsopR8MpQUfAdCdBBekWNBpvv6-EkFICzGAtWcUTDW3wYy20M7lr5QGBK2j-anBAkH4M1z6grnjpy17xAiTwDII07jj6HK8-VnVZBspITnpjztyoVkLLJOy3Qfrdm6gQEu2370Io7WLORo84PbRoA_oOl9BBg4UHbHR58UkMWq_fxjrOnhLRx1nH0SgkjlBjh7ekxNKGc0NelDLknhePI8qf7MVNr_31nm1wwNTeM2Ao6pmf-3y3Mp7WlqA7twOnXfKs17zt-6azmim1gQL1A0NKS3EE8hKZE4Yezm3chIVFiFe4AdmwKjdv7mIjKNYHaIBiYsycySPFlF8NxzotkjPPMNGygxXu2pxp2FSslKzBpGC1Ml7IKy3krn_E7i1f_wEayTcn)
|
428
428
|
|
429
|
-
### [loops or map](https://astrazeneca.github.io/
|
429
|
+
### [loops or map](https://astrazeneca.github.io/runnable-core/concepts/map)
|
430
430
|
|
431
431
|
Execute a pipeline over an iterable parameter.
|
432
432
|
|
433
433
|
[](https://mermaid.live/edit#pako:eNqVlF1rwjAUhv9KyG4qKNR-3AS2m8nuBgN3Z0Sy5tQG20SSdE7E_76kVVEr2CY3Ied9Tx6Sk3PAmeKACc5LtcsKpi36nlGZFbXciHwfLN79CuWiBLMcEULWGkBSaeosA2OCxbxdXMd89Get2bZASsLiSyuvQE2mJZXIjW27t2rOmQZ3Gp9rD6UjatWnwy7q6zPPukd50WTydmemEiS_QbQ79RwxGoQY9UaMuojRA8TCXexzyHgQZNwbMu5Cxl3IXNX6OWMyiDHpzZh0GZMHjOK3xz2mgxjT3oxplzG9MPp5_nVOhwJjteDwOg3HyFj3L1dCcvh7DUc-iftX18n6Waet1xX8cG908vpKHO6OW7cvkeHm5GR2b3drdvaSGTODHLW37mxabYC8fLgRhlfxpjNdwmEets-Dx7gCXTHBXQc8-D2KbQEVUEzckjO9oZjKo9Ox2qr5XmaYWF3DGNdbzizMBHOVVWGSs9K4XeDCKv3ZttSmsx7_AYa341E)
|
434
434
|
|
435
|
-
### [Arbitrary nesting](https://astrazeneca.github.io/
|
435
|
+
### [Arbitrary nesting](https://astrazeneca.github.io/runnable-core/concepts/nesting/)
|
436
436
|
Any nesting of parallel within map and so on.
|
437
437
|
|
@@ -1,52 +1,52 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
# Hello from
|
3
|
+
# Hello from runnable
|
4
4
|
|
5
5
|
|
6
6
|
<p align="center">
|
7
|
-
<img src="https://github.com/AstraZeneca/
|
7
|
+
<img src="https://github.com/AstraZeneca/runnable-core/blob/main/assets/logo-readme.png?raw=true" alt="Logo"/>
|
8
8
|
</p>
|
9
9
|
<hr style="border:2px dotted orange">
|
10
10
|
|
11
11
|
<p align="center">
|
12
|
-
<a href="https://pypi.org/project/
|
13
|
-
<a href="https://pypi.org/project/
|
14
|
-
<a href="https://github.com/AstraZeneca/
|
12
|
+
<a href="https://pypi.org/project/runnable/"><img alt="python:" src="https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue.svg"></a>
|
13
|
+
<a href="https://pypi.org/project/runnable/"><img alt="Pypi" src="https://badge.fury.io/py/runnable.svg"></a>
|
14
|
+
<a href="https://github.com/AstraZeneca/runnable-core/blob/main/LICENSE"><img alt"License" src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"></a>
|
15
15
|
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
16
16
|
<a href="https://github.com/python/mypy"><img alt="MyPy Checked" src="https://www.mypy-lang.org/static/mypy_badge.svg"></a>
|
17
|
-
<a href="https://github.com/AstraZeneca/
|
18
|
-
<a href="https://github.com/AstraZeneca/
|
17
|
+
<a href="https://github.com/AstraZeneca/runnable-core/actions/workflows/release.yaml"><img alt="Tests:" src="https://github.com/AstraZeneca/runnable-core/actions/workflows/release.yaml/badge.svg">
|
18
|
+
<a href="https://github.com/AstraZeneca/runnable-core/actions/workflows/docs.yaml"><img alt="Docs:" src="https://github.com/AstraZeneca/runnable-core/actions/workflows/docs.yaml/badge.svg">
|
19
19
|
</p>
|
20
20
|
<hr style="border:2px dotted orange">
|
21
21
|
|
22
|
-
|
22
|
+
runnable is a simplified workflow definition language that helps in:
|
23
23
|
|
24
|
-
- **Streamlined Design Process:**
|
25
|
-
[stubbed nodes](https://astrazeneca.github.io/
|
26
|
-
[tasks](https://astrazeneca.github.io/
|
27
|
-
in both [yaml](https://astrazeneca.github.io/
|
24
|
+
- **Streamlined Design Process:** runnable enables users to efficiently plan their pipelines with
|
25
|
+
[stubbed nodes](https://astrazeneca.github.io/runnable-core/concepts/stub), along with offering support for various structures such as
|
26
|
+
[tasks](https://astrazeneca.github.io/runnable-core/concepts/task), [parallel branches](https://astrazeneca.github.io/runnable-core/concepts/parallel), and [loops or map branches](https://astrazeneca.github.io/runnable-core/concepts/map)
|
27
|
+
in both [yaml](https://astrazeneca.github.io/runnable-core/concepts/pipeline) or a [python SDK](https://astrazeneca.github.io/runnable-core/sdk) for maximum flexibility.
|
28
28
|
|
29
|
-
- **Incremental Development:** Build your pipeline piece by piece with
|
30
|
-
implementation of tasks as [python functions](https://astrazeneca.github.io/
|
31
|
-
[notebooks](https://astrazeneca.github.io/
|
29
|
+
- **Incremental Development:** Build your pipeline piece by piece with runnable, which allows for the
|
30
|
+
implementation of tasks as [python functions](https://astrazeneca.github.io/runnable-core/concepts/task/#python_functions),
|
31
|
+
[notebooks](https://astrazeneca.github.io/runnable-core/concepts/task/#notebooks), or [shell scripts](https://astrazeneca.github.io/runnable-core/concepts/task/#shell),
|
32
32
|
adapting to the developer's preferred tools and methods.
|
33
33
|
|
34
|
-
- **Robust Testing:** Ensure your pipeline performs as expected with the ability to test using sampled data.
|
35
|
-
also provides the capability to [mock and patch tasks](https://astrazeneca.github.io/
|
34
|
+
- **Robust Testing:** Ensure your pipeline performs as expected with the ability to test using sampled data. runnable
|
35
|
+
also provides the capability to [mock and patch tasks](https://astrazeneca.github.io/runnable-core/configurations/executors/mocked)
|
36
36
|
for thorough evaluation before full-scale deployment.
|
37
37
|
|
38
38
|
- **Seamless Deployment:** Transition from the development stage to production with ease.
|
39
|
-
|
40
|
-
to adapt to different environments, including support for [argo workflows](https://astrazeneca.github.io/
|
39
|
+
runnable simplifies the process by requiring [only configuration changes](https://astrazeneca.github.io/runnable-core/configurations/overview)
|
40
|
+
to adapt to different environments, including support for [argo workflows](https://astrazeneca.github.io/runnable-core/configurations/executors/argo).
|
41
41
|
|
42
|
-
- **Efficient Debugging:** Quickly identify and resolve issues in pipeline execution with
|
43
|
-
debugging features. Retrieve data from failed tasks and [retry failures](https://astrazeneca.github.io/
|
42
|
+
- **Efficient Debugging:** Quickly identify and resolve issues in pipeline execution with runnable's local
|
43
|
+
debugging features. Retrieve data from failed tasks and [retry failures](https://astrazeneca.github.io/runnable-core/concepts/run-log/#retrying_failures)
|
44
44
|
using your chosen debugging tools to maintain a smooth development experience.
|
45
45
|
|
46
|
-
Along with the developer friendly features,
|
47
|
-
such as [data catalog](https://astrazeneca.github.io/
|
48
|
-
[experiment tracking](https://astrazeneca.github.io/
|
49
|
-
and secure [access to secrets](https://astrazeneca.github.io/
|
46
|
+
Along with the developer friendly features, runnable also acts as an interface to production grade concepts
|
47
|
+
such as [data catalog](https://astrazeneca.github.io/runnable-core/concepts/catalog), [reproducibility](https://astrazeneca.github.io/runnable-core/concepts/run-log),
|
48
|
+
[experiment tracking](https://astrazeneca.github.io/runnable-core/concepts/experiment-tracking)
|
49
|
+
and secure [access to secrets](https://astrazeneca.github.io/runnable-core/concepts/secrets).
|
50
50
|
|
51
51
|
<hr style="border:2px dotted orange">
|
52
52
|
|
@@ -59,19 +59,19 @@ and secure [access to secrets](https://astrazeneca.github.io/magnus-core/concept
|
|
59
59
|
|
60
60
|
## Documentation
|
61
61
|
|
62
|
-
[More details about the project and how to use it available here](https://astrazeneca.github.io/
|
62
|
+
[More details about the project and how to use it available here](https://astrazeneca.github.io/runnable-core/).
|
63
63
|
|
64
64
|
<hr style="border:2px dotted orange">
|
65
65
|
|
66
66
|
## Installation
|
67
67
|
|
68
|
-
The minimum python version that
|
68
|
+
The minimum python version that runnable supports is 3.8
|
69
69
|
|
70
70
|
```shell
|
71
|
-
pip install
|
71
|
+
pip install runnable
|
72
72
|
```
|
73
73
|
|
74
|
-
Please look at the [installation guide](https://astrazeneca.github.io/
|
74
|
+
Please look at the [installation guide](https://astrazeneca.github.io/runnable-core/usage)
|
75
75
|
for more information.
|
76
76
|
|
77
77
|
<hr style="border:2px dotted orange">
|
@@ -117,7 +117,7 @@ def return_parameter() -> Parameter:
|
|
117
117
|
def display_parameter(x: int, y: InnerModel):
|
118
118
|
"""
|
119
119
|
Annotating the arguments of the function is important for
|
120
|
-
|
120
|
+
runnable to understand the type of parameters you want.
|
121
121
|
|
122
122
|
Input args can be a pydantic model or the individual attributes.
|
123
123
|
"""
|
@@ -138,7 +138,7 @@ my_param = return_parameter()
|
|
138
138
|
display_parameter(my_param.x, my_param.y)
|
139
139
|
```
|
140
140
|
|
141
|
-
### Orchestration using
|
141
|
+
### Orchestration using runnable
|
142
142
|
|
143
143
|
<table>
|
144
144
|
<tr>
|
@@ -153,7 +153,7 @@ Example present at: ```examples/python-tasks.py```
|
|
153
153
|
Run it as: ```python examples/python-tasks.py```
|
154
154
|
|
155
155
|
```python
|
156
|
-
from
|
156
|
+
from runnable import Pipeline, Task
|
157
157
|
|
158
158
|
def main():
|
159
159
|
step1 = Task(
|
@@ -188,7 +188,7 @@ if __name__ == "__main__":
|
|
188
188
|
Example present at: ```examples/python-tasks.yaml```
|
189
189
|
|
190
190
|
|
191
|
-
Execute via the cli: ```
|
191
|
+
Execute via the cli: ```runnable execute -f examples/python-tasks.yaml```
|
192
192
|
|
193
193
|
```yaml
|
194
194
|
dag:
|
@@ -231,9 +231,9 @@ No code change, just change the configuration.
|
|
231
231
|
executor:
|
232
232
|
type: "argo"
|
233
233
|
config:
|
234
|
-
image:
|
234
|
+
image: runnable:demo
|
235
235
|
persistent_volumes:
|
236
|
-
- name:
|
236
|
+
- name: runnable-volume
|
237
237
|
mount_path: /mnt
|
238
238
|
|
239
239
|
run_log_store:
|
@@ -242,9 +242,9 @@ run_log_store:
|
|
242
242
|
log_folder: /mnt/run_log_store
|
243
243
|
```
|
244
244
|
|
245
|
-
More details can be found in [argo configuration](https://astrazeneca.github.io/
|
245
|
+
More details can be found in [argo configuration](https://astrazeneca.github.io/runnable-core/configurations/executors/argo).
|
246
246
|
|
247
|
-
Execute the code as ```
|
247
|
+
Execute the code as ```runnable execute -f examples/python-tasks.yaml -c examples/configs/argo-config.yam```
|
248
248
|
|
249
249
|
<details>
|
250
250
|
<summary>Expand</summary>
|
@@ -253,12 +253,12 @@ Execute the code as ```magnus execute -f examples/python-tasks.yaml -c examples/
|
|
253
253
|
apiVersion: argoproj.io/v1alpha1
|
254
254
|
kind: Workflow
|
255
255
|
metadata:
|
256
|
-
generateName:
|
256
|
+
generateName: runnable-dag-
|
257
257
|
annotations: {}
|
258
258
|
labels: {}
|
259
259
|
spec:
|
260
260
|
activeDeadlineSeconds: 172800
|
261
|
-
entrypoint:
|
261
|
+
entrypoint: runnable-dag
|
262
262
|
podGC:
|
263
263
|
strategy: OnPodCompletion
|
264
264
|
retryStrategy:
|
@@ -270,7 +270,7 @@ spec:
|
|
270
270
|
maxDuration: '3600'
|
271
271
|
serviceAccountName: default-editor
|
272
272
|
templates:
|
273
|
-
- name:
|
273
|
+
- name: runnable-dag
|
274
274
|
failFast: true
|
275
275
|
dag:
|
276
276
|
tasks:
|
@@ -285,9 +285,9 @@ spec:
|
|
285
285
|
depends: step-2-task-772vg3.Succeeded
|
286
286
|
- name: step-1-task-uvdp7h
|
287
287
|
container:
|
288
|
-
image:
|
288
|
+
image: runnable:demo
|
289
289
|
command:
|
290
|
-
-
|
290
|
+
- runnable
|
291
291
|
- execute_single_node
|
292
292
|
- '{{workflow.parameters.run_id}}'
|
293
293
|
- step%1
|
@@ -310,9 +310,9 @@ spec:
|
|
310
310
|
cpu: 250m
|
311
311
|
- name: step-2-task-772vg3
|
312
312
|
container:
|
313
|
-
image:
|
313
|
+
image: runnable:demo
|
314
314
|
command:
|
315
|
-
-
|
315
|
+
- runnable
|
316
316
|
- execute_single_node
|
317
317
|
- '{{workflow.parameters.run_id}}'
|
318
318
|
- step%2
|
@@ -335,9 +335,9 @@ spec:
|
|
335
335
|
cpu: 250m
|
336
336
|
- name: success-success-igzq2e
|
337
337
|
container:
|
338
|
-
image:
|
338
|
+
image: runnable:demo
|
339
339
|
command:
|
340
|
-
-
|
340
|
+
- runnable
|
341
341
|
- execute_single_node
|
342
342
|
- '{{workflow.parameters.run_id}}'
|
343
343
|
- success
|
@@ -368,7 +368,7 @@ spec:
|
|
368
368
|
volumes:
|
369
369
|
- name: executor-0
|
370
370
|
persistentVolumeClaim:
|
371
|
-
claimName:
|
371
|
+
claimName: runnable-volume
|
372
372
|
|
373
373
|
```
|
374
374
|
|
@@ -379,22 +379,22 @@ spec:
|
|
379
379
|
### Linear
|
380
380
|
|
381
381
|
A simple linear pipeline with tasks either
|
382
|
-
[python functions](https://astrazeneca.github.io/
|
383
|
-
[notebooks](https://astrazeneca.github.io/
|
382
|
+
[python functions](https://astrazeneca.github.io/runnable-core/concepts/task/#python_functions),
|
383
|
+
[notebooks](https://astrazeneca.github.io/runnable-core/concepts/task/#notebooks), or [shell scripts](https://astrazeneca.github.io/runnable-core/concepts/task/#shell)
|
384
384
|
|
385
385
|
[](https://mermaid.live/edit#pako:eNpl0bFuwyAQBuBXQVdZTqTESpxMDJ0ytkszhgwnOCcoNo4OaFVZfvcSx20tGSQ4fn0wHB3o1hBIyLJOWGeDFJ3Iq7r90lfkkA9HHfmTUpnX1hFyLvrHzDLl_qB4-1BOOZGGD3TfSikvTDSNFqdj2sT2vBTr9euQlXNWjqycsN2c7UZWFMUE7udwP0L3y6JenNKiyfvz8t8_b-gavT9QJYY0PcDtjeTLptrAChriBq1JzeoeWkG4UkMKZCoN8k2Bcn1yGEN7_HYaZOBIK4h3g4EOFi-MDcgKa59SMja0_P7s_vAJ_Q_YOH6o)
|
386
386
|
|
387
|
-
### [Parallel branches](https://astrazeneca.github.io/
|
387
|
+
### [Parallel branches](https://astrazeneca.github.io/runnable-core/concepts/parallel)
|
388
388
|
|
389
389
|
Execute branches in parallel
|
390
390
|
|
391
391
|
[](https://mermaid.live/edit#pako:eNp9k01rwzAMhv-K8S4ZtJCzDzuMLmWwwkh2KMQ7eImShiZ2sB1KKf3vs52PpsWNT7LySHqlyBeciRwwwUUtTtmBSY2-YsopR8MpQUfAdCdBBekWNBpvv6-EkFICzGAtWcUTDW3wYy20M7lr5QGBK2j-anBAkH4M1z6grnjpy17xAiTwDII07jj6HK8-VnVZBspITnpjztyoVkLLJOy3Qfrdm6gQEu2370Io7WLORo84PbRoA_oOl9BBg4UHbHR58UkMWq_fxjrOnhLRx1nH0SgkjlBjh7ekxNKGc0NelDLknhePI8qf7MVNr_31nm1wwNTeM2Ao6pmf-3y3Mp7WlqA7twOnXfKs17zt-6azmim1gQL1A0NKS3EE8hKZE4Yezm3chIVFiFe4AdmwKjdv7mIjKNYHaIBiYsycySPFlF8NxzotkjPPMNGygxXu2pxp2FSslKzBpGC1Ml7IKy3krn_E7i1f_wEayTcn)
|
392
392
|
|
393
|
-
### [loops or map](https://astrazeneca.github.io/
|
393
|
+
### [loops or map](https://astrazeneca.github.io/runnable-core/concepts/map)
|
394
394
|
|
395
395
|
Execute a pipeline over an iterable parameter.
|
396
396
|
|
397
397
|
[](https://mermaid.live/edit#pako:eNqVlF1rwjAUhv9KyG4qKNR-3AS2m8nuBgN3Z0Sy5tQG20SSdE7E_76kVVEr2CY3Ied9Tx6Sk3PAmeKACc5LtcsKpi36nlGZFbXciHwfLN79CuWiBLMcEULWGkBSaeosA2OCxbxdXMd89Get2bZASsLiSyuvQE2mJZXIjW27t2rOmQZ3Gp9rD6UjatWnwy7q6zPPukd50WTydmemEiS_QbQ79RwxGoQY9UaMuojRA8TCXexzyHgQZNwbMu5Cxl3IXNX6OWMyiDHpzZh0GZMHjOK3xz2mgxjT3oxplzG9MPp5_nVOhwJjteDwOg3HyFj3L1dCcvh7DUc-iftX18n6Waet1xX8cG908vpKHO6OW7cvkeHm5GR2b3drdvaSGTODHLW37mxabYC8fLgRhlfxpjNdwmEets-Dx7gCXTHBXQc8-D2KbQEVUEzckjO9oZjKo9Ox2qr5XmaYWF3DGNdbzizMBHOVVWGSs9K4XeDCKv3ZttSmsx7_AYa341E)
|
398
398
|
|
399
|
-
### [Arbitrary nesting](https://astrazeneca.github.io/
|
399
|
+
### [Arbitrary nesting](https://astrazeneca.github.io/runnable-core/concepts/nesting/)
|
400
400
|
Any nesting of parallel within map and so on.
|
@@ -43,7 +43,7 @@ class BaseCatalog(ABC, BaseModel):
|
|
43
43
|
Args:
|
44
44
|
name (str): The name of the catalog item
|
45
45
|
run_id (str): The run_id of the run.
|
46
|
-
compute_data_folder (str, optional): The compute data folder. Defaults to
|
46
|
+
compute_data_folder (str, optional): The compute data folder. Defaults to runnable default (data/)
|
47
47
|
|
48
48
|
Raises:
|
49
49
|
NotImplementedError: Base class, hence not implemented
|
@@ -70,7 +70,7 @@ class BaseCatalog(ABC, BaseModel):
|
|
70
70
|
Args:
|
71
71
|
name (str): The name of the catalog item.
|
72
72
|
run_id (str): The run_id of the run.
|
73
|
-
compute_data_folder (str, optional): The compute data folder. Defaults to
|
73
|
+
compute_data_folder (str, optional): The compute data folder. Defaults to runnable default (data/)
|
74
74
|
synced_catalogs (dict, optional): Any previously synced catalogs. Defaults to None.
|
75
75
|
|
76
76
|
Raises:
|
@@ -9,7 +9,7 @@ from runnable import defaults, entrypoints
|
|
9
9
|
logger = logging.getLogger(defaults.LOGGER_NAME)
|
10
10
|
|
11
11
|
|
12
|
-
@with_plugins(iter_entry_points("
|
12
|
+
@with_plugins(iter_entry_points("runnable.cli_plugins"))
|
13
13
|
@click.group()
|
14
14
|
@click.version_option()
|
15
15
|
def cli():
|
@@ -46,7 +46,7 @@ def execute(file, config_file, parameters_file, log_level, tag, run_id, use_cach
|
|
46
46
|
"""
|
47
47
|
Execute a pipeline
|
48
48
|
|
49
|
-
Usage:
|
49
|
+
Usage: runnable execute [OPTIONS]
|
50
50
|
|
51
51
|
Options:
|
52
52
|
-f, --file TEXT The pipeline definition file [default: pipeline.yaml]
|
@@ -97,9 +97,9 @@ def execute(file, config_file, parameters_file, log_level, tag, run_id, use_cach
|
|
97
97
|
@click.option("--tag", default="", help="A tag attached to the run")
|
98
98
|
def execute_single_node(run_id, step_name, map_variable, file, config_file, parameters_file, log_level, tag):
|
99
99
|
"""
|
100
|
-
Internal entrypoint for
|
100
|
+
Internal entrypoint for runnable to execute a single node.
|
101
101
|
|
102
|
-
Other than local executor, every other executor uses this entry point to execute a step in the context of
|
102
|
+
Other than local executor, every other executor uses this entry point to execute a step in the context of runnable.
|
103
103
|
Only chained executions should use this method. Unchained executions should use execute_
|
104
104
|
"""
|
105
105
|
logger.setLevel(log_level)
|
@@ -248,7 +248,7 @@ def execute_function(
|
|
248
248
|
@click.option("--tag", default="", help="A tag attached to the run")
|
249
249
|
def fan(run_id, step_name, mode, map_variable, file, config_file, parameters_file, log_level, tag):
|
250
250
|
"""
|
251
|
-
Internal entrypoint for
|
251
|
+
Internal entrypoint for runnable to fan in or out a composite node.
|
252
252
|
|
253
253
|
Only 3rd party orchestrators should use this entry point.
|
254
254
|
"""
|
@@ -12,7 +12,7 @@ from runnable import defaults, exceptions
|
|
12
12
|
logger = logging.getLogger(defaults.LOGGER_NAME)
|
13
13
|
|
14
14
|
# Once defined these classes are sealed to any additions unless a default is provided
|
15
|
-
# Breaking this rule might make
|
15
|
+
# Breaking this rule might make runnable backwardly incompatible
|
16
16
|
|
17
17
|
|
18
18
|
class DataCatalog(BaseModel, extra="allow"):
|
@@ -53,7 +53,8 @@ class StepAttempt(BaseModel):
|
|
53
53
|
duration: str = "" # end_time - start_time
|
54
54
|
status: str = "FAIL"
|
55
55
|
message: str = ""
|
56
|
-
|
56
|
+
input_parameters: Dict[str, Any] = Field(default_factory=dict)
|
57
|
+
output_parameters: Dict[str, Any] = Field(default_factory=dict)
|
57
58
|
|
58
59
|
|
59
60
|
class CodeIdentity(BaseModel, extra="allow"):
|