celestialflow 3.1.6__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 (91) hide show
  1. {celestialflow-3.1.6 → celestialflow-3.1.7}/PKG-INFO +33 -37
  2. {celestialflow-3.1.6 → celestialflow-3.1.7}/README.md +32 -36
  3. {celestialflow-3.1.6 → celestialflow-3.1.7}/pyproject.toml +81 -80
  4. celestialflow-3.1.7/src/celestialflow/funnel/__init__.py +8 -0
  5. celestialflow-3.1.7/src/celestialflow/funnel/core_inlet.py +12 -0
  6. celestialflow-3.1.6/src/celestialflow/persistence/core_base.py → celestialflow-3.1.7/src/celestialflow/funnel/core_spout.py +4 -12
  7. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/graph/core_graph.py +58 -60
  8. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/graph/util_serialize.py +9 -9
  9. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/observability/__init__.py +3 -0
  10. {celestialflow-3.1.6/src/celestialflow/runtime → celestialflow-3.1.7/src/celestialflow/observability}/core_progress.py +3 -3
  11. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/observability/core_report.py +17 -17
  12. celestialflow-3.1.7/src/celestialflow/persistence/__init__.py +12 -0
  13. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/persistence/core_fail.py +18 -11
  14. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/persistence/core_log.py +61 -63
  15. celestialflow-3.1.7/src/celestialflow/persistence/core_success.py +35 -0
  16. celestialflow-3.1.7/src/celestialflow/persistence/util_jsonl.py +174 -0
  17. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/__init__.py +2 -5
  18. celestialflow-3.1.7/src/celestialflow/runtime/core_dispatch.py +247 -0
  19. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/core_envelope.py +13 -9
  20. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/core_metrics.py +11 -52
  21. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/core_queue.py +18 -16
  22. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_errors.py +1 -1
  23. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_factories.py +2 -2
  24. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/stage/core_executor.py +135 -169
  25. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/stage/core_stage.py +13 -13
  26. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/stage/core_stages.py +17 -21
  27. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/util_benchmark.py +2 -2
  28. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/util_clone.py +0 -1
  29. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/config.json +1 -1
  30. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/utils.js +268 -234
  31. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/utils.ts +56 -7
  32. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/PKG-INFO +33 -37
  33. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/SOURCES.txt +6 -3
  34. {celestialflow-3.1.6 → celestialflow-3.1.7}/tests/test_executor.py +0 -16
  35. celestialflow-3.1.6/src/celestialflow/persistence/__init__.py +0 -13
  36. celestialflow-3.1.6/src/celestialflow/persistence/util_jsonl.py +0 -132
  37. celestialflow-3.1.6/src/celestialflow/runtime/core_runner.py +0 -293
  38. {celestialflow-3.1.6 → celestialflow-3.1.7}/setup.cfg +0 -0
  39. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/__init__.py +0 -0
  40. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/graph/__init__.py +0 -0
  41. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/graph/core_structure.py +0 -0
  42. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/graph/util_analysis.py +0 -0
  43. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/persistence/util_constant.py +0 -0
  44. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_estimators.py +0 -0
  45. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_hash.py +0 -0
  46. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_queue.py +0 -0
  47. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/runtime/util_types.py +0 -0
  48. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/stage/__init__.py +0 -0
  49. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/__init__.py +0 -0
  50. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/util_collections.py +0 -0
  51. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/util_debug.py +0 -0
  52. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/utils/util_format.py +0 -0
  53. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/core_server.py +0 -0
  54. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/css/_colors.css +0 -0
  55. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/css/base.css +0 -0
  56. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/css/dashboard.css +0 -0
  57. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/css/errors.css +0 -0
  58. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/css/inject.css +0 -0
  59. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/favicon.ico +0 -0
  60. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/main.js +0 -0
  61. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_analysis.js +0 -0
  62. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_config.js +0 -0
  63. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_errors.js +0 -0
  64. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_history.js +0 -0
  65. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_injection.js +0 -0
  66. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_statuses.js +0 -0
  67. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_structure.js +0 -0
  68. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_summary.js +0 -0
  69. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/task_topology.js +0 -0
  70. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/js/web_config.js +0 -0
  71. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
  72. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/main.ts +0 -0
  73. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_analysis.ts +0 -0
  74. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_errors.ts +0 -0
  75. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_history.ts +0 -0
  76. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_injection.ts +0 -0
  77. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_statuses.ts +0 -0
  78. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_structure.ts +0 -0
  79. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/task_summary.ts +0 -0
  80. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/static/ts/web_config.ts +0 -0
  81. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/templates/index.html +0 -0
  82. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/util_cal.py +0 -0
  83. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/util_config.py +0 -0
  84. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow/web/util_error.py +0 -0
  85. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  86. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/entry_points.txt +0 -0
  87. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/requires.txt +0 -0
  88. {celestialflow-3.1.6 → celestialflow-3.1.7}/src/celestialflow.egg-info/top_level.txt +0 -0
  89. {celestialflow-3.1.6 → celestialflow-3.1.7}/tests/test_stages.py +0 -0
  90. {celestialflow-3.1.6 → celestialflow-3.1.7}/tests/test_structure.py +0 -0
  91. {celestialflow-3.1.6 → celestialflow-3.1.7}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: celestialflow
