ddeutil-workflow 0.0.12__py3-none-any.whl → 0.0.14__py3-none-any.whl
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.
- ddeutil/workflow/__about__.py +1 -1
- ddeutil/workflow/__init__.py +4 -1
- ddeutil/workflow/__types.py +24 -8
- ddeutil/workflow/api.py +2 -2
- ddeutil/workflow/conf.py +41 -0
- ddeutil/workflow/cron.py +19 -12
- ddeutil/workflow/job.py +251 -184
- ddeutil/workflow/log.py +28 -14
- ddeutil/workflow/on.py +5 -2
- ddeutil/workflow/scheduler.py +262 -140
- ddeutil/workflow/stage.py +105 -39
- ddeutil/workflow/utils.py +106 -40
- {ddeutil_workflow-0.0.12.dist-info → ddeutil_workflow-0.0.14.dist-info}/METADATA +80 -32
- ddeutil_workflow-0.0.14.dist-info/RECORD +22 -0
- {ddeutil_workflow-0.0.12.dist-info → ddeutil_workflow-0.0.14.dist-info}/WHEEL +1 -1
- ddeutil_workflow-0.0.12.dist-info/RECORD +0 -21
- {ddeutil_workflow-0.0.12.dist-info → ddeutil_workflow-0.0.14.dist-info}/LICENSE +0 -0
- {ddeutil_workflow-0.0.12.dist-info → ddeutil_workflow-0.0.14.dist-info}/entry_points.txt +0 -0
- {ddeutil_workflow-0.0.12.dist-info → ddeutil_workflow-0.0.14.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ddeutil-workflow
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.14
|
4
4
|
Summary: Lightweight workflow orchestration with less dependencies
|
5
5
|
Author-email: ddeutils <korawich.anu@gmail.com>
|
6
6
|
License: MIT
|
@@ -18,19 +18,22 @@ Classifier: Programming Language :: Python :: 3.9
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
21
22
|
Requires-Python: >=3.9.13
|
22
23
|
Description-Content-Type: text/markdown
|
23
24
|
License-File: LICENSE
|
24
|
-
Requires-Dist: ddeutil
|
25
|
+
Requires-Dist: ddeutil >=0.4.0
|
26
|
+
Requires-Dist: ddeutil-io >=0.1.13
|
25
27
|
Requires-Dist: python-dotenv ==1.0.1
|
26
28
|
Requires-Dist: typer <1.0.0,==0.12.5
|
27
29
|
Requires-Dist: schedule <2.0.0,==1.2.2
|
28
30
|
Provides-Extra: api
|
29
|
-
Requires-Dist: fastapi <1.0.0
|
31
|
+
Requires-Dist: fastapi <1.0.0,>=0.115.0 ; extra == 'api'
|
30
32
|
|
31
33
|
# Workflow
|
32
34
|
|
33
35
|
[](https://github.com/ddeutils/ddeutil-workflow/actions/workflows/tests.yml)
|
36
|
+
[](https://pypi.org/project/ddeutil-workflow/)
|
34
37
|
[](https://pypi.org/project/ddeutil-workflow/)
|
35
38
|
[](https://github.com/ddeutils/ddeutil-workflow)
|
36
39
|
[](https://github.com/ddeutils/ddeutil-workflow/blob/main/LICENSE)
|
@@ -41,8 +44,9 @@ for easy to make a simple metadata driven for data workflow orchestration.
|
|
41
44
|
It can to use for data operator by a `.yaml` template.
|
42
45
|
|
43
46
|
> [!WARNING]
|
44
|
-
> This package provide only orchestration workload. That mean you should not
|
45
|
-
> workflow stage to process any large data which use lot of compute
|
47
|
+
> This package provide only orchestration workload task. That mean you should not
|
48
|
+
> use the workflow stage to process any large volume data which use lot of compute
|
49
|
+
> resource. :cold_sweat:
|
46
50
|
|
47
51
|
In my opinion, I think it should not create duplicate workflow codes if I can
|
48
52
|
write with dynamic input parameters on the one template workflow that just change
|
@@ -50,23 +54,25 @@ the input parameters per use-case instead.
|
|
50
54
|
This way I can handle a lot of logical workflows in our orgs with only metadata
|
51
55
|
configuration. It called **Metadata Driven Data Workflow**.
|
52
56
|
|
53
|
-
|
54
|
-
workflow running. Because it not show us what is a use-case that running data
|
55
|
-
workflow.
|
57
|
+
**:pushpin: <u>Rules of This Workflow engine</u>**:
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
**Rules of This Workflow engine**:
|
59
|
+
1. Minimum frequency unit of scheduling is **1 minute** :warning:
|
60
|
+
2. Can not re-run only failed stage and its pending downstream :rotating_light:
|
61
|
+
3. All parallel tasks inside workflow engine use Multi-Threading
|
62
|
+
(Because Python 3.13 unlock GIL :unlock:)
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
> [!NOTE]
|
65
|
+
> _Disclaimer_: I inspire the dynamic statement from the [**GitHub Action**](https://github.com/features/actions)
|
66
|
+
> with `.yml` files and all of config file from several data orchestration framework
|
67
|
+
> tools from my experience on Data Engineer. :grimacing:
|
68
|
+
>
|
69
|
+
> Other workflow that I interest on them and pick some interested feature to this
|
70
|
+
> package:
|
71
|
+
>
|
72
|
+
> - [Google **Workflows**](https://cloud.google.com/workflows)
|
73
|
+
> - [AWS **Step Functions**](https://aws.amazon.com/step-functions/)
|
68
74
|
|
69
|
-
## Installation
|
75
|
+
## :round_pushpin: Installation
|
70
76
|
|
71
77
|
This project need `ddeutil-io` extension namespace packages. If you want to install
|
72
78
|
this package with application add-ons, you should add `app` in installation;
|
@@ -79,7 +85,7 @@ this package with application add-ons, you should add `app` in installation;
|
|
79
85
|
|
80
86
|
> I added this feature to the main milestone.
|
81
87
|
>
|
82
|
-
> **Docker Images** supported:
|
88
|
+
> :egg: **Docker Images** supported:
|
83
89
|
>
|
84
90
|
> | Docker Image | Python Version | Support |
|
85
91
|
> |-----------------------------|----------------|---------|
|
@@ -87,8 +93,9 @@ this package with application add-ons, you should add `app` in installation;
|
|
87
93
|
> | ddeutil-workflow:python3.10 | `3.10` | :x: |
|
88
94
|
> | ddeutil-workflow:python3.11 | `3.11` | :x: |
|
89
95
|
> | ddeutil-workflow:python3.12 | `3.12` | :x: |
|
96
|
+
> | ddeutil-workflow:python3.12 | `3.13` | :x: |
|
90
97
|
|
91
|
-
## Usage
|
98
|
+
## :beers: Usage
|
92
99
|
|
93
100
|
This is examples that use workflow file for running common Data Engineering
|
94
101
|
use-case.
|
@@ -100,8 +107,10 @@ use-case.
|
|
100
107
|
> maintenance your data workflows.
|
101
108
|
|
102
109
|
```yaml
|
103
|
-
|
104
|
-
|
110
|
+
run-py-local:
|
111
|
+
|
112
|
+
# Validate model that use to parsing exists for template file
|
113
|
+
type: ddeutil.workflow.Workflow
|
105
114
|
on:
|
106
115
|
# If workflow deploy to schedule, it will running every 5 minutes
|
107
116
|
# with Asia/Bangkok timezone.
|
@@ -110,7 +119,7 @@ run_py_local:
|
|
110
119
|
params:
|
111
120
|
# Incoming execution parameters will validate with this type. It allow
|
112
121
|
# to set default value or templating.
|
113
|
-
|
122
|
+
source-extract: str
|
114
123
|
run-date: datetime
|
115
124
|
jobs:
|
116
125
|
getting-api-data:
|
@@ -119,17 +128,56 @@ run_py_local:
|
|
119
128
|
id: retrieve-api
|
120
129
|
uses: tasks/get-api-with-oauth-to-s3@requests
|
121
130
|
with:
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
131
|
+
# Arguments of source data that want to retrieve.
|
132
|
+
method: post
|
133
|
+
url: https://finances/open-data/currency-pairs/
|
134
|
+
body:
|
135
|
+
resource: ${{ params.source-extract }}
|
136
|
+
|
137
|
+
# You can able to use filtering like Jinja template but this
|
138
|
+
# package does not use it.
|
139
|
+
filter: ${{ params.run-date | fmt(fmt='%Y%m%d') }}
|
140
|
+
auth:
|
141
|
+
type: bearer
|
142
|
+
keys: ${API_ACCESS_REFRESH_TOKEN}
|
143
|
+
|
144
|
+
# Arguments of target data that want to landing.
|
145
|
+
writing_mode: flatten
|
146
|
+
aws_s3_path: my-data/open-data/${{ params.source-extract }}
|
147
|
+
|
148
|
+
# This Authentication code should implement with your custom hook
|
149
|
+
# function. The template allow you to use environment variable.
|
128
150
|
aws_access_client_id: ${AWS_ACCESS_CLIENT_ID}
|
129
151
|
aws_access_client_secret: ${AWS_ACCESS_CLIENT_SECRET}
|
130
152
|
```
|
131
153
|
|
132
|
-
|
154
|
+
The above workflow template is main executor pipeline that you want to do. If you
|
155
|
+
want to schedule this workflow, you want to dynamic its parameters change base on
|
156
|
+
execution time such as `run-date` should change base on that workflow running date.
|
157
|
+
|
158
|
+
So, this package provide the `Schedule` template for this action.
|
159
|
+
|
160
|
+
```yaml
|
161
|
+
schedule-run-local-wf:
|
162
|
+
|
163
|
+
# Validate model that use to parsing exists for template file
|
164
|
+
type: ddeutil.workflow.scheduler.Schedule
|
165
|
+
workflows:
|
166
|
+
|
167
|
+
# Map existing workflow that want to deploy with scheduler application.
|
168
|
+
# It allow you to passing release parameter that dynamic change depend the
|
169
|
+
# current context of this scheduler application releasing that time.
|
170
|
+
- name: run-py-local
|
171
|
+
params:
|
172
|
+
source-extract: "USD-THB"
|
173
|
+
asat-dt: "${{ release.logical_date }}"
|
174
|
+
```
|
175
|
+
|
176
|
+
## :cookie: Configuration
|
177
|
+
|
178
|
+
The main configuration that use to dynamic changing with your propose of this
|
179
|
+
application. If any configuration values do not set yet, it will use default value
|
180
|
+
and do not raise any error to you.
|
133
181
|
|
134
182
|
| Environment | Component | Default | Description |
|
135
183
|
|-------------------------------------|-----------|----------------------------------|----------------------------------------------------------------------------|
|
@@ -155,7 +203,7 @@ run_py_local:
|
|
155
203
|
| `WORKFLOW_API_ENABLE_ROUTE_WORKFLOW` | API | true | A flag that enable workflow route to manage execute manually and workflow logging |
|
156
204
|
| `WORKFLOW_API_ENABLE_ROUTE_SCHEDULE` | API | true | A flag that enable run scheduler |
|
157
205
|
|
158
|
-
## Deployment
|
206
|
+
## :rocket: Deployment
|
159
207
|
|
160
208
|
This package able to run as a application service for receive manual trigger
|
161
209
|
from the master node via RestAPI or use to be Scheduler background service
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ddeutil/workflow/__about__.py,sha256=Xas_M3BaGwGfZOJTvMWUlmlW09aGC-Apst-NtkPddY4,28
|
2
|
+
ddeutil/workflow/__init__.py,sha256=-DIy8SGFsD7_wqp-V-K8v8jTxacmqrcyj_SFx1WS6qg,687
|
3
|
+
ddeutil/workflow/__types.py,sha256=aBbytylSPIe_cip2KIyqLN2eUloMOJdkayqKWCBrwhk,2353
|
4
|
+
ddeutil/workflow/api.py,sha256=cwju_qhY6m0kLtaoa77QLglC9tl7RjjZ4UnJYV3SlQQ,4810
|
5
|
+
ddeutil/workflow/cli.py,sha256=Ikcq526WeIl-737-v55T0PwAZ2pNiZFxlN0Y-DjhDbQ,3374
|
6
|
+
ddeutil/workflow/conf.py,sha256=j19G7rDxQRGgSRQW3pxIYtK5lB3fZv0eG_CAoqoIhPw,1140
|
7
|
+
ddeutil/workflow/cron.py,sha256=naWefHc3EnVo41Yf1zQeXOzF27YlTlnfj0XnQ6_HO-U,25514
|
8
|
+
ddeutil/workflow/exceptions.py,sha256=Uf1-Tn8rAzj0aiVHSqo4fBqO80W0za7UFZgKv24E-tg,706
|
9
|
+
ddeutil/workflow/job.py,sha256=zEefiEAxyC34NvbNVpKexTVU1E_031446308zGMdcmE,21488
|
10
|
+
ddeutil/workflow/log.py,sha256=Ev-Szi0KC_MmbFY4g4BWv6tUSmcLKWKZ03ZInmYPmgU,6490
|
11
|
+
ddeutil/workflow/on.py,sha256=vsZG19mNoztDSB_ObD_4ZWPKgHYpBDJMWw97ZiTavNE,7237
|
12
|
+
ddeutil/workflow/repeat.py,sha256=e3dekPTlMlxCCizfBYsZ8dD8Juy4rtfqDZJU3Iky2oA,5011
|
13
|
+
ddeutil/workflow/route.py,sha256=ABEk-WlVo9XGFc7zCPbckX33URCNH7woQFU1keX_8PQ,6970
|
14
|
+
ddeutil/workflow/scheduler.py,sha256=CcUFichnvPbQzSEk_ikNgFwZimTObGHfXxHChuysAo4,45706
|
15
|
+
ddeutil/workflow/stage.py,sha256=Tt5QQrO_dN8MO9gPtiziOqVrd64UTJZwbgifWeXBCIA,23574
|
16
|
+
ddeutil/workflow/utils.py,sha256=epJMTsA4BPQa0gECgcWJ38IENlejpnF3OTBNc0eaqYE,30715
|
17
|
+
ddeutil_workflow-0.0.14.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
18
|
+
ddeutil_workflow-0.0.14.dist-info/METADATA,sha256=sf9kiPoGazaRxqymTjaxZyH47yNyGj0RElc-NLmUa4w,11653
|
19
|
+
ddeutil_workflow-0.0.14.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
20
|
+
ddeutil_workflow-0.0.14.dist-info/entry_points.txt,sha256=0BVOgO3LdUdXVZ-CiHHDKxzEk2c8J30jEwHeKn2YCWI,62
|
21
|
+
ddeutil_workflow-0.0.14.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
22
|
+
ddeutil_workflow-0.0.14.dist-info/RECORD,,
|
@@ -1,21 +0,0 @@
|
|
1
|
-
ddeutil/workflow/__about__.py,sha256=dDoptHBL0iJdvMM__PxrYhbuaSInQh_epfEsH-vdqVw,28
|
2
|
-
ddeutil/workflow/__init__.py,sha256=aEQiEWwTPGhfwpzzdb99xXaHchi5ABWUHl2iLIyT18E,664
|
3
|
-
ddeutil/workflow/__types.py,sha256=SYMoxbENQX8uPsiCZkjtpHAqqHOh8rUrarAFicAJd0E,1773
|
4
|
-
ddeutil/workflow/api.py,sha256=xVP8eGu1nnR8HM0ULTwxs9TV9tsxCOjZ68cAffw2f3o,4802
|
5
|
-
ddeutil/workflow/cli.py,sha256=Ikcq526WeIl-737-v55T0PwAZ2pNiZFxlN0Y-DjhDbQ,3374
|
6
|
-
ddeutil/workflow/cron.py,sha256=uhp3E5pl_tX_H88bsDujcwdhZmOE53csyV-ouPpPdK8,25321
|
7
|
-
ddeutil/workflow/exceptions.py,sha256=Uf1-Tn8rAzj0aiVHSqo4fBqO80W0za7UFZgKv24E-tg,706
|
8
|
-
ddeutil/workflow/job.py,sha256=eESvmIbIyYtiKgVLfILtb0lTz-shMhy4Bi7kHrtZSk0,19663
|
9
|
-
ddeutil/workflow/log.py,sha256=bZyyqf3oNBB8oRf8RI0YvII7wHHoj4wC-nmW_pQjQ1c,6036
|
10
|
-
ddeutil/workflow/on.py,sha256=Sxwnu0vPbIrMR_WWvH3_rOvD0tbiJntcB5378WoV19M,7163
|
11
|
-
ddeutil/workflow/repeat.py,sha256=e3dekPTlMlxCCizfBYsZ8dD8Juy4rtfqDZJU3Iky2oA,5011
|
12
|
-
ddeutil/workflow/route.py,sha256=ABEk-WlVo9XGFc7zCPbckX33URCNH7woQFU1keX_8PQ,6970
|
13
|
-
ddeutil/workflow/scheduler.py,sha256=ISiVoKM0puh3XaXZ9NTi-J-vREGxdEa-lk1jR6a4OXk,41639
|
14
|
-
ddeutil/workflow/stage.py,sha256=nYsKKT5ZKelEsFnDScBwaitXOv_aUEFkubDPQVK5isM,20644
|
15
|
-
ddeutil/workflow/utils.py,sha256=TbqgPkDDYBpqCZ7HV2TU3AH1_Mv-zfrJdwVL-l2SPUo,28559
|
16
|
-
ddeutil_workflow-0.0.12.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
17
|
-
ddeutil_workflow-0.0.12.dist-info/METADATA,sha256=U95bFDPtWdPuA7KcIq8kDYNor6CBztiXjdjhrAPvMDY,9395
|
18
|
-
ddeutil_workflow-0.0.12.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
19
|
-
ddeutil_workflow-0.0.12.dist-info/entry_points.txt,sha256=0BVOgO3LdUdXVZ-CiHHDKxzEk2c8J30jEwHeKn2YCWI,62
|
20
|
-
ddeutil_workflow-0.0.12.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
21
|
-
ddeutil_workflow-0.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|