celestialflow 3.1.5__tar.gz → 3.1.7__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.
- {celestialflow-3.1.5 → celestialflow-3.1.7}/PKG-INFO +33 -32
- {celestialflow-3.1.5 → celestialflow-3.1.7}/README.md +32 -31
- {celestialflow-3.1.5 → celestialflow-3.1.7}/pyproject.toml +10 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/__init__.py +17 -17
- celestialflow-3.1.7/src/celestialflow/funnel/__init__.py +8 -0
- celestialflow-3.1.7/src/celestialflow/funnel/core_inlet.py +12 -0
- celestialflow-3.1.5/src/celestialflow/persistence/core_base.py → celestialflow-3.1.7/src/celestialflow/funnel/core_spout.py +8 -15
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/__init__.py +3 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/core_graph.py +92 -82
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/core_structure.py +3 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/util_analysis.py +4 -4
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/util_serialize.py +11 -11
- celestialflow-3.1.7/src/celestialflow/observability/__init__.py +10 -0
- {celestialflow-3.1.5/src/celestialflow/runtime → celestialflow-3.1.7/src/celestialflow/observability}/core_progress.py +3 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/observability/core_report.py +60 -54
- celestialflow-3.1.7/src/celestialflow/persistence/__init__.py +12 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/core_fail.py +22 -12
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/core_log.py +74 -62
- celestialflow-3.1.7/src/celestialflow/persistence/core_success.py +35 -0
- celestialflow-3.1.7/src/celestialflow/persistence/util_jsonl.py +174 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/__init__.py +2 -5
- celestialflow-3.1.7/src/celestialflow/runtime/core_dispatch.py +247 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_envelope.py +13 -9
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_metrics.py +14 -55
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_queue.py +30 -26
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_errors.py +2 -1
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_estimators.py +2 -2
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_factories.py +7 -9
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_types.py +7 -5
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/__init__.py +3 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_executor.py +167 -185
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_stage.py +38 -26
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_stages.py +38 -33
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_benchmark.py +14 -3
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_clone.py +0 -1
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_format.py +9 -9
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/config.json +5 -5
- celestialflow-3.1.5/src/celestialflow/web/server.py → celestialflow-3.1.7/src/celestialflow/web/core_server.py +86 -64
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/_colors.css +23 -18
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/base.css +74 -56
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/dashboard.css +73 -71
- celestialflow-3.1.7/src/celestialflow/web/static/css/errors.css +286 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/inject.css +124 -161
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/main.js +4 -4
- celestialflow-3.1.7/src/celestialflow/web/static/js/task_analysis.js +59 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_errors.js +62 -45
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_history.js +14 -8
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_injection.js +21 -16
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_statuses.js +6 -14
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_structure.js +9 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_topology.js +20 -20
- celestialflow-3.1.7/src/celestialflow/web/static/js/utils.js +268 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/main.ts +4 -4
- celestialflow-3.1.7/src/celestialflow/web/static/ts/task_analysis.ts +67 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_errors.ts +178 -161
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_history.ts +15 -9
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_injection.ts +9 -4
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_statuses.ts +12 -14
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_structure.ts +10 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/utils.ts +141 -14
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/templates/index.html +23 -19
- celestialflow-3.1.7/src/celestialflow/web/util_cal.py +4 -0
- celestialflow-3.1.7/src/celestialflow/web/util_config.py +23 -0
- celestialflow-3.1.7/src/celestialflow/web/util_error.py +53 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/PKG-INFO +33 -32
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/SOURCES.txt +12 -5
- celestialflow-3.1.7/src/celestialflow.egg-info/entry_points.txt +2 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_executor.py +1 -17
- {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_stages.py +23 -19
- {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_structure.py +16 -13
- {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_utils.py +234 -237
- celestialflow-3.1.5/src/celestialflow/observability/__init__.py +0 -7
- celestialflow-3.1.5/src/celestialflow/persistence/__init__.py +0 -13
- celestialflow-3.1.5/src/celestialflow/persistence/util_jsonl.py +0 -132
- celestialflow-3.1.5/src/celestialflow/runtime/core_runner.py +0 -275
- celestialflow-3.1.5/src/celestialflow/web/static/css/errors.css +0 -284
- celestialflow-3.1.5/src/celestialflow/web/static/js/utils.js +0 -170
- celestialflow-3.1.5/src/celestialflow/web/static/ts/task_topology.ts +0 -67
- celestialflow-3.1.5/src/celestialflow.egg-info/entry_points.txt +0 -2
- {celestialflow-3.1.5 → celestialflow-3.1.7}/setup.cfg +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/util_constant.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_hash.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_queue.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/__init__.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_collections.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_debug.py +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/favicon.ico +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_config.js +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_summary.js +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/web_config.js +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_summary.ts +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/web_config.ts +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: celestialflow
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.7
|
|
4
4
|
Summary: A flexible GRAPH-based task orchestration framework.
|
|
5
5
|
Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -48,11 +48,10 @@ Requires-Dist: celestialtree>=0.1.2
|
|
|
48
48
|
- 相比 Airflow/Dagster 更轻、更快开始
|
|
49
49
|
- 相比 multiprocessing/threading 更结构化,可直接表达 loop / complete graph 等复杂依赖模式
|
|
50
50
|
|
|
51
|
-
框架的基本单元为 **TaskExecutor
|
|
51
|
+
框架的基本单元为 **TaskExecutor**,可独立运行,并支持三种执行模式:
|
|
52
52
|
|
|
53
53
|
* **线性(serial)**
|
|
54
54
|
* **多线程(thread)**
|
|
55
|
-
* **多进程(process)**
|
|
56
55
|
* **协程(async)**
|
|
57
56
|
|
|
58
57
|
TaskExecutor 实现了对任务的结果缓存,任务去重,进度条显示,多执行模式比较等功能,单独使用也很好用。
|
|
@@ -133,7 +132,7 @@ flowchart LR
|
|
|
133
132
|
uv pip install celestialflow
|
|
134
133
|
|
|
135
134
|
# 不过也可以直接使用 `pip`
|
|
136
|
-
|
|
135
|
+
pip install celestialflow
|
|
137
136
|
```
|
|
138
137
|
|
|
139
138
|
一个简单的可运行代码:
|
|
@@ -175,16 +174,16 @@ if __name__ == "__main__":
|
|
|
175
174
|
|
|
176
175
|
若你想了解框架的整体结构与核心组件,下面的参考文档会对你有帮助:
|
|
177
176
|
|
|
178
|
-
- [stage/
|
|
179
|
-
- [stage/
|
|
180
|
-
- [graph/
|
|
181
|
-
- [
|
|
182
|
-
- [runtime/
|
|
183
|
-
- [runtime/
|
|
184
|
-
- [stage/
|
|
185
|
-
- [observability/
|
|
186
|
-
- [graph/
|
|
187
|
-
- [web/
|
|
177
|
+
- [stage/core_executor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_executor.md)
|
|
178
|
+
- [stage/core_stage.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_stage.md)
|
|
179
|
+
- [graph/core_graph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/core_graph.md)
|
|
180
|
+
- [observability/core_progress.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/core_progress.md)
|
|
181
|
+
- [runtime/core_metrics.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/core_metrics.md)
|
|
182
|
+
- [runtime/core_queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/core_queue.md)
|
|
183
|
+
- [stage/core_stages.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_stages.md)
|
|
184
|
+
- [observability/core_report.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/core_report.md)
|
|
185
|
+
- [graph/core_structure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/core_structure.md)
|
|
186
|
+
- [web/core_server.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/web/core_server.md)
|
|
188
187
|
- [other/go_worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/go_worker.md)
|
|
189
188
|
|
|
190
189
|
推荐阅读顺序:
|
|
@@ -202,7 +201,7 @@ flowchart TD
|
|
|
202
201
|
TM --> TME[TaskMetrics.md]
|
|
203
202
|
|
|
204
203
|
TG --> TQ[TaskQueue.md]
|
|
205
|
-
TG --> TN[
|
|
204
|
+
TG --> TN[TaskStages.md]
|
|
206
205
|
TG --> TR[TaskReport.md]
|
|
207
206
|
TG --> TSR[TaskStructure.md]
|
|
208
207
|
|
|
@@ -218,11 +217,11 @@ flowchart TD
|
|
|
218
217
|
|
|
219
218
|
以下三篇可以作为补充阅读:
|
|
220
219
|
|
|
221
|
-
- [runtime/
|
|
222
|
-
- [runtime/
|
|
223
|
-
- [runtime/
|
|
224
|
-
- [persistence/
|
|
225
|
-
- [persistence/
|
|
220
|
+
- [runtime/util_queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_queue.md)
|
|
221
|
+
- [runtime/util_types.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_types.md)
|
|
222
|
+
- [runtime/util_errors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_errors.md)
|
|
223
|
+
- [persistence/core_fail.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/core_fail.md)
|
|
224
|
+
- [persistence/core_log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/core_log.md)
|
|
226
225
|
|
|
227
226
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
|
|
228
227
|
|
|
@@ -234,7 +233,7 @@ flowchart TD
|
|
|
234
233
|
|
|
235
234
|
## 环境要求(Requirements)
|
|
236
235
|
|
|
237
|
-
**CelestialFlow** 基于 Python 3.
|
|
236
|
+
**CelestialFlow** 基于 Python 3.10+,并依赖以下核心组件。
|
|
238
237
|
请确保你的环境能够正常安装这些依赖(`pip install celestialflow` 会自动安装)。
|
|
239
238
|
|
|
240
239
|
| 依赖包 | 说明 |
|
|
@@ -254,22 +253,24 @@ flowchart TD
|
|
|
254
253
|
<p align="center">
|
|
255
254
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
|
|
256
255
|
<br/>
|
|
257
|
-
<em>celestial-flow 3.1.
|
|
256
|
+
<em>celestial-flow 3.1.7</em>
|
|
258
257
|
</p>
|
|
259
258
|
|
|
260
259
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
261
260
|
|
|
262
261
|
## 版本日志(Version Log)
|
|
263
|
-
- 3.1.
|
|
264
|
-
- feat
|
|
265
|
-
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
262
|
+
- 3.1.7
|
|
263
|
+
- feat:
|
|
264
|
+
- [Important] 删除executor中的"process"模式, 它跟新的retry机制实在难以匹配;
|
|
265
|
+
- refactor:
|
|
266
|
+
- [Important] 大幅重构retry机制, 现在不再让retry任务重进task_queue, 而是在worker中直接解决;
|
|
267
|
+
- 模仿CelestialForge中grow的做法;
|
|
268
|
+
- 大幅重构原本成功与失败结果的缓存机制, 并将原有get_success/error_dict改名为get_success/error_pairs, 以避免task无法作为键时会导致的问题;
|
|
269
|
+
- fail数据从fail.jsonl中提取;
|
|
270
|
+
- success数据从result_queue中直接获取, 为此添加了SuccessSpout作为集合端;
|
|
271
|
+
- fix:
|
|
272
|
+
- 修复部分任务类型无法在log_spout中dump进jsonl文件的问题;
|
|
273
|
+
- 修复在executor运行时, retry添加任务total数的问题, 虽然这样很帅;
|
|
273
274
|
|
|
274
275
|
## Star 历史趋势(Star History)
|
|
275
276
|
|
|
@@ -23,11 +23,10 @@
|
|
|
23
23
|
- 相比 Airflow/Dagster 更轻、更快开始
|
|
24
24
|
- 相比 multiprocessing/threading 更结构化,可直接表达 loop / complete graph 等复杂依赖模式
|
|
25
25
|
|
|
26
|
-
框架的基本单元为 **TaskExecutor
|
|
26
|
+
框架的基本单元为 **TaskExecutor**,可独立运行,并支持三种执行模式:
|
|
27
27
|
|
|
28
28
|
* **线性(serial)**
|
|
29
29
|
* **多线程(thread)**
|
|
30
|
-
* **多进程(process)**
|
|
31
30
|
* **协程(async)**
|
|
32
31
|
|
|
33
32
|
TaskExecutor 实现了对任务的结果缓存,任务去重,进度条显示,多执行模式比较等功能,单独使用也很好用。
|
|
@@ -108,7 +107,7 @@ flowchart LR
|
|
|
108
107
|
uv pip install celestialflow
|
|
109
108
|
|
|
110
109
|
# 不过也可以直接使用 `pip`
|
|
111
|
-
|
|
110
|
+
pip install celestialflow
|
|
112
111
|
```
|
|
113
112
|
|
|
114
113
|
一个简单的可运行代码:
|
|
@@ -150,16 +149,16 @@ if __name__ == "__main__":
|
|
|
150
149
|
|
|
151
150
|
若你想了解框架的整体结构与核心组件,下面的参考文档会对你有帮助:
|
|
152
151
|
|
|
153
|
-
- [stage/
|
|
154
|
-
- [stage/
|
|
155
|
-
- [graph/
|
|
156
|
-
- [
|
|
157
|
-
- [runtime/
|
|
158
|
-
- [runtime/
|
|
159
|
-
- [stage/
|
|
160
|
-
- [observability/
|
|
161
|
-
- [graph/
|
|
162
|
-
- [web/
|
|
152
|
+
- [stage/core_executor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_executor.md)
|
|
153
|
+
- [stage/core_stage.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_stage.md)
|
|
154
|
+
- [graph/core_graph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/core_graph.md)
|
|
155
|
+
- [observability/core_progress.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/core_progress.md)
|
|
156
|
+
- [runtime/core_metrics.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/core_metrics.md)
|
|
157
|
+
- [runtime/core_queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/core_queue.md)
|
|
158
|
+
- [stage/core_stages.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/core_stages.md)
|
|
159
|
+
- [observability/core_report.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/core_report.md)
|
|
160
|
+
- [graph/core_structure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/core_structure.md)
|
|
161
|
+
- [web/core_server.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/web/core_server.md)
|
|
163
162
|
- [other/go_worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/go_worker.md)
|
|
164
163
|
|
|
165
164
|
推荐阅读顺序:
|
|
@@ -177,7 +176,7 @@ flowchart TD
|
|
|
177
176
|
TM --> TME[TaskMetrics.md]
|
|
178
177
|
|
|
179
178
|
TG --> TQ[TaskQueue.md]
|
|
180
|
-
TG --> TN[
|
|
179
|
+
TG --> TN[TaskStages.md]
|
|
181
180
|
TG --> TR[TaskReport.md]
|
|
182
181
|
TG --> TSR[TaskStructure.md]
|
|
183
182
|
|
|
@@ -193,11 +192,11 @@ flowchart TD
|
|
|
193
192
|
|
|
194
193
|
以下三篇可以作为补充阅读:
|
|
195
194
|
|
|
196
|
-
- [runtime/
|
|
197
|
-
- [runtime/
|
|
198
|
-
- [runtime/
|
|
199
|
-
- [persistence/
|
|
200
|
-
- [persistence/
|
|
195
|
+
- [runtime/util_queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_queue.md)
|
|
196
|
+
- [runtime/util_types.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_types.md)
|
|
197
|
+
- [runtime/util_errors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/util_errors.md)
|
|
198
|
+
- [persistence/core_fail.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/core_fail.md)
|
|
199
|
+
- [persistence/core_log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/core_log.md)
|
|
201
200
|
|
|
202
201
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
|
|
203
202
|
|
|
@@ -209,7 +208,7 @@ flowchart TD
|
|
|
209
208
|
|
|
210
209
|
## 环境要求(Requirements)
|
|
211
210
|
|
|
212
|
-
**CelestialFlow** 基于 Python 3.
|
|
211
|
+
**CelestialFlow** 基于 Python 3.10+,并依赖以下核心组件。
|
|
213
212
|
请确保你的环境能够正常安装这些依赖(`pip install celestialflow` 会自动安装)。
|
|
214
213
|
|
|
215
214
|
| 依赖包 | 说明 |
|
|
@@ -229,22 +228,24 @@ flowchart TD
|
|
|
229
228
|
<p align="center">
|
|
230
229
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
|
|
231
230
|
<br/>
|
|
232
|
-
<em>celestial-flow 3.1.
|
|
231
|
+
<em>celestial-flow 3.1.7</em>
|
|
233
232
|
</p>
|
|
234
233
|
|
|
235
234
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
236
235
|
|
|
237
236
|
## 版本日志(Version Log)
|
|
238
|
-
- 3.1.
|
|
239
|
-
- feat
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
237
|
+
- 3.1.7
|
|
238
|
+
- feat:
|
|
239
|
+
- [Important] 删除executor中的"process"模式, 它跟新的retry机制实在难以匹配;
|
|
240
|
+
- refactor:
|
|
241
|
+
- [Important] 大幅重构retry机制, 现在不再让retry任务重进task_queue, 而是在worker中直接解决;
|
|
242
|
+
- 模仿CelestialForge中grow的做法;
|
|
243
|
+
- 大幅重构原本成功与失败结果的缓存机制, 并将原有get_success/error_dict改名为get_success/error_pairs, 以避免task无法作为键时会导致的问题;
|
|
244
|
+
- fail数据从fail.jsonl中提取;
|
|
245
|
+
- success数据从result_queue中直接获取, 为此添加了SuccessSpout作为集合端;
|
|
246
|
+
- fix:
|
|
247
|
+
- 修复部分任务类型无法在log_spout中dump进jsonl文件的问题;
|
|
248
|
+
- 修复在executor运行时, retry添加任务total数的问题, 虽然这样很帅;
|
|
248
249
|
|
|
249
250
|
## Star 历史趋势(Star History)
|
|
250
251
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "celestialflow"
|
|
7
|
-
version = "3.1.
|
|
7
|
+
version = "3.1.7"
|
|
8
8
|
description = "A flexible GRAPH-based task orchestration framework."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -36,7 +36,7 @@ classifiers = [
|
|
|
36
36
|
"Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
|
|
37
37
|
|
|
38
38
|
[project.scripts]
|
|
39
|
-
celestialflow-web = "celestialflow.web.
|
|
39
|
+
celestialflow-web = "celestialflow.web.core_server:main_entry"
|
|
40
40
|
|
|
41
41
|
[tool.setuptools]
|
|
42
42
|
license-files = []
|
|
@@ -70,5 +70,12 @@ dev = [
|
|
|
70
70
|
"pytest-asyncio>=0.25.3",
|
|
71
71
|
"httpx>=0.28.1",
|
|
72
72
|
"python-dotenv>=1.2.2",
|
|
73
|
-
"
|
|
73
|
+
"dill",
|
|
74
|
+
"mypy>=1.19.1",
|
|
75
|
+
"ruff",
|
|
74
76
|
]
|
|
77
|
+
|
|
78
|
+
[tool.mypy]
|
|
79
|
+
python_version = "3.10"
|
|
80
|
+
no_implicit_optional = false
|
|
81
|
+
disable_error_code = ["import-untyped"]
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
# __init__.py
|
|
2
|
-
from .stage import (
|
|
3
|
-
TaskExecutor,
|
|
4
|
-
TaskStage,
|
|
5
|
-
TaskSplitter,
|
|
6
|
-
TaskRedisTransport,
|
|
7
|
-
TaskRedisSource,
|
|
8
|
-
TaskRedisAck,
|
|
9
|
-
TaskRouter,
|
|
10
|
-
)
|
|
11
2
|
from .graph import (
|
|
12
|
-
TaskGraph,
|
|
13
3
|
TaskChain,
|
|
14
|
-
TaskLoop,
|
|
15
|
-
TaskCross,
|
|
16
4
|
TaskComplete,
|
|
17
|
-
|
|
5
|
+
TaskCross,
|
|
6
|
+
TaskGraph,
|
|
18
7
|
TaskGrid,
|
|
8
|
+
TaskLoop,
|
|
9
|
+
TaskWheel,
|
|
19
10
|
)
|
|
20
11
|
from .persistence.util_jsonl import (
|
|
21
12
|
load_jsonl_logs,
|
|
22
|
-
load_task_by_stage,
|
|
23
13
|
load_task_by_error,
|
|
14
|
+
load_task_by_stage,
|
|
24
15
|
)
|
|
25
|
-
from .runtime.util_types import TerminationSignal
|
|
26
16
|
from .runtime.util_hash import make_hashable
|
|
17
|
+
from .runtime.util_types import TerminationSignal
|
|
18
|
+
from .stage import (
|
|
19
|
+
TaskExecutor,
|
|
20
|
+
TaskRedisAck,
|
|
21
|
+
TaskRedisSource,
|
|
22
|
+
TaskRedisTransport,
|
|
23
|
+
TaskRouter,
|
|
24
|
+
TaskSplitter,
|
|
25
|
+
TaskStage,
|
|
26
|
+
)
|
|
27
|
+
from .utils.util_benchmark import benchmark_executor, benchmark_graph
|
|
27
28
|
from .utils.util_format import format_table
|
|
28
|
-
from .
|
|
29
|
-
from .web.server import TaskWebServer
|
|
29
|
+
from .web.core_server import TaskWebServer
|
|
30
30
|
|
|
31
31
|
__all__ = [
|
|
32
32
|
"TaskGraph",
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# funnel/core_spout.py
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
from multiprocessing import Queue as MPQueue
|
|
5
5
|
from queue import Empty
|
|
6
6
|
from threading import Thread
|
|
7
|
+
from typing import Any
|
|
7
8
|
|
|
8
9
|
from ..runtime.util_queue import cleanup_mpqueue
|
|
9
|
-
from ..runtime.util_types import
|
|
10
|
+
from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
class
|
|
13
|
+
class BaseSpout:
|
|
13
14
|
def __init__(self) -> None:
|
|
14
|
-
self.queue = MPQueue()
|
|
15
|
+
self.queue: Any = MPQueue()
|
|
15
16
|
self._thread: Thread | None = None
|
|
16
17
|
|
|
17
18
|
def _before_start(self) -> None:
|
|
18
19
|
return None
|
|
19
20
|
|
|
20
|
-
def _handle_record(self, record) -> None:
|
|
21
|
+
def _handle_record(self, record: Any) -> None:
|
|
21
22
|
raise NotImplementedError
|
|
22
23
|
|
|
23
24
|
def _after_stop(self) -> None:
|
|
@@ -26,10 +27,10 @@ class BaseListener:
|
|
|
26
27
|
def start(self) -> None:
|
|
27
28
|
self._before_start()
|
|
28
29
|
if self._thread is None or not self._thread.is_alive():
|
|
29
|
-
self._thread = Thread(target=self.
|
|
30
|
+
self._thread = Thread(target=self._spout, daemon=True)
|
|
30
31
|
self._thread.start()
|
|
31
32
|
|
|
32
|
-
def
|
|
33
|
+
def _spout(self) -> None:
|
|
33
34
|
while True:
|
|
34
35
|
try:
|
|
35
36
|
record = self.queue.get(timeout=0.5)
|
|
@@ -51,11 +52,3 @@ class BaseListener:
|
|
|
51
52
|
self._thread = None
|
|
52
53
|
cleanup_mpqueue(self.queue)
|
|
53
54
|
self._after_stop()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class BaseSinker:
|
|
57
|
-
def __init__(self, queue: MPQueue) -> None:
|
|
58
|
-
self.queue: MPQueue = queue
|
|
59
|
-
|
|
60
|
-
def _sink(self, record) -> None:
|
|
61
|
-
self.queue.put(record)
|