celestialflow 3.1.0__tar.gz → 3.1.2__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 (63) hide show
  1. {celestialflow-3.1.0 → celestialflow-3.1.2}/PKG-INFO +73 -108
  2. {celestialflow-3.1.0 → celestialflow-3.1.2}/README.md +72 -107
  3. {celestialflow-3.1.0 → celestialflow-3.1.2}/pyproject.toml +71 -60
  4. {celestialflow-3.1.0 → celestialflow-3.1.2}/src/celestialflow/__init__.py +11 -10
  5. celestialflow-3.1.2/src/celestialflow/graph/__init__.py +20 -0
  6. celestialflow-3.1.2/src/celestialflow/graph/analysis.py +50 -0
  7. celestialflow-3.1.0/src/celestialflow/task_graph.py → celestialflow-3.1.2/src/celestialflow/graph/graph.py +156 -167
  8. celestialflow-3.1.2/src/celestialflow/graph/serialize.py +103 -0
  9. celestialflow-3.1.0/src/celestialflow/task_structure.py → celestialflow-3.1.2/src/celestialflow/graph/structure.py +36 -14
  10. celestialflow-3.1.2/src/celestialflow/observability/__init__.py +7 -0
  11. celestialflow-3.1.0/src/celestialflow/task_report.py → celestialflow-3.1.2/src/celestialflow/observability/report.py +35 -29
  12. celestialflow-3.1.2/src/celestialflow/persistence/__init__.py +10 -0
  13. celestialflow-3.1.2/src/celestialflow/persistence/constant.py +11 -0
  14. celestialflow-3.1.2/src/celestialflow/persistence/fail.py +117 -0
  15. celestialflow-3.1.2/src/celestialflow/persistence/jsonl.py +179 -0
  16. celestialflow-3.1.0/src/celestialflow/task_logging.py → celestialflow-3.1.2/src/celestialflow/persistence/log.py +31 -37
  17. celestialflow-3.1.2/src/celestialflow/runtime/__init__.py +11 -0
  18. celestialflow-3.1.2/src/celestialflow/runtime/errors.py +98 -0
  19. celestialflow-3.1.2/src/celestialflow/runtime/estimators.py +128 -0
  20. celestialflow-3.1.2/src/celestialflow/runtime/factories.py +62 -0
  21. celestialflow-3.1.2/src/celestialflow/runtime/hash.py +35 -0
  22. celestialflow-3.1.2/src/celestialflow/runtime/metrics.py +158 -0
  23. celestialflow-3.1.0/src/celestialflow/task_progress.py → celestialflow-3.1.2/src/celestialflow/runtime/progress.py +1 -0
  24. celestialflow-3.1.0/src/celestialflow/task_queue.py → celestialflow-3.1.2/src/celestialflow/runtime/queue.py +97 -81
  25. celestialflow-3.1.2/src/celestialflow/runtime/tools.py +13 -0
  26. celestialflow-3.1.0/src/celestialflow/task_types.py → celestialflow-3.1.2/src/celestialflow/runtime/types.py +12 -10
  27. celestialflow-3.1.2/src/celestialflow/stage/__init__.py +20 -0
  28. celestialflow-3.1.0/src/celestialflow/task_executor.py → celestialflow-3.1.2/src/celestialflow/stage/executor.py +263 -298
  29. celestialflow-3.1.0/src/celestialflow/task_nodes.py → celestialflow-3.1.2/src/celestialflow/stage/nodes.py +19 -15
  30. celestialflow-3.1.0/src/celestialflow/task_stage.py → celestialflow-3.1.2/src/celestialflow/stage/stage.py +37 -41
  31. celestialflow-3.1.2/src/celestialflow/utils/__init__.py +1 -0
  32. celestialflow-3.1.2/src/celestialflow/utils/collections.py +17 -0
  33. celestialflow-3.1.2/src/celestialflow/utils/debug.py +10 -0
  34. celestialflow-3.1.2/src/celestialflow/utils/format.py +195 -0
  35. celestialflow-3.1.0/src/celestialflow/task_web.py → celestialflow-3.1.2/src/celestialflow/web/server.py +2 -1
  36. {celestialflow-3.1.0 → celestialflow-3.1.2}/src/celestialflow.egg-info/PKG-INFO +73 -108
  37. celestialflow-3.1.2/src/celestialflow.egg-info/SOURCES.txt +44 -0
  38. celestialflow-3.1.2/src/celestialflow.egg-info/entry_points.txt +2 -0
  39. {celestialflow-3.1.0 → celestialflow-3.1.2}/tests/test_graph.py +17 -6
  40. {celestialflow-3.1.0 → celestialflow-3.1.2}/tests/test_nodes.py +10 -5
  41. {celestialflow-3.1.0 → celestialflow-3.1.2}/tests/test_structure.py +43 -35
  42. celestialflow-3.1.0/src/celestialflow/static/css/base.css +0 -330
  43. celestialflow-3.1.0/src/celestialflow/static/css/dashboard.css +0 -365
  44. celestialflow-3.1.0/src/celestialflow/static/css/errors.css +0 -279
  45. celestialflow-3.1.0/src/celestialflow/static/css/inject.css +0 -668
  46. celestialflow-3.1.0/src/celestialflow/static/favicon.ico +0 -0
  47. celestialflow-3.1.0/src/celestialflow/static/js/main.js +0 -143
  48. celestialflow-3.1.0/src/celestialflow/static/js/task_errors.js +0 -147
  49. celestialflow-3.1.0/src/celestialflow/static/js/task_injection.js +0 -296
  50. celestialflow-3.1.0/src/celestialflow/static/js/task_statuses.js +0 -234
  51. celestialflow-3.1.0/src/celestialflow/static/js/task_structure.js +0 -150
  52. celestialflow-3.1.0/src/celestialflow/static/js/task_summary.js +0 -36
  53. celestialflow-3.1.0/src/celestialflow/static/js/task_topology.js +0 -54
  54. celestialflow-3.1.0/src/celestialflow/static/js/utils.js +0 -97
  55. celestialflow-3.1.0/src/celestialflow/task_tools.py +0 -669
  56. celestialflow-3.1.0/src/celestialflow/templates/index.html +0 -384
  57. celestialflow-3.1.0/src/celestialflow.egg-info/SOURCES.txt +0 -39
  58. celestialflow-3.1.0/src/celestialflow.egg-info/entry_points.txt +0 -2
  59. {celestialflow-3.1.0 → celestialflow-3.1.2}/setup.cfg +0 -0
  60. {celestialflow-3.1.0 → celestialflow-3.1.2}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  61. {celestialflow-3.1.0 → celestialflow-3.1.2}/src/celestialflow.egg-info/requires.txt +0 -0
  62. {celestialflow-3.1.0 → celestialflow-3.1.2}/src/celestialflow.egg-info/top_level.txt +0 -0
  63. {celestialflow-3.1.0 → celestialflow-3.1.2}/tests/test_executor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: celestialflow