3
- Version: 3.1.6
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,27 +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.6</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.6
264
- - feat
265
- - 前端现在只储存一页的error数据, 有效减少了运行大规模任务时前端内存飙升的问题;
266
- - 优化任务数显示, 大于1*10^7时显示科学计数法, 否则显示英式计数;
267
- - 优化小屏模式下表格的显示: 改为用卡片式显示;
268
- - 在error表格中加入index项;
269
- - 大幅调整任务颜色分配, 现在重复任务使用黄色系, 等待任务使用灰色系;
270
- - 将节点卡片中的已消耗时间颜色拟合为下方进度条颜色;
271
- - refactor
272
- - 用mypy整理了一遍类型标注;
273
- - 删除与整合部分css代码;
274
- - 将字体等适合rem单位的地方全部从px替换为rem, 并且都部分size进行统一;
275
- - fix
276
- - 修复总体剩余时间在特殊情况下显示0的问题(这玩意真麻烦);
277
- - 修复部分小屏下的显示问题, 但折线图不显示的问题不太好解决;
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数的问题, 虽然这样很帅;
278
274
 
279
275
  ## Star 历史趋势(Star History)
280
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,27 +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.6</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.6
239
- - feat
240
- - 前端现在只储存一页的error数据, 有效减少了运行大规模任务时前端内存飙升的问题;
241
- - 优化任务数显示, 大于1*10^7时显示科学计数法, 否则显示英式计数;
242
- - 优化小屏模式下表格的显示: 改为用卡片式显示;
243
- - 在error表格中加入index项;
244
- - 大幅调整任务颜色分配, 现在重复任务使用黄色系, 等待任务使用灰色系;
245
- - 将节点卡片中的已消耗时间颜色拟合为下方进度条颜色;
246
- - refactor
247
- - 用mypy整理了一遍类型标注;
248
- - 删除与整合部分css代码;
249
- - 将字体等适合rem单位的地方全部从px替换为rem, 并且都部分size进行统一;
250
- - fix
251
- - 修复总体剩余时间在特殊情况下显示0的问题(这玩意真麻烦);
252
- - 修复部分小屏下的显示问题, 但折线图不显示的问题不太好解决;
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数的问题, 虽然这样很帅;
253
249
 
254
250
  ## Star 历史趋势(Star History)
255
251
 
@@ -1,80 +1,81 @@
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.6"
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
- ]
76
-
77
- [tool.mypy]
78
- python_version = "3.10"
79
- no_implicit_optional = false
80
- 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.1.7"
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"]
@@ -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,4 +1,4 @@
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
@@ -10,7 +10,7 @@ from ..runtime.util_queue import cleanup_mpqueue
10
10
  from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
11
11
 
12
12
 
13
- class BaseListener:
13
+ class BaseSpout:
14
14
  def __init__(self) -> None:
15
15
  self.queue: Any = MPQueue()
16
16
  self._thread: Thread | None = None
@@ -27,10 +27,10 @@ class BaseListener:
27
27
  def start(self) -> None:
28
28
  self._before_start()
29
29
  if self._thread is None or not self._thread.is_alive():
30
- self._thread = Thread(target=self._listen, daemon=True)
30
+ self._thread = Thread(target=self._spout, daemon=True)
31
31
  self._thread.start()
32
32
 
33
- def _listen(self) -> None:
33
+ def _spout(self) -> None:
34
34
  while True:
35
35
  try:
36
36
  record = self.queue.get(timeout=0.5)
@@ -52,11 +52,3 @@ class BaseListener:
52
52
  self._thread = None
53
53
  cleanup_mpqueue(self.queue)
54
54
  self._after_stop()
55
-
56
-
57
- class BaseSinker:
58
- def __init__(self, queue: Any) -> None:
59
- self.queue: Any = queue
60
-
61
- def _sink(self, record: Any) -> None:
62
- self.queue.put(record)