ddeutil-workflow 0.0.29__py3-none-any.whl → 0.0.30__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/api/api.py +2 -2
- ddeutil/workflow/hook.py +3 -1
- ddeutil/workflow/scheduler.py +11 -11
- ddeutil/workflow/workflow.py +72 -65
- {ddeutil_workflow-0.0.29.dist-info → ddeutil_workflow-0.0.30.dist-info}/METADATA +8 -12
- {ddeutil_workflow-0.0.29.dist-info → ddeutil_workflow-0.0.30.dist-info}/RECORD +10 -10
- {ddeutil_workflow-0.0.29.dist-info → ddeutil_workflow-0.0.30.dist-info}/LICENSE +0 -0
- {ddeutil_workflow-0.0.29.dist-info → ddeutil_workflow-0.0.30.dist-info}/WHEEL +0 -0
- {ddeutil_workflow-0.0.29.dist-info → ddeutil_workflow-0.0.30.dist-info}/top_level.txt +0 -0
ddeutil/workflow/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__: str = "0.0.
|
1
|
+
__version__: str = "0.0.30"
|
ddeutil/workflow/api/api.py
CHANGED
@@ -18,7 +18,7 @@ from fastapi.responses import UJSONResponse
|
|
18
18
|
from ..__about__ import __version__
|
19
19
|
from ..conf import config, get_logger
|
20
20
|
from ..scheduler import ReleaseThread, ReleaseThreads
|
21
|
-
from ..workflow import
|
21
|
+
from ..workflow import ReleaseQueue, WorkflowTask
|
22
22
|
from .repeat import repeat_at
|
23
23
|
|
24
24
|
load_dotenv()
|
@@ -31,7 +31,7 @@ class State(TypedDict):
|
|
31
31
|
scheduler: list[str]
|
32
32
|
workflow_threads: ReleaseThreads
|
33
33
|
workflow_tasks: list[WorkflowTask]
|
34
|
-
workflow_queue: dict[str,
|
34
|
+
workflow_queue: dict[str, ReleaseQueue]
|
35
35
|
|
36
36
|
|
37
37
|
@contextlib.asynccontextmanager
|
ddeutil/workflow/hook.py
CHANGED
@@ -79,7 +79,9 @@ def make_registry(submodule: str) -> dict[str, Registry]:
|
|
79
79
|
:rtype: dict[str, Registry]
|
80
80
|
"""
|
81
81
|
rs: dict[str, Registry] = {}
|
82
|
-
|
82
|
+
regis_hooks: list[str] = config.regis_hook
|
83
|
+
regis_hooks.extend(["ddeutil.vendors"])
|
84
|
+
for module in regis_hooks:
|
83
85
|
# NOTE: try to sequential import task functions
|
84
86
|
try:
|
85
87
|
importer = import_module(f"{module}.{submodule}")
|
ddeutil/workflow/scheduler.py
CHANGED
@@ -58,7 +58,7 @@ from .utils import (
|
|
58
58
|
batch,
|
59
59
|
delay,
|
60
60
|
)
|
61
|
-
from .workflow import
|
61
|
+
from .workflow import Release, ReleaseQueue, Workflow, WorkflowTask
|
62
62
|
|
63
63
|
P = ParamSpec("P")
|
64
64
|
logger = get_logger("ddeutil.workflow")
|
@@ -170,7 +170,7 @@ class WorkflowSchedule(BaseModel):
|
|
170
170
|
def tasks(
|
171
171
|
self,
|
172
172
|
start_date: datetime,
|
173
|
-
queue: dict[str,
|
173
|
+
queue: dict[str, ReleaseQueue],
|
174
174
|
*,
|
175
175
|
externals: DictData | None = None,
|
176
176
|
) -> list[WorkflowTask]:
|
@@ -193,7 +193,7 @@ class WorkflowSchedule(BaseModel):
|
|
193
193
|
|
194
194
|
# NOTE: Loading workflow model from the name of workflow.
|
195
195
|
wf: Workflow = Workflow.from_loader(self.name, externals=extras)
|
196
|
-
wf_queue:
|
196
|
+
wf_queue: ReleaseQueue = queue[self.alias]
|
197
197
|
|
198
198
|
# IMPORTANT: Create the default 'on' value if it does not pass the `on`
|
199
199
|
# field to the Schedule object.
|
@@ -280,7 +280,7 @@ class Schedule(BaseModel):
|
|
280
280
|
def tasks(
|
281
281
|
self,
|
282
282
|
start_date: datetime,
|
283
|
-
queue: dict[str,
|
283
|
+
queue: dict[str, ReleaseQueue],
|
284
284
|
*,
|
285
285
|
externals: DictData | None = None,
|
286
286
|
) -> list[WorkflowTask]:
|
@@ -289,7 +289,7 @@ class Schedule(BaseModel):
|
|
289
289
|
|
290
290
|
:param start_date: A start date that get from the workflow schedule.
|
291
291
|
:param queue: A mapping of name and list of datetime for queue.
|
292
|
-
:type queue: dict[str,
|
292
|
+
:type queue: dict[str, ReleaseQueue]
|
293
293
|
:param externals: An external parameters that pass to the Loader object.
|
294
294
|
:type externals: DictData | None
|
295
295
|
|
@@ -302,7 +302,7 @@ class Schedule(BaseModel):
|
|
302
302
|
for workflow in self.workflows:
|
303
303
|
|
304
304
|
if workflow.alias not in queue:
|
305
|
-
queue[workflow.alias] =
|
305
|
+
queue[workflow.alias] = ReleaseQueue()
|
306
306
|
|
307
307
|
workflow_tasks.extend(
|
308
308
|
workflow.tasks(start_date, queue=queue, externals=externals)
|
@@ -355,7 +355,7 @@ ReleaseThreads = dict[str, ReleaseThread]
|
|
355
355
|
def schedule_task(
|
356
356
|
tasks: list[WorkflowTask],
|
357
357
|
stop: datetime,
|
358
|
-
queue: dict[str,
|
358
|
+
queue: dict[str, ReleaseQueue],
|
359
359
|
threads: ReleaseThreads,
|
360
360
|
log: type[Log],
|
361
361
|
) -> CancelJob | None:
|
@@ -366,7 +366,7 @@ def schedule_task(
|
|
366
366
|
|
367
367
|
:param tasks: A list of WorkflowTask object.
|
368
368
|
:param stop: A stop datetime object that force stop running scheduler.
|
369
|
-
:param queue: A mapping of alias name and
|
369
|
+
:param queue: A mapping of alias name and ReleaseQueue object.
|
370
370
|
:param threads: A mapping of alias name and Thread object.
|
371
371
|
:param log: A log class that want to make log object.
|
372
372
|
|
@@ -390,7 +390,7 @@ def schedule_task(
|
|
390
390
|
#
|
391
391
|
for task in tasks:
|
392
392
|
|
393
|
-
q:
|
393
|
+
q: ReleaseQueue = queue[task.alias]
|
394
394
|
|
395
395
|
# NOTE: Start adding queue and move the runner date in the WorkflowTask.
|
396
396
|
task.queue(stop, q, log=log)
|
@@ -418,7 +418,7 @@ def schedule_task(
|
|
418
418
|
continue
|
419
419
|
|
420
420
|
# NOTE: Pop the latest release and push it to running.
|
421
|
-
release:
|
421
|
+
release: Release = heappop(q.queue)
|
422
422
|
heappush(q.running, release)
|
423
423
|
|
424
424
|
logger.info(
|
@@ -499,7 +499,7 @@ def schedule_control(
|
|
499
499
|
stop_date: datetime = stop or (start_date + config.stop_boundary_delta)
|
500
500
|
|
501
501
|
# IMPORTANT: Create main mapping of queue and thread object.
|
502
|
-
queue: dict[str,
|
502
|
+
queue: dict[str, ReleaseQueue] = {}
|
503
503
|
threads: ReleaseThreads = {}
|
504
504
|
|
505
505
|
start_date_waiting: datetime = start_date.replace(
|
ddeutil/workflow/workflow.py
CHANGED
@@ -60,16 +60,17 @@ logger = get_logger("ddeutil.workflow")
|
|
60
60
|
|
61
61
|
__all__: TupleStr = (
|
62
62
|
"Workflow",
|
63
|
-
"
|
64
|
-
"
|
63
|
+
"Release",
|
64
|
+
"ReleaseQueue",
|
65
65
|
"WorkflowTask",
|
66
66
|
)
|
67
67
|
|
68
68
|
|
69
69
|
@total_ordering
|
70
70
|
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
|
71
|
-
class
|
72
|
-
"""
|
71
|
+
class Release:
|
72
|
+
"""Release Pydantic dataclass object that use for represent
|
73
|
+
the release data that use with the `workflow.release` method."""
|
73
74
|
|
74
75
|
date: datetime
|
75
76
|
offset: float
|
@@ -85,7 +86,7 @@ class WorkflowRelease:
|
|
85
86
|
|
86
87
|
@classmethod
|
87
88
|
def from_dt(cls, dt: datetime | str) -> Self:
|
88
|
-
"""Construct
|
89
|
+
"""Construct Release via datetime object only.
|
89
90
|
|
90
91
|
:param dt: A datetime object.
|
91
92
|
|
@@ -102,7 +103,7 @@ class WorkflowRelease:
|
|
102
103
|
type="manual",
|
103
104
|
)
|
104
105
|
|
105
|
-
def __eq__(self, other:
|
106
|
+
def __eq__(self, other: Release | datetime) -> bool:
|
106
107
|
"""Override equal property that will compare only the same type or
|
107
108
|
datetime.
|
108
109
|
"""
|
@@ -112,7 +113,7 @@ class WorkflowRelease:
|
|
112
113
|
return self.date == other
|
113
114
|
return NotImplemented
|
114
115
|
|
115
|
-
def __lt__(self, other:
|
116
|
+
def __lt__(self, other: Release | datetime) -> bool:
|
116
117
|
"""Override equal property that will compare only the same type or
|
117
118
|
datetime.
|
118
119
|
"""
|
@@ -124,19 +125,19 @@ class WorkflowRelease:
|
|
124
125
|
|
125
126
|
|
126
127
|
@dataclass
|
127
|
-
class
|
128
|
-
"""Workflow Queue object that is management of
|
128
|
+
class ReleaseQueue:
|
129
|
+
"""Workflow Queue object that is management of Release objects."""
|
129
130
|
|
130
|
-
queue: list[
|
131
|
-
running: list[
|
132
|
-
complete: list[
|
131
|
+
queue: list[Release] = field(default_factory=list)
|
132
|
+
running: list[Release] = field(default_factory=list)
|
133
|
+
complete: list[Release] = field(default_factory=list)
|
133
134
|
|
134
135
|
@classmethod
|
135
136
|
def from_list(
|
136
|
-
cls, queue: list[datetime] | list[
|
137
|
+
cls, queue: list[datetime] | list[Release] | None = None
|
137
138
|
) -> Self:
|
138
|
-
"""Construct
|
139
|
-
with list of datetime or list of
|
139
|
+
"""Construct ReleaseQueue object from an input queue value that passing
|
140
|
+
with list of datetime or list of Release.
|
140
141
|
|
141
142
|
:raise TypeError: If the type of input queue does not valid.
|
142
143
|
|
@@ -148,14 +149,14 @@ class WorkflowQueue:
|
|
148
149
|
if isinstance(queue, list):
|
149
150
|
|
150
151
|
if all(isinstance(q, datetime) for q in queue):
|
151
|
-
return cls(queue=[
|
152
|
+
return cls(queue=[Release.from_dt(q) for q in queue])
|
152
153
|
|
153
|
-
if all(isinstance(q,
|
154
|
+
if all(isinstance(q, Release) for q in queue):
|
154
155
|
return cls(queue=queue)
|
155
156
|
|
156
157
|
raise TypeError(
|
157
|
-
"Type of the queue does not valid with
|
158
|
-
"or list of datetime or list of
|
158
|
+
"Type of the queue does not valid with ReleaseQueue "
|
159
|
+
"or list of datetime or list of Release."
|
159
160
|
)
|
160
161
|
|
161
162
|
@property
|
@@ -167,32 +168,32 @@ class WorkflowQueue:
|
|
167
168
|
return len(self.queue) > 0
|
168
169
|
|
169
170
|
@property
|
170
|
-
def first_queue(self) ->
|
171
|
-
"""Check an input
|
171
|
+
def first_queue(self) -> Release:
|
172
|
+
"""Check an input Release object is the first value of the
|
172
173
|
waiting queue.
|
173
174
|
|
174
175
|
:rtype: bool
|
175
176
|
"""
|
176
177
|
# NOTE: Old logic to peeking the first release from waiting queue.
|
177
178
|
#
|
178
|
-
# first_value:
|
179
|
+
# first_value: Release = heappop(self.queue)
|
179
180
|
# heappush(self.queue, first_value)
|
180
181
|
#
|
181
182
|
# return first_value
|
182
183
|
#
|
183
184
|
return self.queue[0]
|
184
185
|
|
185
|
-
def check_queue(self, value:
|
186
|
-
"""Check a
|
186
|
+
def check_queue(self, value: Release | datetime) -> bool:
|
187
|
+
"""Check a Release value already exists in list of tracking
|
187
188
|
queues.
|
188
189
|
|
189
|
-
:param value: A
|
190
|
+
:param value: A Release object that want to check it already in
|
190
191
|
queues.
|
191
192
|
|
192
193
|
:rtype: bool
|
193
194
|
"""
|
194
195
|
if isinstance(value, datetime):
|
195
|
-
value =
|
196
|
+
value = Release.from_dt(value)
|
196
197
|
|
197
198
|
return (
|
198
199
|
(value in self.queue)
|
@@ -200,13 +201,21 @@ class WorkflowQueue:
|
|
200
201
|
or (value in self.complete)
|
201
202
|
)
|
202
203
|
|
203
|
-
def remove_running(self, value:
|
204
|
-
"""Remove
|
204
|
+
def remove_running(self, value: Release) -> Self:
|
205
|
+
"""Remove Release in the running queue if it exists.
|
206
|
+
|
207
|
+
:rtype: Self
|
208
|
+
"""
|
205
209
|
if value in self.running:
|
206
210
|
self.running.remove(value)
|
207
211
|
|
208
|
-
|
209
|
-
|
212
|
+
return self
|
213
|
+
|
214
|
+
def mark_complete(self, value: Release) -> Self:
|
215
|
+
"""Push Release to the complete queue.
|
216
|
+
|
217
|
+
:rtype: Self
|
218
|
+
"""
|
210
219
|
heappush(self.complete, value)
|
211
220
|
|
212
221
|
# NOTE: Remove complete queue on workflow that keep more than the
|
@@ -216,7 +225,6 @@ class WorkflowQueue:
|
|
216
225
|
)
|
217
226
|
|
218
227
|
if num_complete_delete > 0:
|
219
|
-
print(num_complete_delete)
|
220
228
|
for _ in range(num_complete_delete):
|
221
229
|
heappop(self.complete)
|
222
230
|
|
@@ -464,14 +472,12 @@ class Workflow(BaseModel):
|
|
464
472
|
|
465
473
|
def release(
|
466
474
|
self,
|
467
|
-
release: datetime |
|
475
|
+
release: datetime | Release,
|
468
476
|
params: DictData,
|
469
477
|
*,
|
470
478
|
run_id: str | None = None,
|
471
479
|
log: type[Log] = None,
|
472
|
-
queue:
|
473
|
-
WorkflowQueue | list[datetime] | list[WorkflowRelease] | None
|
474
|
-
) = None,
|
480
|
+
queue: ReleaseQueue | list[datetime] | list[Release] | None = None,
|
475
481
|
override_log_name: str | None = None,
|
476
482
|
) -> Result:
|
477
483
|
"""Release the workflow execution with overriding parameter with the
|
@@ -482,19 +488,19 @@ class Workflow(BaseModel):
|
|
482
488
|
result to log destination like file log to the local `/logs` directory.
|
483
489
|
|
484
490
|
:Steps:
|
485
|
-
- Initialize
|
491
|
+
- Initialize ReleaseQueue and Release if they do not pass.
|
486
492
|
- Create release data for pass to parameter templating function.
|
487
493
|
- Execute this workflow with mapping release data to its parameters.
|
488
494
|
- Writing result log
|
489
495
|
- Remove this release on the running queue
|
490
496
|
- Push this release to complete queue
|
491
497
|
|
492
|
-
:param release: A release datetime or
|
498
|
+
:param release: A release datetime or Release object.
|
493
499
|
:param params: A workflow parameter that pass to execute method.
|
494
500
|
:param queue: A list of release time that already queue.
|
495
501
|
:param run_id: A workflow running ID for this release.
|
496
502
|
:param log: A log class that want to save the execution result.
|
497
|
-
:param queue: A
|
503
|
+
:param queue: A ReleaseQueue object.
|
498
504
|
:param override_log_name: An override logging name that use instead
|
499
505
|
the workflow name.
|
500
506
|
|
@@ -506,14 +512,14 @@ class Workflow(BaseModel):
|
|
506
512
|
rs_release: Result = Result(run_id=run_id)
|
507
513
|
rs_release_type: str = "release"
|
508
514
|
|
509
|
-
# VALIDATE: Change queue value to
|
515
|
+
# VALIDATE: Change queue value to ReleaseQueue object.
|
510
516
|
if queue is None or isinstance(queue, list):
|
511
|
-
queue:
|
517
|
+
queue: ReleaseQueue = ReleaseQueue.from_list(queue)
|
512
518
|
|
513
|
-
# VALIDATE: Change release value to
|
519
|
+
# VALIDATE: Change release value to Release object.
|
514
520
|
if isinstance(release, datetime):
|
515
521
|
rs_release_type: str = "datetime"
|
516
|
-
release:
|
522
|
+
release: Release = Release.from_dt(release)
|
517
523
|
|
518
524
|
logger.debug(
|
519
525
|
f"({cut_id(run_id)}) [RELEASE]: Start release - {name!r} : "
|
@@ -583,11 +589,11 @@ class Workflow(BaseModel):
|
|
583
589
|
self,
|
584
590
|
offset: float,
|
585
591
|
end_date: datetime,
|
586
|
-
queue:
|
592
|
+
queue: ReleaseQueue,
|
587
593
|
log: type[Log],
|
588
594
|
*,
|
589
595
|
force_run: bool = False,
|
590
|
-
) ->
|
596
|
+
) -> ReleaseQueue:
|
591
597
|
"""Generate queue of datetime from the cron runner that initialize from
|
592
598
|
the on field. with offset value.
|
593
599
|
|
@@ -598,7 +604,7 @@ class Workflow(BaseModel):
|
|
598
604
|
:param force_run: A flag that allow to release workflow if the log with
|
599
605
|
that release was pointed.
|
600
606
|
|
601
|
-
:rtype:
|
607
|
+
:rtype: ReleaseQueue
|
602
608
|
"""
|
603
609
|
for on in self.on:
|
604
610
|
|
@@ -610,7 +616,7 @@ class Workflow(BaseModel):
|
|
610
616
|
if runner.date > end_date:
|
611
617
|
continue
|
612
618
|
|
613
|
-
workflow_release =
|
619
|
+
workflow_release = Release(
|
614
620
|
date=runner.date,
|
615
621
|
offset=offset,
|
616
622
|
end_date=end_date,
|
@@ -622,7 +628,7 @@ class Workflow(BaseModel):
|
|
622
628
|
log.is_pointed(name=self.name, release=workflow_release.date)
|
623
629
|
and not force_run
|
624
630
|
):
|
625
|
-
workflow_release =
|
631
|
+
workflow_release = Release(
|
626
632
|
date=runner.next,
|
627
633
|
offset=offset,
|
628
634
|
end_date=end_date,
|
@@ -633,7 +639,7 @@ class Workflow(BaseModel):
|
|
633
639
|
if runner.date > end_date:
|
634
640
|
continue
|
635
641
|
|
636
|
-
# NOTE: Push the
|
642
|
+
# NOTE: Push the Release object to queue.
|
637
643
|
heappush(queue.queue, workflow_release)
|
638
644
|
|
639
645
|
return queue
|
@@ -708,8 +714,8 @@ class Workflow(BaseModel):
|
|
708
714
|
params: DictData = {} if params is None else params
|
709
715
|
results: list[Result] = []
|
710
716
|
|
711
|
-
# NOTE: Create empty
|
712
|
-
wf_queue:
|
717
|
+
# NOTE: Create empty ReleaseQueue object.
|
718
|
+
wf_queue: ReleaseQueue = ReleaseQueue()
|
713
719
|
|
714
720
|
# NOTE: Make queue to the workflow queue object.
|
715
721
|
self.queue(
|
@@ -737,8 +743,8 @@ class Workflow(BaseModel):
|
|
737
743
|
|
738
744
|
while wf_queue.is_queued:
|
739
745
|
|
740
|
-
# NOTE: Pop the latest
|
741
|
-
release:
|
746
|
+
# NOTE: Pop the latest Release object from queue.
|
747
|
+
release: Release = heappop(wf_queue.queue)
|
742
748
|
|
743
749
|
if (
|
744
750
|
release.date - get_dt_now(tz=config.tz, offset=offset)
|
@@ -761,7 +767,7 @@ class Workflow(BaseModel):
|
|
761
767
|
)
|
762
768
|
continue
|
763
769
|
|
764
|
-
# NOTE: Push the latest
|
770
|
+
# NOTE: Push the latest Release to the running queue.
|
765
771
|
heappush(wf_queue.running, release)
|
766
772
|
|
767
773
|
futures.append(
|
@@ -1127,6 +1133,9 @@ class WorkflowTask:
|
|
1127
1133
|
|
1128
1134
|
This dataclass object is mapping 1-to-1 with workflow and cron runner
|
1129
1135
|
objects.
|
1136
|
+
|
1137
|
+
This dataclass has the release method for itself.
|
1138
|
+
|
1130
1139
|
"""
|
1131
1140
|
|
1132
1141
|
alias: str
|
@@ -1136,19 +1145,17 @@ class WorkflowTask:
|
|
1136
1145
|
|
1137
1146
|
def release(
|
1138
1147
|
self,
|
1139
|
-
release: datetime |
|
1148
|
+
release: datetime | Release | None = None,
|
1140
1149
|
run_id: str | None = None,
|
1141
1150
|
log: type[Log] = None,
|
1142
|
-
queue:
|
1143
|
-
WorkflowQueue | list[datetime] | list[WorkflowRelease] | None
|
1144
|
-
) = None,
|
1151
|
+
queue: ReleaseQueue | list[datetime] | list[Release] | None = None,
|
1145
1152
|
) -> Result:
|
1146
1153
|
"""Release the workflow task data.
|
1147
1154
|
|
1148
|
-
:param release: A release datetime or
|
1155
|
+
:param release: A release datetime or Release object.
|
1149
1156
|
:param run_id: A workflow running ID for this release.
|
1150
1157
|
:param log: A log class that want to save the execution result.
|
1151
|
-
:param queue: A
|
1158
|
+
:param queue: A ReleaseQueue object.
|
1152
1159
|
|
1153
1160
|
:rtype: Result
|
1154
1161
|
"""
|
@@ -1175,12 +1182,12 @@ class WorkflowTask:
|
|
1175
1182
|
def queue(
|
1176
1183
|
self,
|
1177
1184
|
end_date: datetime,
|
1178
|
-
queue:
|
1185
|
+
queue: ReleaseQueue,
|
1179
1186
|
log: type[Log],
|
1180
1187
|
*,
|
1181
1188
|
force_run: bool = False,
|
1182
1189
|
):
|
1183
|
-
"""Generate
|
1190
|
+
"""Generate Release to ReleaseQueue object.
|
1184
1191
|
|
1185
1192
|
:param end_date: An end datetime object.
|
1186
1193
|
:param queue: A workflow queue object.
|
@@ -1188,12 +1195,12 @@ class WorkflowTask:
|
|
1188
1195
|
:param force_run: A flag that allow to release workflow if the log with
|
1189
1196
|
that release was pointed.
|
1190
1197
|
|
1191
|
-
:rtype:
|
1198
|
+
:rtype: ReleaseQueue
|
1192
1199
|
"""
|
1193
1200
|
if self.runner.date > end_date:
|
1194
1201
|
return queue
|
1195
1202
|
|
1196
|
-
workflow_release =
|
1203
|
+
workflow_release = Release(
|
1197
1204
|
date=self.runner.date,
|
1198
1205
|
offset=0,
|
1199
1206
|
end_date=end_date,
|
@@ -1205,7 +1212,7 @@ class WorkflowTask:
|
|
1205
1212
|
log.is_pointed(name=self.alias, release=workflow_release.date)
|
1206
1213
|
and not force_run
|
1207
1214
|
):
|
1208
|
-
workflow_release =
|
1215
|
+
workflow_release = Release(
|
1209
1216
|
date=self.runner.next,
|
1210
1217
|
offset=0,
|
1211
1218
|
end_date=end_date,
|
@@ -1216,7 +1223,7 @@ class WorkflowTask:
|
|
1216
1223
|
if self.runner.date > end_date:
|
1217
1224
|
return queue
|
1218
1225
|
|
1219
|
-
# NOTE: Push the
|
1226
|
+
# NOTE: Push the Release object to queue.
|
1220
1227
|
heappush(queue.queue, workflow_release)
|
1221
1228
|
|
1222
1229
|
return queue
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ddeutil-workflow
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.30
|
4
4
|
Summary: Lightweight workflow orchestration
|
5
5
|
Author-email: ddeutils <korawich.anu@gmail.com>
|
6
6
|
License: MIT
|
@@ -212,9 +212,9 @@ schedule-run-local-wf:
|
|
212
212
|
|
213
213
|
## :cookie: Configuration
|
214
214
|
|
215
|
-
The main configuration that use to dynamic changing
|
216
|
-
|
217
|
-
and do not raise any error to you.
|
215
|
+
The main configuration that use to dynamic changing this workflow engine for your
|
216
|
+
objective use environment variable only. If any configuration values do not set yet,
|
217
|
+
it will use default value and do not raise any error to you.
|
218
218
|
|
219
219
|
> [!IMPORTANT]
|
220
220
|
> The config value that you will set on the environment should combine with
|
@@ -246,6 +246,9 @@ and do not raise any error to you.
|
|
246
246
|
|
247
247
|
**API Application**:
|
248
248
|
|
249
|
+
This config part use for the workflow application that build from the FastAPI
|
250
|
+
only.
|
251
|
+
|
249
252
|
| Environment | Component | Default | Description |
|
250
253
|
|:---------------------------|:-----------:|---------|------------------------------------------------------------------------------------|
|
251
254
|
| **ENABLE_ROUTE_WORKFLOW** | API | `true` | A flag that enable workflow route to manage execute manually and workflow logging. |
|
@@ -272,16 +275,9 @@ like crontab job but via Python API.
|
|
272
275
|
|
273
276
|
### Docker Container
|
274
277
|
|
275
|
-
Create Docker image;
|
276
|
-
|
277
278
|
```shell
|
278
279
|
$ docker build -t ddeutil-workflow:latest -f .container/Dockerfile .
|
279
|
-
|
280
|
-
|
281
|
-
Run the above Docker image;
|
282
|
-
|
283
|
-
```shell
|
284
|
-
$ docker run -i ddeutil-workflow:latest
|
280
|
+
$ docker run -i ddeutil-workflow:latest ddeutil-workflow
|
285
281
|
```
|
286
282
|
|
287
283
|
## :speech_balloon: Contribute
|
@@ -1,25 +1,25 @@
|
|
1
|
-
ddeutil/workflow/__about__.py,sha256=
|
1
|
+
ddeutil/workflow/__about__.py,sha256=zSy9Xk11PPZkgJ5Db1_kZp2yzt5inkEHVJWwFHPWlmk,28
|
2
2
|
ddeutil/workflow/__cron.py,sha256=uA8XcbY_GwA9rJSHaHUaXaJyGDObJN0ZeYlJSinL8y8,26880
|
3
3
|
ddeutil/workflow/__init__.py,sha256=dghn2lFl3Own4Pyq7SFHu-FMymOgLontJ6aCfxea9h4,1606
|
4
4
|
ddeutil/workflow/__types.py,sha256=CK1jfzyHP9P-MB0ElhpJZ59ZFGJC9MkQuAop5739_9k,4304
|
5
5
|
ddeutil/workflow/conf.py,sha256=7lj_Im9jsa95fWUo19Q4-ZAcHa8Pu1HW-vaLgvrjNUM,17559
|
6
6
|
ddeutil/workflow/cron.py,sha256=OLgniUxmrn65gzckk-uTmE2Pk1enJJyjYUKVeBbDQz0,7522
|
7
7
|
ddeutil/workflow/exceptions.py,sha256=XUnpJSuxOyataClP0w_gpYjzn-NIwZK2BHro-J7Yw24,895
|
8
|
-
ddeutil/workflow/hook.py,sha256=
|
8
|
+
ddeutil/workflow/hook.py,sha256=MgZFlTGvaRSBrTouZGlxwYpKQoKDOT26PNhESeL3LY0,5469
|
9
9
|
ddeutil/workflow/job.py,sha256=XcewyALsLYYq94ycF6mkj3Ydr6if683z7t1oBqEVInE,24290
|
10
10
|
ddeutil/workflow/params.py,sha256=svCjmFgEhim8yFJVjZhFmKP8JqTDHQ5EPhwJHVuDGno,5289
|
11
11
|
ddeutil/workflow/result.py,sha256=k4pcj5KjbEcEPymsEUXeGY4gyLMfPkMTO6YDrAtfk7Q,3408
|
12
|
-
ddeutil/workflow/scheduler.py,sha256=
|
12
|
+
ddeutil/workflow/scheduler.py,sha256=f3d7c5SVgY5Q1JsHQ6cH513CJmJkh4l8YcKAGYudJRc,20426
|
13
13
|
ddeutil/workflow/stage.py,sha256=wn8CARTvFJY4ZK1SwjzH8sKoMRz_eIeSGUMgnDWNi6g,24031
|
14
14
|
ddeutil/workflow/templates.py,sha256=bVU_8gnMQmdhhw3W28ZqwmpEaOx10Nx_aauqiLS0lqg,10807
|
15
15
|
ddeutil/workflow/utils.py,sha256=8LTqpvRPfrEYxsxhwszk6GKkyjrswxnwF3r_9vE8szw,6059
|
16
|
-
ddeutil/workflow/workflow.py,sha256=
|
16
|
+
ddeutil/workflow/workflow.py,sha256=ZLbG-K2gSNAsDGiHPjbtJd7rsEFf6jfVGAVB_9jpy84,42103
|
17
17
|
ddeutil/workflow/api/__init__.py,sha256=F53NMBWtb9IKaDWkPU5KvybGGfKAcbehgn6TLBwHuuM,21
|
18
|
-
ddeutil/workflow/api/api.py,sha256=
|
18
|
+
ddeutil/workflow/api/api.py,sha256=Ma9R8yuQAhowG_hox-k53swFsf5IAvheEnSxNQ-8DaQ,4039
|
19
19
|
ddeutil/workflow/api/repeat.py,sha256=zyvsrXKk-3-_N8ZRZSki0Mueshugum2jtqctEOp9QSc,4927
|
20
20
|
ddeutil/workflow/api/route.py,sha256=v96jNbgjM1cJ2MpVSRWs2kgRqF8DQElEBdRZrVFEpEw,8578
|
21
|
-
ddeutil_workflow-0.0.
|
22
|
-
ddeutil_workflow-0.0.
|
23
|
-
ddeutil_workflow-0.0.
|
24
|
-
ddeutil_workflow-0.0.
|
25
|
-
ddeutil_workflow-0.0.
|
21
|
+
ddeutil_workflow-0.0.30.dist-info/LICENSE,sha256=nGFZ1QEhhhWeMHf9n99_fdt4vQaXS29xWKxt-OcLywk,1085
|
22
|
+
ddeutil_workflow-0.0.30.dist-info/METADATA,sha256=zbVHOL41qpFRG83SacZVYK9tS2JRTCM61cpnSXty9LU,14868
|
23
|
+
ddeutil_workflow-0.0.30.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
24
|
+
ddeutil_workflow-0.0.30.dist-info/top_level.txt,sha256=m9M6XeSWDwt_yMsmH6gcOjHZVK5O0-vgtNBuncHjzW4,8
|
25
|
+
ddeutil_workflow-0.0.30.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|