3
- Version: 3.1.0
3
+ Version: 3.1.2
4
4
  Summary: A flexible GRAPH-based task orchestration framework.
5
5
  Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
6
6
  License: MIT
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Framework :: FastAPI
14
14
  Classifier: Topic :: Software Development :: Libraries
15
- Requires-Python: >=3.8
15
+ Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: tqdm
18
18
  Requires-Dist: loguru
@@ -130,7 +130,11 @@ flowchart LR
130
130
  安装 CelestialFlow:
131
131
 
132
132
  ```bash
133
- pip install celestialflow
133
+ # 推荐使用 `uv` 管理依赖与环境
134
+ uv pip install celestialflow
135
+
136
+ # 不过也可以直接使用 `pip`
137
+ uv pip install celestialflow
134
138
  ```
135
139
 
136
140
  一个简单的可运行代码:
@@ -172,19 +176,31 @@ if __name__ == "__main__":
172
176
 
173
177
  若你想了解框架的整体结构与核心组件,下面的参考文档会对你有帮助:
174
178
 
175
- - [🔧TaskExecutor概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_executor.md)
176
- - [🔧TaskStage概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_stage.md)
177
- - [🌐TaskGraph概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_graph.md)
178
- - [📚Go Worker概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/go_worker.md)
179
+ - [stage/executor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/executor.md)
180
+ - [stage/stage.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/stage.md)
181
+ - [graph/graph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/graph.md)
182
+ - [runtime/progress.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/progress.md)
183
+ - [runtime/metrics.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/metrics.md)
184
+ - [runtime/queue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/queue.md)
185
+ - [stage/nodes.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/stage/nodes.md)
186
+ - [observability/report.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/observability/report.md)
187
+ - [graph/structure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/graph/structure.md)
188
+ - [web/server.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/web/server.md)
189
+ - [other/go_worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/go_worker.md)
179
190
 
