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.
Files changed (96) hide show
  1. {celestialflow-3.1.5 → celestialflow-3.1.7}/PKG-INFO +33 -32
  2. {celestialflow-3.1.5 → celestialflow-3.1.7}/README.md +32 -31
  3. {celestialflow-3.1.5 → celestialflow-3.1.7}/pyproject.toml +10 -3
  4. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/__init__.py +17 -17
  5. celestialflow-3.1.7/src/celestialflow/funnel/__init__.py +8 -0
  6. celestialflow-3.1.7/src/celestialflow/funnel/core_inlet.py +12 -0
  7. celestialflow-3.1.5/src/celestialflow/persistence/core_base.py → celestialflow-3.1.7/src/celestialflow/funnel/core_spout.py +8 -15
  8. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/__init__.py +3 -3
  9. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/core_graph.py +92 -82
  10. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/core_structure.py +3 -3
  11. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/util_analysis.py +4 -4
  12. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/graph/util_serialize.py +11 -11
  13. celestialflow-3.1.7/src/celestialflow/observability/__init__.py +10 -0
  14. {celestialflow-3.1.5/src/celestialflow/runtime → celestialflow-3.1.7/src/celestialflow/observability}/core_progress.py +3 -3
  15. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/observability/core_report.py +60 -54
  16. celestialflow-3.1.7/src/celestialflow/persistence/__init__.py +12 -0
  17. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/core_fail.py +22 -12
  18. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/core_log.py +74 -62
  19. celestialflow-3.1.7/src/celestialflow/persistence/core_success.py +35 -0
  20. celestialflow-3.1.7/src/celestialflow/persistence/util_jsonl.py +174 -0
  21. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/__init__.py +2 -5
  22. celestialflow-3.1.7/src/celestialflow/runtime/core_dispatch.py +247 -0
  23. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_envelope.py +13 -9
  24. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_metrics.py +14 -55
  25. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/core_queue.py +30 -26
  26. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_errors.py +2 -1
  27. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_estimators.py +2 -2
  28. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_factories.py +7 -9
  29. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_types.py +7 -5
  30. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/__init__.py +3 -3
  31. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_executor.py +167 -185
  32. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_stage.py +38 -26
  33. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/stage/core_stages.py +38 -33
  34. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_benchmark.py +14 -3
  35. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_clone.py +0 -1
  36. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_format.py +9 -9
  37. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/config.json +5 -5
  38. celestialflow-3.1.5/src/celestialflow/web/server.py → celestialflow-3.1.7/src/celestialflow/web/core_server.py +86 -64
  39. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/_colors.css +23 -18
  40. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/base.css +74 -56
  41. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/dashboard.css +73 -71
  42. celestialflow-3.1.7/src/celestialflow/web/static/css/errors.css +286 -0
  43. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/css/inject.css +124 -161
  44. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/main.js +4 -4
  45. celestialflow-3.1.7/src/celestialflow/web/static/js/task_analysis.js +59 -0
  46. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_errors.js +62 -45
  47. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_history.js +14 -8
  48. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_injection.js +21 -16
  49. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_statuses.js +6 -14
  50. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_structure.js +9 -0
  51. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_topology.js +20 -20
  52. celestialflow-3.1.7/src/celestialflow/web/static/js/utils.js +268 -0
  53. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/main.ts +4 -4
  54. celestialflow-3.1.7/src/celestialflow/web/static/ts/task_analysis.ts +67 -0
  55. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_errors.ts +178 -161
  56. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_history.ts +15 -9
  57. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_injection.ts +9 -4
  58. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_statuses.ts +12 -14
  59. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_structure.ts +10 -0
  60. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/utils.ts +141 -14
  61. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/templates/index.html +23 -19
  62. celestialflow-3.1.7/src/celestialflow/web/util_cal.py +4 -0
  63. celestialflow-3.1.7/src/celestialflow/web/util_config.py +23 -0
  64. celestialflow-3.1.7/src/celestialflow/web/util_error.py +53 -0
  65. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/PKG-INFO +33 -32
  66. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/SOURCES.txt +12 -5
  67. celestialflow-3.1.7/src/celestialflow.egg-info/entry_points.txt +2 -0
  68. {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_executor.py +1 -17
  69. {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_stages.py +23 -19
  70. {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_structure.py +16 -13
  71. {celestialflow-3.1.5 → celestialflow-3.1.7}/tests/test_utils.py +234 -237
  72. celestialflow-3.1.5/src/celestialflow/observability/__init__.py +0 -7
  73. celestialflow-3.1.5/src/celestialflow/persistence/__init__.py +0 -13
  74. celestialflow-3.1.5/src/celestialflow/persistence/util_jsonl.py +0 -132
  75. celestialflow-3.1.5/src/celestialflow/runtime/core_runner.py +0 -275
  76. celestialflow-3.1.5/src/celestialflow/web/static/css/errors.css +0 -284
  77. celestialflow-3.1.5/src/celestialflow/web/static/js/utils.js +0 -170
  78. celestialflow-3.1.5/src/celestialflow/web/static/ts/task_topology.ts +0 -67
  79. celestialflow-3.1.5/src/celestialflow.egg-info/entry_points.txt +0 -2
  80. {celestialflow-3.1.5 → celestialflow-3.1.7}/setup.cfg +0 -0
  81. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/persistence/util_constant.py +0 -0
  82. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_hash.py +0 -0
  83. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/runtime/util_queue.py +0 -0
  84. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/__init__.py +0 -0
  85. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_collections.py +0 -0
  86. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/utils/util_debug.py +0 -0
  87. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/favicon.ico +0 -0
  88. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_config.js +0 -0
  89. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_summary.js +0 -0
  90. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/js/web_config.js +0 -0
  91. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
  92. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_summary.ts +0 -0
  93. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/web_config.ts +0 -0
  94. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  95. {celestialflow-3.1.5 → celestialflow-3.1.7}/src/celestialflow.egg-info/requires.txt +0 -0
  96. {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.5
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
- uv pip install celestialflow
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/executor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/executor.md)
179
- - [stage/stage.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/stage.md)
180
- - [graph/graph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/graph.md)
181
- - [runtime/progress.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/progress.md)
182
- - [runtime/metrics.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/metrics.md)
183
- - [runtime/queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/queue.md)
184
- - [stage/nodes.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/nodes.md)
185
- - [observability/report.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/report.md)
186
- - [graph/structure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/structure.md)
187
- - [web/server.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/web/server.md)
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[TaskNodes.md]
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/tools.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/tools.md)
222
- - [runtime/types.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/types.md)
223
- - [runtime/errors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/errors.md)
224
- - [persistence/fail.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/fail.md)
225
- - [persistence/log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/log.md)
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.8+,并依赖以下核心组件。
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.5</em>
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.5
264
- - feat
265
- - 大幅修改节点状态卡片的色彩视觉设计. 包括: 取消原本的悬浮设计, 改为平面化设计; 让进度条更直接的显示不同任务完成状态的比例; 使用左边框来显示节点是否在运行中. 而非原本的badge;
266
- - 前端的error数据拉取不再每次都全量拉取, 而是只拉取自己当前没有的数据;
267
- - refactor
268
- - 大幅重构前端代码中的色彩管理, 现在色彩的一致性更好;
269
- - 修改前端代码中的数据更新判断, 现在相关判断交给serve.py;
270
- - fix
271
- - 修复节点已运行时间在节点完成后显示为0的问题
272
- - 修复在最新fastapi版本下TemplateResponse参数改变导致的问题
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
- uv pip install celestialflow
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/executor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/executor.md)
154
- - [stage/stage.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/stage.md)
155
- - [graph/graph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/graph.md)
156
- - [runtime/progress.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/progress.md)
157
- - [runtime/metrics.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/metrics.md)
158
- - [runtime/queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/queue.md)
159
- - [stage/nodes.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/nodes.md)
160
- - [observability/report.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/report.md)
161
- - [graph/structure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/structure.md)
162
- - [web/server.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/web/server.md)
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[TaskNodes.md]
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/tools.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/tools.md)
197
- - [runtime/types.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/types.md)
198
- - [runtime/errors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/errors.md)
199
- - [persistence/fail.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/fail.md)
200
- - [persistence/log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/log.md)
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.8+,并依赖以下核心组件。
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.5</em>
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.5
239
- - feat
240
- - 大幅修改节点状态卡片的色彩视觉设计. 包括: 取消原本的悬浮设计, 改为平面化设计; 让进度条更直接的显示不同任务完成状态的比例; 使用左边框来显示节点是否在运行中. 而非原本的badge;
241
- - 前端的error数据拉取不再每次都全量拉取, 而是只拉取自己当前没有的数据;
242
- - refactor
243
- - 大幅重构前端代码中的色彩管理, 现在色彩的一致性更好;
244
- - 修改前端代码中的数据更新判断, 现在相关判断交给serve.py;
245
- - fix
246
- - 修复节点已运行时间在节点完成后显示为0的问题
247
- - 修复在最新fastapi版本下TemplateResponse参数改变导致的问题
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.5"
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.server:main_entry"
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
- "black>=26.1.0",
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
- TaskWheel,
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 .utils.util_benchmark import benchmark_graph, benchmark_executor
29
- from .web.server import TaskWebServer
29
+ from .web.core_server import TaskWebServer
30
30
 
