ddeutil-workflow 0.0.34__py3-none-any.whl → 0.0.35__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 +6 -3
- ddeutil/workflow/api/api.py +13 -8
- ddeutil/workflow/api/routes/__init__.py +8 -0
- ddeutil/workflow/api/routes/logs.py +36 -0
- ddeutil/workflow/api/{route.py → routes/schedules.py} +2 -131
- ddeutil/workflow/api/routes/workflows.py +137 -0
- ddeutil/workflow/audit.py +3 -3
- ddeutil/workflow/{call.py → caller.py} +4 -4
- ddeutil/workflow/job.py +70 -21
- ddeutil/workflow/logs.py +214 -0
- ddeutil/workflow/params.py +40 -12
- ddeutil/workflow/result.py +16 -138
- ddeutil/workflow/scheduler.py +39 -32
- ddeutil/workflow/stages.py +7 -10
- ddeutil/workflow/workflow.py +6 -6
- {ddeutil_workflow-0.0.34.dist-info → ddeutil_workflow-0.0.35.dist-info}/METADATA +22 -19
- ddeutil_workflow-0.0.35.dist-info/RECORD +30 -0
- {ddeutil_workflow-0.0.34.dist-info → ddeutil_workflow-0.0.35.dist-info}/WHEEL +1 -1
- ddeutil_workflow-0.0.34.dist-info/RECORD +0 -26
- {ddeutil_workflow-0.0.34.dist-info → ddeutil_workflow-0.0.35.dist-info}/LICENSE +0 -0
- {ddeutil_workflow-0.0.34.dist-info → ddeutil_workflow-0.0.35.dist-info}/top_level.txt +0 -0
ddeutil/workflow/stages.py
CHANGED
@@ -42,7 +42,7 @@ from pydantic.functional_validators import model_validator
|
|
42
42
|
from typing_extensions import Self
|
43
43
|
|
44
44
|
from .__types import DictData, DictStr, TupleStr
|
45
|
-
from .
|
45
|
+
from .caller import TagFunc, extract_call
|
46
46
|
from .conf import config, get_logger
|
47
47
|
from .exceptions import StageException
|
48
48
|
from .result import Result, Status
|
@@ -174,15 +174,12 @@ class BaseStage(BaseModel, ABC):
|
|
174
174
|
|
175
175
|
:rtype: Result
|
176
176
|
"""
|
177
|
-
|
178
|
-
result
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
)
|
184
|
-
elif parent_run_id:
|
185
|
-
result.set_parent_run_id(parent_run_id)
|
177
|
+
result: Result = Result.construct_with_rs_or_id(
|
178
|
+
result,
|
179
|
+
run_id=run_id,
|
180
|
+
parent_run_id=parent_run_id,
|
181
|
+
id_logic=(self.name + (self.id or "")),
|
182
|
+
)
|
186
183
|
|
187
184
|
try:
|
188
185
|
return self.execute(params, result=result)
|
ddeutil/workflow/workflow.py
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
# Licensed under the MIT License. See LICENSE in the project root for
|
4
4
|
# license information.
|
5
5
|
# ------------------------------------------------------------------------------
|
6
|
-
"""The main schedule running is
|
7
|
-
multiprocess of
|
8
|
-
config by
|
6
|
+
"""The main schedule running is `workflow_runner` function that trigger the
|
7
|
+
multiprocess of `workflow_control` function for listing schedules on the
|
8
|
+
config by `Loader.finds(Schedule)`.
|
9
9
|
|
10
|
-
The
|
11
|
-
functions;
|
10
|
+
The `workflow_control` is the scheduler function that release 2 schedule
|
11
|
+
functions; `workflow_task`, and ``workflow_monitor``.
|
12
12
|
|
13
13
|
``workflow_control`` --- Every minute at :02 --> ``workflow_task``
|
14
14
|
|
@@ -529,7 +529,7 @@ class Workflow(BaseModel):
|
|
529
529
|
run_id=(run_id or gen_id(name, unique=True)),
|
530
530
|
parent_run_id=parent_run_id,
|
531
531
|
)
|
532
|
-
elif parent_run_id:
|
532
|
+
elif parent_run_id: # pragma: no cov
|
533
533
|
result.set_parent_run_id(parent_run_id)
|
534
534
|
|
535
535
|
if queue is not None and not isinstance(queue, ReleaseQueue):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ddeutil-workflow
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.35
|
4
4
|
Summary: Lightweight workflow orchestration
|
5
5
|
Author-email: ddeutils <korawich.anu@gmail.com>
|
6
6
|
License: MIT
|
@@ -62,7 +62,7 @@ configuration. It called **Metadata Driven Data Workflow**.
|
|
62
62
|
1. The Minimum frequency unit of scheduling is **1 minute** :warning:
|
63
63
|
2. Can not re-run only failed stage and its pending downstream :rotating_light:
|
64
64
|
3. All parallel tasks inside workflow engine use Multi-Threading
|
65
|
-
(Python 3.13 unlock GIL :unlock:)
|
65
|
+
(🐍 Python 3.13 unlock GIL :unlock:)
|
66
66
|
|
67
67
|
---
|
68
68
|
|
@@ -86,37 +86,40 @@ flowchart LR
|
|
86
86
|
B@{ shape: rounded, label: "Workflow<br>Application" }
|
87
87
|
end
|
88
88
|
|
89
|
-
A
|
90
|
-
B
|
91
|
-
G
|
89
|
+
A <-->|action &<br>response| B
|
90
|
+
B -...-> |response| G
|
91
|
+
G -...-> |request| B
|
92
92
|
|
93
93
|
subgraph Data Context
|
94
|
-
|
95
|
-
|
94
|
+
D@{ shape: processes, label: "Logs" }
|
95
|
+
E@{ shape: lin-cyl, label: "Audit<br>Logs" }
|
96
96
|
end
|
97
97
|
|
98
98
|
subgraph Git Context
|
99
|
-
|
99
|
+
F@{ shape: tag-rect, label: "YAML<br>files" }
|
100
100
|
end
|
101
101
|
|
102
|
-
|
103
|
-
|
102
|
+
A ---> |push| H(Repo)
|
103
|
+
H -.-> |pull| F
|
104
104
|
|
105
|
-
B
|
106
|
-
|
107
|
-
B
|
105
|
+
B <-->|disable &<br>read| F
|
106
|
+
|
107
|
+
B <-->|read &<br>write| E
|
108
|
+
|
109
|
+
B -->|write| D
|
108
110
|
|
109
111
|
D -.->|read| G
|
110
112
|
E -.->|read| G
|
111
113
|
```
|
112
114
|
|
113
115
|
> [!WARNING]
|
114
|
-
>
|
115
|
-
>
|
116
|
-
>
|
117
|
-
|
118
|
-
>
|
119
|
-
>
|
116
|
+
> _**Disclaimer**_: I inspire the dynamic YAML statement from the [**GitHub Action**](https://github.com/features/actions),
|
117
|
+
> and all configs pattern from several data orchestration framework tools from
|
118
|
+
> my data engineering experience. :grimacing:
|
119
|
+
|
120
|
+
> [!NOTE]
|
121
|
+
> Other workflow orchestration tools that I interest and pick them to be inspiration
|
122
|
+
> some for this package:
|
120
123
|
>
|
121
124
|
> - [Google **Workflows**](https://cloud.google.com/workflows)
|
122
125
|
> - [AWS **Step Functions**](https://aws.amazon.com/step-functions/)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
ddeutil/workflow/__about__.py,sha256=nntH3Ja8ABeB5HcYg4Fy7-Z6jDBj67mjILrr2_dJHiw,28
|
2
|
+
ddeutil/workflow/__cron.py,sha256=3i-wmjTlh0ADCzN9pLKaWHzJkXzC72aIBmVEQSbyCCE,26895
|
3
|
+
ddeutil/workflow/__init__.py,sha256=SX48GHuEMoxJiKKXbBWT8IxcIk9AnibB-T8cUj1Dx1k,1818
|
4
|
+
ddeutil/workflow/__types.py,sha256=CK1jfzyHP9P-MB0ElhpJZ59ZFGJC9MkQuAop5739_9k,4304
|
5
|
+
ddeutil/workflow/audit.py,sha256=kWymGFEy4WBUXDez1QLRU3FvqLMYQhKJHAzAvIms_Vk,8077
|
6
|
+
ddeutil/workflow/caller.py,sha256=qNfrr0B2ykLm6Y8JfhU1rnf5XGmp-usXrPmXM5uGRnM,5473
|
7
|
+
ddeutil/workflow/conf.py,sha256=cFc2cd_SGXg9PMrkvCT7WWE85a5UN-DdH53_JIbFyzs,14031
|
8
|
+
ddeutil/workflow/cron.py,sha256=j8EeoHst70toRfnD_frix41vrI-eLYVJkZ9yeJtpfnI,8871
|
9
|
+
ddeutil/workflow/exceptions.py,sha256=5ghT443VLq0IeU87loHNEqqrrrctklP7YfxwJ51ImWU,949
|
10
|
+
ddeutil/workflow/job.py,sha256=iUrmNbpBCpxMJyK_hAxpnyLBtrVhyDCoua4X12CH_BI,24702
|
11
|
+
ddeutil/workflow/logs.py,sha256=fmtZl7lQYhKre_auADN64jqD2cqN4aMkNUZdMdhKioM,6398
|
12
|
+
ddeutil/workflow/params.py,sha256=bqFDOcfAGcZ-HYa2n_5tO31uw3KXc66wHpUZ5cgpsTk,6702
|
13
|
+
ddeutil/workflow/result.py,sha256=iuMvKv5OAzKWDbQf3yfrMHNEse6VdqvsKjv-DXKk-aQ,4349
|
14
|
+
ddeutil/workflow/scheduler.py,sha256=DTD5HbCB8oQaxvAQ51-hvpec-NmDIYpyAXsMTODWuoc,25401
|
15
|
+
ddeutil/workflow/stages.py,sha256=4SJcseBw4hv9WahJIXfaPdgn9-1Rbti_awMxO-AiP8s,26438
|
16
|
+
ddeutil/workflow/templates.py,sha256=A0JgZFGkBv-AX-EskZj656nG5zFd3j1PpLpyXihf6Xg,10967
|
17
|
+
ddeutil/workflow/utils.py,sha256=MctJmvklTYtiqZ-nZ7fazQeDoe77UvU0YUEqQZSlbCs,7225
|
18
|
+
ddeutil/workflow/workflow.py,sha256=-n-8C0P-SY0BRc1ak6YhP_J2tT924O6ZkCnDJQFu-z8,45156
|
19
|
+
ddeutil/workflow/api/__init__.py,sha256=F53NMBWtb9IKaDWkPU5KvybGGfKAcbehgn6TLBwHuuM,21
|
20
|
+
ddeutil/workflow/api/api.py,sha256=q7wE0CDPCzpwmhnqKO5qSVO2Mjl1folqwF5E4W-l_UE,4042
|
21
|
+
ddeutil/workflow/api/repeat.py,sha256=zyvsrXKk-3-_N8ZRZSki0Mueshugum2jtqctEOp9QSc,4927
|
22
|
+
ddeutil/workflow/api/routes/__init__.py,sha256=HRUg4yB3023Iml8FQKuY0X6u9FavJe-HqEl6V8N_4hs,450
|
23
|
+
ddeutil/workflow/api/routes/logs.py,sha256=uC8daeCrH_vpVJ-9Um5dMGfHR8JVtwwrDH5I1-Vp6Sw,971
|
24
|
+
ddeutil/workflow/api/routes/schedules.py,sha256=9Q4cPYQWOyiZ1lnanpwtIaLWQtLRX1Vwx7uE30cd_1w,4644
|
25
|
+
ddeutil/workflow/api/routes/workflows.py,sha256=LQiLlB3tESUtOZWcuLUKIHKvnit_yX3fKzYB4FqhavI,4354
|
26
|
+
ddeutil_workflow-0.0.35.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
27
|
+
ddeutil_workflow-0.0.35.dist-info/METADATA,sha256=FGRFLyia45WdWsiJin8fuTmLoD5-MqKDO63tflCJCzI,19269
|
28
|
+
ddeutil_workflow-0.0.35.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
|
29
|
+
ddeutil_workflow-0.0.35.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
30
|
+
ddeutil_workflow-0.0.35.dist-info/RECORD,,
|
@@ -1,26 +0,0 @@
|
|
1
|
-
ddeutil/workflow/__about__.py,sha256=lXPz0LJuQJgNzG0V-1UIfdYsebVctya1i8YqUhNgkXU,28
|
2
|
-
ddeutil/workflow/__cron.py,sha256=3i-wmjTlh0ADCzN9pLKaWHzJkXzC72aIBmVEQSbyCCE,26895
|
3
|
-
ddeutil/workflow/__init__.py,sha256=ucsWC4fWdD3ZJu3mDLwe1BCS7wHR0-43jtxm8eZe53o,1779
|
4
|
-
ddeutil/workflow/__types.py,sha256=CK1jfzyHP9P-MB0ElhpJZ59ZFGJC9MkQuAop5739_9k,4304
|
5
|
-
ddeutil/workflow/audit.py,sha256=LZDgZbWioy0ctEWBmTUXJY_cAdFEMxvkvamJbkVAhdc,8066
|
6
|
-
ddeutil/workflow/call.py,sha256=gkEmrYZT1KFVMVy6uyXcl2wBPQXyg1onPLkXN3q9JJk,5469
|
7
|
-
ddeutil/workflow/conf.py,sha256=cFc2cd_SGXg9PMrkvCT7WWE85a5UN-DdH53_JIbFyzs,14031
|
8
|
-
ddeutil/workflow/cron.py,sha256=j8EeoHst70toRfnD_frix41vrI-eLYVJkZ9yeJtpfnI,8871
|
9
|
-
ddeutil/workflow/exceptions.py,sha256=5ghT443VLq0IeU87loHNEqqrrrctklP7YfxwJ51ImWU,949
|
10
|
-
ddeutil/workflow/job.py,sha256=cm4u_l3fopL6tgUZYy-apZMGektaFyB5qu9uja3Nups,23776
|
11
|
-
ddeutil/workflow/params.py,sha256=LKR7jXyxTb5NVrFav_fl2y9xo3p7qL1S9h-i6CtvNwE,5851
|
12
|
-
ddeutil/workflow/result.py,sha256=z3C1V9C8D736gqTefBH0uUFr40pNU5Z2TwV2Pndoxmw,7800
|
13
|
-
ddeutil/workflow/scheduler.py,sha256=5xlgzunC-eDOc0uSxJZhphywVOwrtmuF0mT5YYc83BY,24943
|
14
|
-
ddeutil/workflow/stages.py,sha256=5UhmcDgJ214NSNyTwgYcX2hvSW1Rcgk_Qq71n1VMdZ4,26555
|
15
|
-
ddeutil/workflow/templates.py,sha256=A0JgZFGkBv-AX-EskZj656nG5zFd3j1PpLpyXihf6Xg,10967
|
16
|
-
ddeutil/workflow/utils.py,sha256=MctJmvklTYtiqZ-nZ7fazQeDoe77UvU0YUEqQZSlbCs,7225
|
17
|
-
ddeutil/workflow/workflow.py,sha256=7SvF80y4GrrwL-0X46wlct76qPp_fttZpEgxu5xjcBY,45148
|
18
|
-
ddeutil/workflow/api/__init__.py,sha256=F53NMBWtb9IKaDWkPU5KvybGGfKAcbehgn6TLBwHuuM,21
|
19
|
-
ddeutil/workflow/api/api.py,sha256=TfgJtu-yREsrRveLcqTjxoJszuhq21qKkl4oyQpSzvQ,3959
|
20
|
-
ddeutil/workflow/api/repeat.py,sha256=zyvsrXKk-3-_N8ZRZSki0Mueshugum2jtqctEOp9QSc,4927
|
21
|
-
ddeutil/workflow/api/route.py,sha256=fKs5zlG4prwL8HplXYjYsyuxelOKgV-54VBgBufIBcQ,8629
|
22
|
-
ddeutil_workflow-0.0.34.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
23
|
-
ddeutil_workflow-0.0.34.dist-info/METADATA,sha256=J-Y3CGyv6r39SVYlasXC6-fVNFYhAtmWjM46CDoYz_0,19221
|
24
|
-
ddeutil_workflow-0.0.34.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
25
|
-
ddeutil_workflow-0.0.34.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
26
|
-
ddeutil_workflow-0.0.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|