celestialflow 3.1.8__tar.gz → 3.2.0__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 (100) hide show
  1. {celestialflow-3.1.8 → celestialflow-3.2.0}/PKG-INFO +23 -30
  2. {celestialflow-3.1.8 → celestialflow-3.2.0}/README.md +22 -29
  3. {celestialflow-3.1.8 → celestialflow-3.2.0}/pyproject.toml +80 -81
  4. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/__init__.py +5 -1
  5. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/funnel/core_spout.py +3 -6
  6. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/graph/core_graph.py +148 -197
  7. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/graph/core_structure.py +62 -32
  8. celestialflow-3.2.0/src/celestialflow/graph/util_analysis.py +73 -0
  9. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/graph/util_serialize.py +23 -16
  10. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/observability/__init__.py +4 -2
  11. celestialflow-3.2.0/src/celestialflow/observability/core_observer.py +29 -0
  12. celestialflow-3.2.0/src/celestialflow/observability/core_progress.py +30 -0
  13. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/observability/core_report.py +53 -43
  14. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/core_fail.py +7 -4
  15. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/core_log.py +18 -53
  16. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/util_jsonl.py +18 -15
  17. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/core_dispatch.py +32 -22
  18. celestialflow-3.2.0/src/celestialflow/runtime/core_envelope.py +58 -0
  19. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/core_metrics.py +11 -25
  20. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/core_queue.py +17 -17
  21. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/util_errors.py +5 -21
  22. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/util_estimators.py +12 -9
  23. celestialflow-3.2.0/src/celestialflow/runtime/util_factories.py +48 -0
  24. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/util_hash.py +9 -8
  25. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/util_types.py +19 -17
  26. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/stage/core_executor.py +103 -132
  27. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/stage/core_stage.py +77 -77
  28. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/stage/core_stages.py +43 -40
  29. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/utils/util_benchmark.py +46 -34
  30. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/utils/util_clone.py +31 -27
  31. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/utils/util_collections.py +1 -1
  32. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/utils/util_format.py +25 -18
  33. celestialflow-3.2.0/src/celestialflow/web/__init__.py +6 -0
  34. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/core_server.py +530 -510
  35. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/css/base.css +108 -1
  36. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/main.js +36 -6
  37. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_analysis.js +3 -2
  38. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_errors.js +43 -7
  39. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_history.js +8 -4
  40. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_injection.js +4 -3
  41. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_statuses.js +103 -94
  42. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_structure.js +133 -130
  43. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_summary.js +51 -49
  44. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/utils.js +269 -268
  45. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/web_config.js +11 -1
  46. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/main.ts +40 -6
  47. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_analysis.ts +3 -2
  48. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_errors.ts +10 -8
  49. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_history.ts +6 -4
  50. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_injection.ts +4 -3
  51. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_statuses.ts +17 -11
  52. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_structure.ts +8 -4
  53. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_summary.ts +4 -2
  54. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/utils.ts +3 -2
  55. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/web_config.ts +13 -2
  56. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/templates/index.html +32 -9
  57. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/util_config.py +4 -3
  58. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/PKG-INFO +23 -30
  59. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/SOURCES.txt +4 -2
  60. celestialflow-3.2.0/tests/test_analysis.py +132 -0
  61. celestialflow-3.2.0/tests/test_envelope.py +71 -0
  62. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_executor.py +164 -17
  63. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_graph.py +674 -418
  64. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_metrics.py +9 -9
  65. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_queue.py +17 -9
  66. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_stage.py +91 -106
  67. celestialflow-3.2.0/tests/test_structure.py +85 -0
  68. celestialflow-3.1.8/src/celestialflow/graph/util_analysis.py +0 -55
  69. celestialflow-3.1.8/src/celestialflow/observability/core_progress.py +0 -93
  70. celestialflow-3.1.8/src/celestialflow/runtime/core_envelope.py +0 -56
  71. celestialflow-3.1.8/src/celestialflow/runtime/util_factories.py +0 -95
  72. celestialflow-3.1.8/src/celestialflow/runtime/util_queue.py +0 -13
  73. celestialflow-3.1.8/src/celestialflow/utils/util_debug.py +0 -16
  74. celestialflow-3.1.8/tests/test_envelope.py +0 -45
  75. {celestialflow-3.1.8 → celestialflow-3.2.0}/setup.cfg +0 -0
  76. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/funnel/__init__.py +0 -0
  77. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/funnel/core_inlet.py +0 -0
  78. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/graph/__init__.py +0 -0
  79. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/__init__.py +0 -0
  80. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/core_success.py +0 -0
  81. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/persistence/util_constant.py +0 -0
  82. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/runtime/__init__.py +0 -0
  83. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/stage/__init__.py +0 -0
  84. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/utils/__init__.py +0 -0
  85. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/config.json +0 -0
  86. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/css/_colors.css +0 -0
  87. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/css/dashboard.css +0 -0
  88. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/css/errors.css +0 -0
  89. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/css/inject.css +0 -0
  90. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/favicon.ico +0 -0
  91. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_config.js +0 -0
  92. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_topology.js +0 -0
  93. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
  94. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/util_cal.py +0 -0
  95. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow/web/util_error.py +0 -0
  96. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  97. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/entry_points.txt +0 -0
  98. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/requires.txt +0 -0
  99. {celestialflow-3.1.8 → celestialflow-3.2.0}/src/celestialflow.egg-info/top_level.txt +0 -0
  100. {celestialflow-3.1.8 → celestialflow-3.2.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: celestialflow
3
- Version: 3.1.8
3
+ Version: 3.2.0
4
4
  Summary: A flexible GRAPH-based task orchestration framework.
5
5
  Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
6
6
  License: MIT
@@ -62,10 +62,7 @@ TaskExecutor 实现了对任务的结果缓存,任务去重,进度条显示
62
62
 
63
63
  但除去直接使用 TaskExecutor,更重要的是使用其子类**TaskStage**。TaskStage 可以互相连接,形成具有上游与下游依赖关系的任务图(**TaskGraph**)。下游 stage 会自动接收上游执行完成的结果作为输入,从而形成明确的数据流。
64
64
 
65
- TaskStage 的任务执行模式只有两种:
66
-
67
- * **线性(serial)**
68
- * **多线程(thread)**
65
+ TaskStage 的任务执行模式同样包含三种,与TaskExecutor中一致。
69
66
 
70
67
  在图级别上,每个 Stage 支持三种上下文模式:
71
68
 
@@ -153,15 +150,12 @@ def square(x):
153
150
 
154
151
  if __name__ == "__main__":
155
152
  # 定义两个任务节点
156
- stage1 = TaskStage(add, execution_mode="thread", unpack_task_args=True)
157
- stage2 = TaskStage(square, execution_mode="thread")
153
+ stage1 = TaskStage(name="Adder", func=add, execution_mode="thread", unpack_task_args=True, stage_mode="process")
154
+ stage2 = TaskStage(name="Squarer"func=square, execution_mode="thread", stage_mode="process")
158
155
 
159
156
  # 构建任务图结构
160
- stage1 = TaskStage(func=add, execution_mode="thread", unpack_task_args=True, stage_mode="process", name="Adder")
161
- stage2 = TaskStage(func=square, execution_mode="thread", stage_mode="process", name="Squarer")
162
-
163
157
  graph = TaskGraph()
164
- graph.set_stages(root_stages=[stage1], stages=[stage2])
158
+ graph.set_stages(stages=[stage1, stage2])
165
159
  graph.connect([stage1], [stage2])
166
160
 
167
161
  # 初始化任务并启动
@@ -253,12 +247,12 @@ flowchart TD
253
247
  | 依赖包 | 说明 |
254
248
  | ----------------- | ---- |
255
249
  | **Python ≥ 3.10** | 运行环境,建议使用 3.10 及以上版本 |
256
- | **tqdm** | 控制台进度条显示,用于任务执行可视化 |
257
250
  | **fastapi** | Web 服务接口框架(用于任务可视化与远程控制) |
258
251
  | **uvicorn** | FastAPI 的高性能 ASGI 服务器 |
259
252
  | **requests** | HTTP 客户端库,用于任务状态上报与远程调用 |
260
253
  | **networkx** | 任务图(TaskGraph)结构与依赖分析 |
261
254
  | **jinja2** | FastAPI 模板引擎,用于 Web 可视化界面渲染 |
255
+ | **tqdm** | 可选组件,进度条显示,用于任务执行可视化 |
262
256
  | **redis** | 可选组件,用于分布式任务通信(`TaskRedis*` 系列模块) |
263
257
  | **celestialtree** | 可选组件,用于任务状态上报与远程调用(`ctree_client`) |
264
258
 
@@ -267,32 +261,31 @@ flowchart TD
267
261
  <p align="center">
268
262
  <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
269
263
  <br/>
270
- <em>celestial-flow 3.1.8</em>
264
+ <em>celestial-flow 3.2.0</em>
271
265
  </p>
272
266
 
273
267
  (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
274
268
 
275
269
  ## 版本日志(Version Log)
276
- - 3.1.8
270
+ - 3.2.0
277
271
  - feat:
278
- - [Important] stage_mode新增"thread"模式, 适合I/O密集型任务和不可pickle的函数;
279
- - 在io密集任务的bench测试中, "thread-thread"相比最慢的"serial-serial"快8.7x, 并且优于之前最快的"process-thread";
280
- - 新增docs/.../bench与docs/.../demo文档, 补充bench实测结果;
272
+ - [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
273
+ - bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
274
+ - [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
275
+ - 重补了不少图论课
276
+ - 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
277
+ - 在web页面中添加配置按钮
278
+ - 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
281
279
  - refactor:
282
- - [Important] 删除stage.set_stage_context, 改用graph.connect;
283
- - 接口破坏性重构, 需要修改大量graph相关代码;
284
- - [Important] name作为第一位参数在stage/executor中强制设定;
285
- - 接口破坏性重构
286
- - 优化async的executor_mode, 使其同时获取与消费任务, 而非集中消费;
287
- - 为上版本retry机制的重构收尾;
280
+ - 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
281
+ - 例如将所有的MPValue和MPQueue改为int与Queue
282
+ - 尚未进行严格的bench测试, 但应该会带来一定的性能优化
283
+ - 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
284
+ - 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
285
+ - 根据 bench_hash_memory, 节省内存约23%
286
+ - 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
288
287
  - fix:
289
- - 修复find_unpickleable对bound method的误报;
290
- - 修复stage重复检测错误;
291
- - 修复retry任务无法被去重的问题;
292
- - chore:
293
- - 将demo/中所有test_函数名改为demo_函数名;
294
- - 重组docs目录结构, 将reference改为src;
295
- - docs中新增en/与ja/, 并将原有中文文档移至zh-CN/;
288
+ - 删除InQueue.get中的错误捕获, 这会导致错过panic级error
296
289
 
297
290
  更多过往日志可看:
298
291
 
@@ -37,10 +37,7 @@ TaskExecutor 实现了对任务的结果缓存,任务去重,进度条显示
37
37
 
38
38
  但除去直接使用 TaskExecutor,更重要的是使用其子类**TaskStage**。TaskStage 可以互相连接,形成具有上游与下游依赖关系的任务图(**TaskGraph**)。下游 stage 会自动接收上游执行完成的结果作为输入,从而形成明确的数据流。
39
39
 
40
- TaskStage 的任务执行模式只有两种:
41
-
42
- * **线性(serial)**
43
- * **多线程(thread)**
40
+ TaskStage 的任务执行模式同样包含三种,与TaskExecutor中一致。
44
41
 
45
42
  在图级别上,每个 Stage 支持三种上下文模式:
46
43
 
@@ -128,15 +125,12 @@ def square(x):
128
125
 
129
126
  if __name__ == "__main__":
130
127
  # 定义两个任务节点
131
- stage1 = TaskStage(add, execution_mode="thread", unpack_task_args=True)
132
- stage2 = TaskStage(square, execution_mode="thread")
128
+ stage1 = TaskStage(name="Adder", func=add, execution_mode="thread", unpack_task_args=True, stage_mode="process")
129
+ stage2 = TaskStage(name="Squarer"func=square, execution_mode="thread", stage_mode="process")
133
130
 
134
131
  # 构建任务图结构
135
- stage1 = TaskStage(func=add, execution_mode="thread", unpack_task_args=True, stage_mode="process", name="Adder")
136
- stage2 = TaskStage(func=square, execution_mode="thread", stage_mode="process", name="Squarer")
137
-
138
132
  graph = TaskGraph()
139
- graph.set_stages(root_stages=[stage1], stages=[stage2])
133
+ graph.set_stages(stages=[stage1, stage2])
140
134
  graph.connect([stage1], [stage2])
141
135
 
142
136
  # 初始化任务并启动
@@ -228,12 +222,12 @@ flowchart TD
228
222
  | 依赖包 | 说明 |
229
223
  | ----------------- | ---- |
230
224
  | **Python ≥ 3.10** | 运行环境,建议使用 3.10 及以上版本 |
231
- | **tqdm** | 控制台进度条显示,用于任务执行可视化 |
232
225
  | **fastapi** | Web 服务接口框架(用于任务可视化与远程控制) |
233
226
  | **uvicorn** | FastAPI 的高性能 ASGI 服务器 |
234
227
  | **requests** | HTTP 客户端库,用于任务状态上报与远程调用 |
235
228
  | **networkx** | 任务图(TaskGraph)结构与依赖分析 |
236
229
  | **jinja2** | FastAPI 模板引擎,用于 Web 可视化界面渲染 |
230
+ | **tqdm** | 可选组件,进度条显示,用于任务执行可视化 |
237
231
  | **redis** | 可选组件,用于分布式任务通信(`TaskRedis*` 系列模块) |
238
232
  | **celestialtree** | 可选组件,用于任务状态上报与远程调用(`ctree_client`) |
239
233
 
@@ -242,32 +236,31 @@ flowchart TD
242
236
  <p align="center">
243
237
  <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
244
238
  <br/>
245
- <em>celestial-flow 3.1.8</em>
239
+ <em>celestial-flow 3.2.0</em>
246
240
  </p>
247
241
 
248
242
  (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
249
243
 
250
244
  ## 版本日志(Version Log)
251
- - 3.1.8
245
+ - 3.2.0
252
246
  - feat:
253
- - [Important] stage_mode新增"thread"模式, 适合I/O密集型任务和不可pickle的函数;
254
- - 在io密集任务的bench测试中, "thread-thread"相比最慢的"serial-serial"快8.7x, 并且优于之前最快的"process-thread";
255
- - 新增docs/.../bench与docs/.../demo文档, 补充bench实测结果;
247
+ - [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
248
+ - bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
249
+ - [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
250
+ - 重补了不少图论课
251
+ - 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
252
+ - 在web页面中添加配置按钮
253
+ - 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
256
254
  - refactor:
257
- - [Important] 删除stage.set_stage_context, 改用graph.connect;
258
- - 接口破坏性重构, 需要修改大量graph相关代码;
259
- - [Important] name作为第一位参数在stage/executor中强制设定;
260
- - 接口破坏性重构
261
- - 优化async的executor_mode, 使其同时获取与消费任务, 而非集中消费;
262
- - 为上版本retry机制的重构收尾;
255
+ - 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
256
+ - 例如将所有的MPValue和MPQueue改为int与Queue
257
+ - 尚未进行严格的bench测试, 但应该会带来一定的性能优化
258
+ - 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
259
+ - 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
260
+ - 根据 bench_hash_memory, 节省内存约23%
261
+ - 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
263
262
  - fix:
264
- - 修复find_unpickleable对bound method的误报;
265
- - 修复stage重复检测错误;
266
- - 修复retry任务无法被去重的问题;
267
- - chore:
268
- - 将demo/中所有test_函数名改为demo_函数名;
269
- - 重组docs目录结构, 将reference改为src;
270
- - docs中新增en/与ja/, 并将原有中文文档移至zh-CN/;
263
+ - 删除InQueue.get中的错误捕获, 这会导致错过panic级error
271
264
 
272
265
  更多过往日志可看:
273
266
 
@@ -1,81 +1,80 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "celestialflow"
7
- version = "3.1.8"
8
- description = "A flexible GRAPH-based task orchestration framework."
9
- readme = "README.md"
10
- license = { text = "MIT" }
11
- authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
12
- keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
13
- requires-python = ">=3.10"
14
-
15
- dependencies = [
16
- "tqdm",
17
- "fastapi",
18
- "uvicorn",
19
- "requests",
20
- "networkx",
21
- "redis",
22
- "jinja2",
23
- "celestialtree>=0.1.2",
24
- ]
25
-
26
- classifiers = [
27
- "Programming Language :: Python :: 3",
28
- "License :: OSI Approved :: MIT License",
29
- "Operating System :: OS Independent",
30
- "Framework :: FastAPI",
31
- "Topic :: Software Development :: Libraries",
32
- ]
33
-
34
- [project.urls]
35
- "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
36
- "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
37
-
38
- [project.scripts]
39
- celestialflow-web = "celestialflow.web.core_server:main_entry"
40
-
41
- [tool.setuptools]
42
- license-files = []
43
-
44
- [tool.setuptools.package-data]
45
- celestialflow = [
46
- "web/templates/**/*.html",
47
- "web/static/**/*",
48
- "web/config.json"
49
- ]
50
-
51
- [tool.pytest.ini_options]
52
- addopts = "-s"
53
- log_cli = true
54
- log_cli_level = "INFO"
55
- log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
56
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
57
-
58
- filterwarnings = [
59
- "ignore::DeprecationWarning",
60
- "ignore::pytest.PytestDeprecationWarning",
61
- ]
62
-
63
- asyncio_default_fixture_loop_scope = "function"
64
-
65
- [dependency-groups]
66
- dev = [
67
- "build>=1.2.2.post1",
68
- "twine>=6.1.0",
69
- "pytest>=8.3.4",
70
- "pytest-asyncio>=0.25.3",
71
- "httpx>=0.28.1",
72
- "python-dotenv>=1.2.2",
73
- "dill",
74
- "mypy>=1.19.1",
75
- "ruff",
76
- ]
77
-
78
- [tool.mypy]
79
- python_version = "3.10"
80
- no_implicit_optional = false
81
- disable_error_code = ["import-untyped"]
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "celestialflow"
7
+ version = "3.2.0"
8
+ description = "A flexible GRAPH-based task orchestration framework."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
12
+ keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
13
+ requires-python = ">=3.10"
14
+
15
+ dependencies = [
16
+ "tqdm",
17
+ "fastapi",
18
+ "uvicorn",
19
+ "requests",
20
+ "networkx",
21
+ "redis",
22
+ "jinja2",
23
+ "celestialtree>=0.1.2",
24
+ ]
25
+
26
+ classifiers = [
27
+ "Programming Language :: Python :: 3",
28
+ "License :: OSI Approved :: MIT License",
29
+ "Operating System :: OS Independent",
30
+ "Framework :: FastAPI",
31
+ "Topic :: Software Development :: Libraries",
32
+ ]
33
+
34
+ [project.urls]
35
+ "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
36
+ "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
37
+
38
+ [project.scripts]
39
+ celestialflow-web = "celestialflow.web.core_server:main_entry"
40
+
41
+ [tool.setuptools]
42
+ license-files = []
43
+
44
+ [tool.setuptools.package-data]
45
+ celestialflow = [
46
+ "web/templates/**/*.html",
47
+ "web/static/**/*",
48
+ "web/config.json"
49
+ ]
50
+
51
+ [tool.pytest.ini_options]
52
+ addopts = "-s"
53
+ log_cli = true
54
+ log_cli_level = "INFO"
55
+ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
56
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
57
+
58
+ filterwarnings = [
59
+ "ignore::DeprecationWarning",
60
+ "ignore::pytest.PytestDeprecationWarning",
61
+ ]
62
+
63
+ asyncio_default_fixture_loop_scope = "function"
64
+
65
+ [dependency-groups]
66
+ dev = [
67
+ "build>=1.2.2.post1",
68
+ "twine>=6.1.0",
69
+ "pytest>=8.3.4",
70
+ "pytest-asyncio>=0.25.3",
71
+ "httpx>=0.28.1",
72
+ "python-dotenv>=1.2.2",
73
+ "ruff>=0.15.0",
74
+ "pyright>=1.1.409",
75
+ ]
76
+
77
+ [tool.pyright]
78
+ include = ["src"]
79
+ strict = ["src/celestialflow/runtime", "src/celestialflow/stage", "src/celestialflow/graph", "src/celestialflow/persistence", "src/celestialflow/funnel", "src/celestialflow/observability", "src/celestialflow/utils"]
80
+ stubsPath = "typings"
@@ -8,6 +8,7 @@ from .graph import (
8
8
  TaskLoop,
9
9
  TaskWheel,
10
10
  )
11
+ from .observability import BaseObserver, CallbackObserver, TaskProgress
11
12
  from .persistence.util_jsonl import (
12
13
  load_jsonl_logs,
13
14
  load_task_by_error,
@@ -26,7 +27,7 @@ from .stage import (
26
27
  )
27
28
  from .utils.util_benchmark import benchmark_executor, benchmark_graph
28
29
  from .utils.util_format import format_table
29
- from .web.core_server import TaskWebServer
30
+ from .web import TaskWebServer
30
31
 
31
32
  __all__ = [
32
33
  "TaskGraph",
@@ -36,6 +37,9 @@ __all__ = [
36
37
  "TaskComplete",
37
38
  "TaskWheel",
38
39
  "TaskGrid",
40
+ "BaseObserver",
41
+ "CallbackObserver",
42
+ "TaskProgress",
39
43
  "TaskExecutor",
40
44
  "TaskStage",
41
45
  "TaskSplitter",
@@ -1,12 +1,10 @@
1
1
  # funnel/core_spout.py
2
2
  from __future__ import annotations
3
3
 
4
- from multiprocessing import Queue as MPQueue
5
- from queue import Empty
4
+ from queue import Empty, Queue
6
5
  from threading import Thread
7
6
  from typing import Any
8
7
 
9
- from ..runtime.util_queue import cleanup_mpqueue
10
8
  from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
11
9
 
12
10
 
@@ -15,7 +13,7 @@ class BaseSpout:
15
13
 
16
14
  def __init__(self) -> None:
17
15
  """初始化监听器及其内部队列和线程引用。"""
18
- self.queue: Any = MPQueue()
16
+ self.queue: Queue[Any] = Queue()
19
17
  self._thread: Thread | None = None
20
18
 
21
19
  def _before_start(self) -> None:
@@ -46,7 +44,7 @@ class BaseSpout:
46
44
  except Exception: # ← 新增:防止线程崩溃
47
45
  continue # 或记录到 stderr,至少不丢后续记录
48
46
 
49
- def get_queue(self) -> MPQueue:
47
+ def get_queue(self) -> Queue[Any]:
50
48
  """获取监听器的输入队列。"""
51
49
  return self.queue
52
50
 
@@ -58,5 +56,4 @@ class BaseSpout:
58
56
  self.queue.put(TERMINATION_SIGNAL)
59
57
  self._thread.join()
60
58
  self._thread = None
61
- cleanup_mpqueue(self.queue)
62
59
  self._after_stop()