180
191
  推荐阅读顺序:
181
192
 
182
193
  ```mermaid
183
194
  flowchart TD
184
- classDef whiteNode fill:#ffffff,stroke:#000000,color:#000000;
195
+ classDef core fill:#e6efff,stroke:#3b82f6,color:#1e3a8a;
196
+ classDef runtime fill:#e9f8ef,stroke:#22c55e,color:#14532d;
197
+ classDef structure fill:#fff6e6,stroke:#f59e0b,color:#78350f;
198
+ classDef execution fill:#f3e8ff,stroke:#a855f7,color:#581c87;
199
+ classDef web fill:#ffeaea,stroke:#ef4444,color:#7f1d1d;
185
200
 
186
201
  TM[TaskExecutor.md] --> TS[TaskStage.md] --> TG[TaskGraph.md]
187
202
  TM --> TP[TaskProgress.md]
203
+ TM --> TME[TaskMetrics.md]
188
204
 
189
205
  TG --> TQ[TaskQueue.md]
190
206
  TG --> TN[TaskNodes.md]
@@ -194,14 +210,20 @@ flowchart TD
194
210
  TR --> TW[TaskWeb.md]
195
211
  TN --> GW[Go Worker.md]
196
212
 
197
- class TM,TG,TP,TQ,TN,TR,TS,TW,GW,TSR whiteNode;
213
+ class TM,TS,TG core;
214
+ class TP,TME runtime;
215
+ class TSR structure;
216
+ class TQ,TN,GW execution;
217
+ class TR,TW web;
198
218
  ```
199
219
 
200
220
  以下三篇可以作为补充阅读:
201
221
 
202
- - [TaskTools](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_tools.md)
203
- - [TaskTypes](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_types.md)
204
- - [TaskLogging](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_logging.md)
222
+ - [runtime/tools.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/tools.md)
223
+ - [runtime/types.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/types.md)
224
+ - [runtime/errors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/runtime/errors.md)
225
+ - [persistence/fail.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/fail.md)
226
+ - [persistence/log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/persistence/log.md)
205
227
 
206
228
  如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
207
229
 
@@ -209,7 +231,7 @@ flowchart TD
209
231
 
210
232
  如果你对3.0.7版本加入的ctree_client与其功能感兴趣, 可以看看这一篇:
211
233
 
212
- [📚CelestialTreeClient](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/ctree_client.md)
234
+ [📚CelestialTreeClient](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/ctree_client.md)
213
235
 
214
236
  ## 环境要求(Requirements)
215
237
 
@@ -231,100 +253,13 @@ flowchart TD
231
253
 
232
254
  ## 文件结构(File Structure)
233
255
 