31
31
  __all__ = [
32
32
  "TaskGraph",
@@ -0,0 +1,8 @@
1
+ # funnel/__init__.py
2
+ from .core_spout import BaseSpout
3
+ from .core_inlet import BaseInlet
4
+
5
+ __all__ = [
6
+ "BaseSpout",
7
+ "BaseInlet",
8
+ ]
@@ -0,0 +1,12 @@
1
+ # funnel/core_inlet.py
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+
7
+ class BaseInlet:
8
+ def __init__(self, queue: Any) -> None:
9
+ self.queue: Any = queue
10
+
11
+ def _funnel(self, record: Any) -> None:
12
+ self.queue.put(record)
@@ -1,23 +1,24 @@
1
- # persistence/core_base.py
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 TerminationSignal, TERMINATION_SIGNAL
10
+ from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
10
11
 
11
12
 
12
- class BaseListener:
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._listen, daemon=True)
30
+ self._thread = Thread(target=self._spout, daemon=True)
30
31
  self._thread.start()
31
32
 
32
- def _listen(self) -> None:
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)
@@ -2,11 +2,11 @@
2
2
  from .core_graph import TaskGraph
3
3
  from .core_structure import (
4
4
  TaskChain,
5
- TaskLoop,
6
- TaskCross,
7
5
  TaskComplete,
8
- TaskWheel,
6
+ TaskCross,
9
7
  TaskGrid,
8
+ TaskLoop,
9
+ TaskWheel,
10
10
  )
11
11
 
12
12
  __all__ = [