234
- ```
235
- 📁 CelestialFlow (224MB 407KB 500B)
236
- 📁 docs (34KB 944B)
237
- 📁 reference (29KB 995B)
238
- 📝 ctree_client.md (6KB 997B)
239
- 📝 go_worker.md (6KB 378B)
240
- 📝 task_graph.md (4KB 989B)
241
- 📝 task_logging.md (0B)
242
- 📝 task_manage.md (7KB 499B)
243
- 📝 task_nodes.md (4KB 68B)
244
- 📝 task_progress.md (0B)
245
- 📝 task_queue.md (0B)
246
- 📝 task_report.md (0B)
247
- 📝 task_stage.md (0B)
248
- 📝 task_structure.md (112B)
249
- 📝 task_tools.md (0B)
250
- 📝 task_types.md (0B)
251
- 📝 task_web.md (0B)
252
- 📝 quick_start.md (4KB 973B)
253
- 📝 tutorial.md (0B)
254
- 📁 experiments (15KB 111B)
255
- 🐍 benchmark_datastructures.py (6KB 52B)
256
- 🐍 benchmark_hash.py (1KB 284B)
257
- 🐍 benchmark_queue.py (5KB 504B)
258
- 🐍 benchmark_tqdm.py (1KB 160B)
259
- 🐍 experiment_tqdm.py (1KB 135B)
260
- 📁 go_worker (6MB 968KB 38B)
261
- 📁 worker (5KB 746B)
262
- 🌀 parser.go (394B)
263
- 🌀 processor.go (2KB 612B)
264
- 🌀 types.go (299B)
265
- 🌀 worker.go (2KB 465B)
266
- ❓ go.mod (292B)
267
- ❓ go.sum (1KB 68B)
268
- ❓ go_worker.exe (6MB 960KB)
269
- 🌀 main.go (980B)
270
- 📁 img (4MB 700KB 695B)
271
- 📷 logo(old).png (836KB 542B)
272
- 📷 logo.png (122KB 747B)
273
- 📷 web_display.png (129KB 545B)
274
- 🎞️ web_ui.gif (3MB 635KB 909B)
275
- 📁 src (1MB 929KB 111B)
276
- 📁 celestialflow (1MB 911KB 486B)
277
- 📁 static (1MB 417KB 367B)
278
- 📁 css (31KB 621B)
279
- 🎨 base.css (6KB 181B)
280
- 🎨 dashboard.css (7KB 414B)
281
- 🎨 errors.css (5KB 216B)
282
- 🎨 inject.css (12KB 834B)
283
- 📁 js (33KB 672B)
284
- 📜 main.js (5KB 65B)
285
- 📜 task_errors.js (4KB 595B)
286
- 📜 task_injection.js (8KB 484B)
287
- 📜 task_statuses.js (8KB 51B)
288
- 📜 task_structure.js (4KB 709B)
289
- 📜 task_topology.js (1KB 375B)
290
- 📜 utils.js (1KB 441B)
291
- ❓ favicon.ico (1MB 352KB 98B)
292
- 📁 templates (13KB 174B)
293
- 🌐 index.html (13KB 174B)
294
- 📁 [1项排除的目录] (339KB 553B)
295
- 🐍 task_graph.py (26KB 700B)
296
- 🐍 task_logging.py (10KB 282B)
297
- 🐍 task_manage.py (36KB 110B)
298
- 🐍 task_nodes.py (10KB 814B)
299
- 🐍 task_progress.py (1KB 477B)
300
- 🐍 task_queue.py (10KB 948B)
301
- 🐍 task_report.py (4KB 828B)
302
- 🐍 task_stage.py (6KB 577B)
303
- 🐍 task_structure.py (7KB 255B)
304
- 🐍 task_tools.py (17KB 19B)
305
- 🐍 task_types.py (2KB 269B)
306
- 🐍 task_web.py (6KB 235B)
307
- 🐍 __init__.py (1KB 22B)
308
- 📁 [1项排除的目录] (17KB 649B)
309
- 📁 tests (126KB 724B)
310
- 📁 [1项排除的目录] (90KB 464B)
311
- 🐍 conftest.py (49B)
312
- 📝 README.md (6KB 324B)
313
- 🐍 test_graph.py (5KB 547B)
314
- 🐍 test_manage.py (3KB 90B)
315
- 🐍 test_nodes.py (11KB 218B)
316
- 🐍 test_structure.py (10KB 56B)
317
- 📁 [6项排除的目录] (210MB 685KB 450B)
318
- ❓ .env (88B)
319
- ❓ .gitignore (272B)
320
- ❓ LICENSE (1KB 65B)
321
- ❓ Makefile (501B)
322
- ❓ pyproject.toml (1KB 594B)
323
- 📝 README.md (16KB 3B)
324
- (celestial-flow 3.0.9)
325
- ```
256
+ <p align="center">
257
+ <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
258
+ <br/>
259
+ <em>celestial-flow 3.1.1</em>
260
+ </p>
326
261
 
327
- (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。)
262
+ (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
328
263
 
329
264
  ## 更新日志(Change Log)
330
265
 
@@ -352,8 +287,38 @@ flowchart TD
352
287
  - 在前端中添加error_id的显示, 为之后显示provenance_tree做准备;
353
288
  - 增加大量warning与error, 用于提醒不规范设置;
354
289
  - 优化前后端中错误数据的传输方式, 在大量错误数据时减少内存消耗;
355
- - 优化TaskLogger中log队列的准入机制;
356
- - 修改部分Bug
290
+ - 优化LogSinker中log队列的准入机制;
291
+ - 修改部分Bug;
292
+ - 3.1.0:
293
+ - 新增:
294
+ - 优化web端仪表盘页面的"总体状态摘要"卡片, 新增"总重复任务"与"总剩余市场", 后者由节点间拓扑关系计算而成, 后续还需要优化;
295
+ - 修复:
296
+ - 3.0.9版本下当web端与celestialflow运行端不同时, error数据无法传递的问题;
297
+ - 修复NullTaskReporter使用问题;
298
+ - 3.1.1:
299
+ - 新增:
300
+ - [Important] CelestialTree中引入grpc, 这大大减少了emit操作的耗时;
301
+ - [Important] 为TerminationSignal添加id, 并可以像task一样通过CelestialTree进行跟踪;
302
+ - 优化task_graph与task_executor的log分级, 现在默认为"SUCCESS"级;
303
+ - 将go_worker部分分离为单独project: [celestialflow-goworker]https://github.com/Mr-xiaotian/celestialflow-goworker
304
+ - 在readme中使用svg图片来展示文件夹结构;
305
+ - 优化全局剩余时间的计算;
306
+ - 优化部分代码结构;
307
+ - 修复:
308
+ - 修复节点剩余时间在小于1s时显示0的问题(这很影响判断);
309
+ - 在task_graph中使用"staged"模式时会报错的问题;
310
+ - 3.1.2:
311
+ - feat:
312
+ - [Important] 模仿已有Logger逻辑, 建立新的组合结构FailListener和FailSinker, 将原有绑定于TaskReporter的fail持久化在线程中实现;
313
+ - 借此让TaskExecutor也可以进行fail持久化, 文件为fallback/{date_str}/{executor_errors}({time_str}).jsonl";
314
+ - 重构整体项目结构, 现在更加清晰;
315
+ - 补全docs/reference中全部文档, 并令其符合项目重构后结构
316
+ - 引入uv进行环境管理;
317
+ - 将executor中技术逻辑分离为runtime/metrics.py;
318
+ - 整合TaskQueue中重复逻辑;
319
+ - fix
320
+ - 修复前端renderNodeList中参数设置错误;
321
+ - 修复其他微小bug;
357
322
 
358
323
  ## Star 历史趋势(Star History)
359
324
 
@@ -104,7 +104,11 @@ flowchart LR
104
104
  安装 CelestialFlow:
105
105
 
106
106
  ```bash
107
- pip install celestialflow
107
+ # 推荐使用 `uv` 管理依赖与环境
108
+ uv pip install celestialflow
109
+
110
+ # 不过也可以直接使用 `pip`
111
+ uv pip install celestialflow
108
112
  ```
109
113
 
110
114
  一个简单的可运行代码:
@@ -146,19 +150,31 @@ if __name__ == "__main__":
146
150
 
147
151
  若你想了解框架的整体结构与核心组件,下面的参考文档会对你有帮助:
148
152
 
149
- - [🔧TaskExecutor概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_executor.md)
150
- - [🔧TaskStage概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_stage.md)
151
- - [🌐TaskGraph概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_graph.md)
152
- - [📚Go Worker概念](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/go_worker.md)
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)
163
+ - [other/go_worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/go_worker.md)
153
164
 
154
165
  推荐阅读顺序:
155
166
 
156
167
  ```mermaid
157
168
  flowchart TD
158
- classDef whiteNode fill:#ffffff,stroke:#000000,color:#000000;
169
+ classDef core fill:#e6efff,stroke:#3b82f6,color:#1e3a8a;
170
+ classDef runtime fill:#e9f8ef,stroke:#22c55e,color:#14532d;
171
+ classDef structure fill:#fff6e6,stroke:#f59e0b,color:#78350f;
172
+ classDef execution fill:#f3e8ff,stroke:#a855f7,color:#581c87;
173
+ classDef web fill:#ffeaea,stroke:#ef4444,color:#7f1d1d;
159
174
 
160
175
  TM[TaskExecutor.md] --> TS[TaskStage.md] --> TG[TaskGraph.md]
161
176
  TM --> TP[TaskProgress.md]
177
+ TM --> TME[TaskMetrics.md]
162
178
 
163
179
  TG --> TQ[TaskQueue.md]
164
180
  TG --> TN[TaskNodes.md]
@@ -168,14 +184,20 @@ flowchart TD
168
184
  TR --> TW[TaskWeb.md]
169
185
  TN --> GW[Go Worker.md]
170
186
 
171
- class TM,TG,TP,TQ,TN,TR,TS,TW,GW,TSR whiteNode;
187
+ class TM,TS,TG core;
188
+ class TP,TME runtime;
189
+ class TSR structure;
190
+ class TQ,TN,GW execution;
191
+ class TR,TW web;
172
192
  ```
173
193
 
174
194
  以下三篇可以作为补充阅读:
175
195
 
176
- - [TaskTools](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_tools.md)
177
- - [TaskTypes](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_types.md)
178
- - [TaskLogging](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_logging.md)
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)
179
201
 
180
202
  如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
181
203
 
@@ -183,7 +205,7 @@ flowchart TD
183
205
 
184
206
  如果你对3.0.7版本加入的ctree_client与其功能感兴趣, 可以看看这一篇:
185
207
 
186
- [📚CelestialTreeClient](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/ctree_client.md)
208
+ [📚CelestialTreeClient](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/other/ctree_client.md)
187
209
 
188
210
  ## 环境要求(Requirements)
189
211
 
@@ -205,100 +227,13 @@ flowchart TD
205
227
 
206
228
  ## 文件结构(File Structure)
207
229
 
208
- ```
209
- 📁 CelestialFlow (224MB 407KB 500B)
210
- 📁 docs (34KB 944B)
211
- 📁 reference (29KB 995B)
212
- 📝 ctree_client.md (6KB 997B)
213
- 📝 go_worker.md (6KB 378B)
214
- 📝 task_graph.md (4KB 989B)
215
- 📝 task_logging.md (0B)
216
- 📝 task_manage.md (7KB 499B)
217
- 📝 task_nodes.md (4KB 68B)
218
- 📝 task_progress.md (0B)
219
- 📝 task_queue.md (0B)
220
- 📝 task_report.md (0B)
221
- 📝 task_stage.md (0B)
222
- 📝 task_structure.md (112B)
223
- 📝 task_tools.md (0B)
224
- 📝 task_types.md (0B)
225
- 📝 task_web.md (0B)
226
- 📝 quick_start.md (4KB 973B)
227
- 📝 tutorial.md (0B)
228
- 📁 experiments (15KB 111B)
229
- 🐍 benchmark_datastructures.py (6KB 52B)
230
- 🐍 benchmark_hash.py (1KB 284B)
231
- 🐍 benchmark_queue.py (5KB 504B)
232
- 🐍 benchmark_tqdm.py (1KB 160B)
233
- 🐍 experiment_tqdm.py (1KB 135B)
234
- 📁 go_worker (6MB 968KB 38B)
235
- 📁 worker (5KB 746B)
236
- 🌀 parser.go (394B)
237
- 🌀 processor.go (2KB 612B)
238
- 🌀 types.go (299B)
239
- 🌀 worker.go (2KB 465B)
240
- ❓ go.mod (292B)
241
- ❓ go.sum (1KB 68B)
242
- ❓ go_worker.exe (6MB 960KB)
243
- 🌀 main.go (980B)
244
- 📁 img (4MB 700KB 695B)
245
- 📷 logo(old).png (836KB 542B)
246
- 📷 logo.png (122KB 747B)
247
- 📷 web_display.png (129KB 545B)
248
- 🎞️ web_ui.gif (3MB 635KB 909B)
249
- 📁 src (1MB 929KB 111B)
250
- 📁 celestialflow (1MB 911KB 486B)
251
- 📁 static (1MB 417KB 367B)
252
- 📁 css (31KB 621B)
253
- 🎨 base.css (6KB 181B)
254
- 🎨 dashboard.css (7KB 414B)
255
- 🎨 errors.css (5KB 216B)
256
- 🎨 inject.css (12KB 834B)
257
- 📁 js (33KB 672B)
258
- 📜 main.js (5KB 65B)
259
- 📜 task_errors.js (4KB 595B)
260
- 📜 task_injection.js (8KB 484B)
261
- 📜 task_statuses.js (8KB 51B)
262
- 📜 task_structure.js (4KB 709B)
263
- 📜 task_topology.js (1KB 375B)
264
- 📜 utils.js (1KB 441B)
265
- ❓ favicon.ico (1MB 352KB 98B)
266
- 📁 templates (13KB 174B)
267
- 🌐 index.html (13KB 174B)
268
- 📁 [1项排除的目录] (339KB 553B)
269
- 🐍 task_graph.py (26KB 700B)
270
- 🐍 task_logging.py (10KB 282B)
271
- 🐍 task_manage.py (36KB 110B)
272
- 🐍 task_nodes.py (10KB 814B)
273
- 🐍 task_progress.py (1KB 477B)
274
- 🐍 task_queue.py (10KB 948B)
275
- 🐍 task_report.py (4KB 828B)
276
- 🐍 task_stage.py (6KB 577B)
277
- 🐍 task_structure.py (7KB 255B)
278
- 🐍 task_tools.py (17KB 19B)
279
- 🐍 task_types.py (2KB 269B)
280
- 🐍 task_web.py (6KB 235B)
281
- 🐍 __init__.py (1KB 22B)
282
- 📁 [1项排除的目录] (17KB 649B)
283
- 📁 tests (126KB 724B)
284
- 📁 [1项排除的目录] (90KB 464B)
285
- 🐍 conftest.py (49B)
286
- 📝 README.md (6KB 324B)
287
- 🐍 test_graph.py (5KB 547B)
288
- 🐍 test_manage.py (3KB 90B)
289
- 🐍 test_nodes.py (11KB 218B)
290
- 🐍 test_structure.py (10KB 56B)
291
- 📁 [6项排除的目录] (210MB 685KB 450B)
292
- ❓ .env (88B)
293
- ❓ .gitignore (272B)
294
- ❓ LICENSE (1KB 65B)
295
- ❓ Makefile (501B)
296
- ❓ pyproject.toml (1KB 594B)
297
- 📝 README.md (16KB 3B)
298
- (celestial-flow 3.0.9)
299
- ```
230
+ <p align="center">
231
+ <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
232
+ <br/>
233
+ <em>celestial-flow 3.1.1</em>
234
+ </p>
300
235
 
301
- (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。)
236
+ (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
302
237
 
303
238
  ## 更新日志(Change Log)
304
239
 
@@ -326,8 +261,38 @@ flowchart TD
326
261
  - 在前端中添加error_id的显示, 为之后显示provenance_tree做准备;
327
262
  - 增加大量warning与error, 用于提醒不规范设置;
328
263
  - 优化前后端中错误数据的传输方式, 在大量错误数据时减少内存消耗;
329
- - 优化TaskLogger中log队列的准入机制;
330
- - 修改部分Bug
264
+ - 优化LogSinker中log队列的准入机制;
265
+ - 修改部分Bug;
266
+ - 3.1.0:
267
+ - 新增:
268
+ - 优化web端仪表盘页面的"总体状态摘要"卡片, 新增"总重复任务"与"总剩余市场", 后者由节点间拓扑关系计算而成, 后续还需要优化;
269
+ - 修复:
270
+ - 3.0.9版本下当web端与celestialflow运行端不同时, error数据无法传递的问题;
271
+ - 修复NullTaskReporter使用问题;
272
+ - 3.1.1:
273
+ - 新增:
274
+ - [Important] CelestialTree中引入grpc, 这大大减少了emit操作的耗时;
275
+ - [Important] 为TerminationSignal添加id, 并可以像task一样通过CelestialTree进行跟踪;
276
+ - 优化task_graph与task_executor的log分级, 现在默认为"SUCCESS"级;
277
+ - 将go_worker部分分离为单独project: [celestialflow-goworker]https://github.com/Mr-xiaotian/celestialflow-goworker
278
+ - 在readme中使用svg图片来展示文件夹结构;
279
+ - 优化全局剩余时间的计算;
280
+ - 优化部分代码结构;
281
+ - 修复:
282
+ - 修复节点剩余时间在小于1s时显示0的问题(这很影响判断);
283
+ - 在task_graph中使用"staged"模式时会报错的问题;
284
+ - 3.1.2:
285
+ - feat:
286
+ - [Important] 模仿已有Logger逻辑, 建立新的组合结构FailListener和FailSinker, 将原有绑定于TaskReporter的fail持久化在线程中实现;
287
+ - 借此让TaskExecutor也可以进行fail持久化, 文件为fallback/{date_str}/{executor_errors}({time_str}).jsonl";
288
+ - 重构整体项目结构, 现在更加清晰;
289
+ - 补全docs/reference中全部文档, 并令其符合项目重构后结构
290
+ - 引入uv进行环境管理;
291
+ - 将executor中技术逻辑分离为runtime/metrics.py;
292
+ - 整合TaskQueue中重复逻辑;
293
+ - fix
294
+ - 修复前端renderNodeList中参数设置错误;
295
+ - 修复其他微小bug;
331
296
 
332
297
  ## Star 历史趋势(Star History)
333
298
 
@@ -341,4 +306,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
341
306
  ## 作者(Author)
342
307
  Author: Mr-xiaotian
343
308
  Email: mingxiaomingtian@gmail.com
344
- Project Link: [https://github.com/Mr-xiaotian/CelestialFlow](https://github.com/Mr-xiaotian/CelestialFlow)
309
+ Project Link: [https://github.com/Mr-xiaotian/CelestialFlow](https://github.com/Mr-xiaotian/CelestialFlow)
@@ -1,60 +1,71 @@
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.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.8"
14
-
15
- dependencies = [
16
- "tqdm",
17
- "loguru",
18
- "fastapi",
19
- "uvicorn",
20
- "requests",
21
- "networkx",
22
- "redis",
23
- "jinja2",
24
- "celestialtree",
25
- ]
26
-
27
- classifiers = [
28
- "Programming Language :: Python :: 3",
29
- "License :: OSI Approved :: MIT License",
30
- "Operating System :: OS Independent",
31
- "Framework :: FastAPI",
32
- "Topic :: Software Development :: Libraries",
33
- ]
34
-
35
- [project.urls]
36
- "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
37
- "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
38
-
39
- [project.scripts]
40
- celestialflow-web = "celestialflow.task_web:main_entry"
41
-
42
- [tool.setuptools]
43
- license-files = []
44
-
45
- [tool.setuptools.package-data]
46
- "celestialflow" = ["templates/*.html", "static/**/*"]
47
-
48
- [tool.pytest.ini_options]
49
- addopts = "-s"
50
- log_cli = true
51
- log_cli_level = "INFO"
52
- log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
53
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
54
-
55
- filterwarnings = [
56
- "ignore::DeprecationWarning",
57
- "ignore::pytest.PytestDeprecationWarning",
58
- ]
59
-
60
- asyncio_default_fixture_loop_scope = "function"
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.2"
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
+ "loguru",
18
+ "fastapi",
19
+ "uvicorn",
20
+ "requests",
21
+ "networkx",
22
+ "redis",
23
+ "jinja2",
24
+ "celestialtree",
25
+ ]
26
+
27
+ classifiers = [
28
+ "Programming Language :: Python :: 3",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Framework :: FastAPI",
32
+ "Topic :: Software Development :: Libraries",
33
+ ]
34
+
35
+ [project.urls]
36
+ "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
37
+ "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
38
+
39
+ [project.scripts]
40
+ celestialflow-web = "celestialflow.web.server:main_entry"
41
+
42
+ [tool.setuptools]
43
+ license-files = []
44
+
45
+ [tool.setuptools.package-data]
46
+ "celestialflow" = ["templates/*.html", "static/**/*"]
47
+
48
+ [tool.pytest.ini_options]
49
+ addopts = "-s"
50
+ log_cli = true
51
+ log_cli_level = "INFO"
52
+ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
53
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
54
+
55
+ filterwarnings = [
56
+ "ignore::DeprecationWarning",
57
+ "ignore::pytest.PytestDeprecationWarning",
58
+ ]
59
+
60
+ asyncio_default_fixture_loop_scope = "function"
61
+
62
+ [dependency-groups]
63
+ dev = [
64
+ "build>=1.2.2.post1",
65
+ "twine>=6.1.0",
66
+ "pytest>=8.3.4",
67
+ "pytest-asyncio>=0.25.3",
68
+ "httpx>=0.28.1",
69
+ "python-dotenv>=1.2.2",
70
+ "black>=26.1.0",
71
+ ]
@@ -1,14 +1,15 @@
1
- from .task_graph import TaskGraph
2
- from .task_executor import TaskExecutor
3
- from .task_stage import TaskStage
4
- from .task_nodes import (
1
+ # __init__.py
2
+ from .stage import (
3
+ TaskExecutor,
4
+ TaskStage,
5
5
  TaskSplitter,
6
6
  TaskRedisSink,
7
7
  TaskRedisSource,
8
8
  TaskRedisAck,
9
9
  TaskRouter,
10
10
  )
11
- from .task_structure import (
11
+ from .graph import (
12
+ TaskGraph,
12
13
  TaskChain,
13
14
  TaskLoop,
14
15
  TaskCross,
@@ -16,15 +17,15 @@ from .task_structure import (
16
17
  TaskWheel,
17
18
  TaskGrid,
18
19
  )
19
- from .task_types import TerminationSignal
20
- from .task_tools import (
20
+ from .runtime.types import TerminationSignal
21
+ from .runtime.hash import make_hashable
22
+ from .utils.format import format_table
23
+ from .persistence.jsonl import (
21
24
  load_jsonl_logs,
22
25
  load_task_by_stage,
23
26
  load_task_by_error,
24
- make_hashable,
25
- format_table,
26
27
  )
27
- from .task_web import TaskWebServer
28
+ from .web.server import TaskWebServer
28
29
 
29
30
  __all__ = [
30
31
  "TaskGraph",