celestialflow 3.3.0__tar.gz → 3.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {celestialflow-3.3.0/src/celestialflow.egg-info → celestialflow-3.3.1}/PKG-INFO +64 -56
- {celestialflow-3.3.0 → celestialflow-3.3.1}/README.md +63 -55
- {celestialflow-3.3.0 → celestialflow-3.3.1}/pyproject.toml +1 -1
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/__init__.py +2 -3
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/benchmark/util_clone.py +0 -1
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/graph/core_graph.py +13 -71
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/node/core_dispatch.py +21 -28
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/node/core_node.py +52 -99
- celestialflow-3.3.1/src/celestialflow/node/core_nodes.py +201 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/node/util_types.py +1 -1
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/observability/__init__.py +2 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/observability/core_observer.py +3 -6
- celestialflow-3.3.1/src/celestialflow/observability/core_observer_print.py +86 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/observability/core_report.py +33 -37
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/observability/util_types.py +6 -2
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/core_lifecycle.py +35 -12
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/core_log.py +10 -97
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/util_sqlite.py +53 -5
- celestialflow-3.3.1/src/celestialflow/runtime/core_envelope.py +38 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/core_metrics.py +143 -91
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/core_queue.py +5 -5
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_types.py +6 -72
- {celestialflow-3.3.0 → celestialflow-3.3.1/src/celestialflow.egg-info}/PKG-INFO +64 -56
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow.egg-info/SOURCES.txt +1 -3
- celestialflow-3.3.0/src/celestialflow/graph/util_estimators.py +0 -94
- celestialflow-3.3.0/src/celestialflow/node/core_nodes.py +0 -332
- celestialflow-3.3.0/src/celestialflow/runtime/core_envelope.py +0 -60
- celestialflow-3.3.0/src/celestialflow/runtime/util_estimators.py +0 -68
- celestialflow-3.3.0/src/celestialflow/runtime/util_hash.py +0 -39
- {celestialflow-3.3.0 → celestialflow-3.3.1}/LICENSE +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/setup.cfg +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/benchmark/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/benchmark/util_benchmark.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/funnel/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/funnel/core_inlet.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/funnel/core_spout.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/funnel/util_count.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/graph/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/graph/core_structure.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/graph/util_order_graph.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/graph/util_render.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/node/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/node/util_callable.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/core_scope.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/persistence/util_payload.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_config.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_constant.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_errors.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_event.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow/runtime/util_format.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.1}/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.3.
|
|
3
|
+
Version: 3.3.1
|
|
4
4
|
Summary: A flexible GRAPH-based task orchestration framework.
|
|
5
5
|
Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -19,6 +19,8 @@ Dynamic: license-file
|
|
|
19
19
|
|
|
20
20
|
# CelestialFlow ——一个轻量级、可并行、基于图结构的 Python 任务调度框架
|
|
21
21
|
|
|
22
|
+
> 📅 最后更新日期: 2026/09/24
|
|
23
|
+
|
|
22
24
|
<p align="center">
|
|
23
25
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/logo.png" width="1080" alt="CelestialFlow Logo">
|
|
24
26
|
</p>
|
|
@@ -263,42 +265,44 @@ flowchart TD
|
|
|
263
265
|
## 文件结构(File Structure)
|
|
264
266
|
|
|
265
267
|
```
|
|
266
|
-
📁 CelestialFlow (
|
|
267
|
-
📁 bench (
|
|
268
|
+
📁 CelestialFlow (329MB 507KB 284B)
|
|
269
|
+
📁 bench (316KB 601B)
|
|
268
270
|
📁 [1项排除的目录] (194KB 222B)
|
|
269
271
|
🐍 bench_datastructures.py (6KB 690B)
|
|
270
272
|
🐍 bench_execution_mode.py (2KB 707B)
|
|
273
|
+
🐍 bench_funnel_vs_lock.py (21KB 888B)
|
|
271
274
|
🐍 bench_futures_memory.py (2KB 269B)
|
|
272
|
-
🐍 bench_gil_vs_nogil.py (
|
|
273
|
-
🐍 bench_graph_mode.py (6KB
|
|
275
|
+
🐍 bench_gil_vs_nogil.py (9KB 983B)
|
|
276
|
+
🐍 bench_graph_mode.py (6KB 614B)
|
|
274
277
|
🐍 bench_hash.py (7KB 67B)
|
|
275
278
|
🐍 bench_hash_container.py (3KB 1009B)
|
|
276
|
-
🐍 bench_hash_memory.py (3KB
|
|
279
|
+
🐍 bench_hash_memory.py (3KB 655B)
|
|
277
280
|
🐍 bench_http_grpc.py (2KB 536B)
|
|
278
281
|
🐍 bench_ipc_queue.py (7KB 104B)
|
|
279
282
|
🐍 bench_lock_overhead.py (9KB 421B)
|
|
280
283
|
🐍 bench_mpqueue_vs_shared_memory.py (13KB 127B)
|
|
281
|
-
🐍 bench_observer.py (
|
|
284
|
+
🐍 bench_observer.py (6KB 761B)
|
|
282
285
|
🐍 bench_persistence_spout.py (4KB 340B)
|
|
283
286
|
🐍 bench_queue.py (5KB 857B)
|
|
284
287
|
🐍 bench_requests.py (6KB 813B)
|
|
285
288
|
🐍 bench_tqdm.py (1KB 235B)
|
|
286
289
|
🐍 bench_utils.py (543B)
|
|
287
|
-
📁 demo (
|
|
288
|
-
📁 [
|
|
290
|
+
📁 demo (353KB 885B)
|
|
291
|
+
📁 [3项排除的目录] (302KB 399B)
|
|
289
292
|
🐍 demo_executor.py (1KB 495B)
|
|
290
293
|
🐍 demo_funnel.py (2KB 289B)
|
|
291
294
|
🐍 demo_graph.py (3KB 222B)
|
|
292
295
|
🐍 demo_network.py (3KB 756B)
|
|
293
|
-
🐍 demo_nodes.py (4KB
|
|
294
|
-
🐍 demo_observer.py (
|
|
295
|
-
🐍 demo_redis.py (
|
|
296
|
-
🐍 demo_structure.py (
|
|
297
|
-
🐍 demo_utils.py (6KB
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
📁
|
|
301
|
-
📁
|
|
296
|
+
🐍 demo_nodes.py (4KB 231B)
|
|
297
|
+
🐍 demo_observer.py (2KB 684B)
|
|
298
|
+
🐍 demo_redis.py (8KB 999B)
|
|
299
|
+
🐍 demo_structure.py (9KB 290B)
|
|
300
|
+
🐍 demo_utils.py (6KB 263B)
|
|
301
|
+
🐍 demo_web.py (9KB 353B)
|
|
302
|
+
📁 docs (2MB 52KB 639B)
|
|
303
|
+
📁 en[已折叠] (689KB 420B)
|
|
304
|
+
📁 ja[已折叠] (788KB 350B)
|
|
305
|
+
📁 zh-CN[已折叠] (622KB 893B)
|
|
302
306
|
📁 experiments (3KB 21B)
|
|
303
307
|
🐍 experiment_networkx.py (1KB 908B)
|
|
304
308
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -307,63 +311,67 @@ flowchart TD
|
|
|
307
311
|
📷 logo(old).png (836KB 542B)
|
|
308
312
|
📷 logo.png (122KB 747B)
|
|
309
313
|
📷 scc_condensation.svg (17KB 1B)
|
|
310
|
-
📁 src (1MB
|
|
311
|
-
📁 celestialflow[已折叠]
|
|
312
|
-
|
|
314
|
+
📁 src (1MB 829KB 441B)
|
|
315
|
+
📁 celestialflow[已折叠] (1MB 809KB 299B)
|
|
316
|
+
📁 [1项排除的目录] (20KB 142B)
|
|
317
|
+
📁 tests (3MB 653KB 168B)
|
|
313
318
|
📁 benchmark[已折叠] (45KB 270B)
|
|
314
319
|
📁 funnel[已折叠] (96KB 339B)
|
|
315
|
-
📁 graph[已折叠] (
|
|
316
|
-
📁 node[已折叠] (
|
|
317
|
-
📁 observability[已折叠] (
|
|
318
|
-
📁 persistence[已折叠] (
|
|
319
|
-
📁 runtime[已折叠] (1MB
|
|
320
|
+
📁 graph[已折叠] (723KB 325B)
|
|
321
|
+
📁 node[已折叠] (461KB 925B)
|
|
322
|
+
📁 observability[已折叠] (221KB 746B)
|
|
323
|
+
📁 persistence[已折叠] (410KB 135B)
|
|
324
|
+
📁 runtime[已折叠] (1MB 253KB 849B)
|
|
320
325
|
📁 [1项排除的目录] (487KB 637B)
|
|
321
326
|
🐍 conftest.py (1KB 38B)
|
|
322
|
-
📁 [
|
|
327
|
+
📁 [13项排除的目录] (315MB 353KB 422B)
|
|
323
328
|
❓ .env (468B)
|
|
324
329
|
❓ .gitignore (1KB 315B)
|
|
325
|
-
📝 AGENTS.md (1KB
|
|
330
|
+
📝 AGENTS.md (1KB 576B)
|
|
326
331
|
❓ LICENSE (1KB 65B)
|
|
327
332
|
❓ Makefile (149B)
|
|
328
333
|
⚙️ pyproject.toml (2KB 668B)
|
|
329
|
-
📝 README.md (
|
|
330
|
-
🔒 uv.lock (120KB
|
|
334
|
+
📝 README.md (18KB 12B)
|
|
335
|
+
🔒 uv.lock (120KB 756B)
|
|
331
336
|
```
|
|
332
337
|
<p align="center">
|
|
333
|
-
<em>celestial-flow 3.3.
|
|
338
|
+
<em>celestial-flow 3.3.1</em>
|
|
334
339
|
</p>
|
|
335
340
|
|
|
336
341
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
337
342
|
|
|
338
343
|
## 版本日志(Version Log)
|
|
339
|
-
- 3.3.
|
|
344
|
+
- 3.3.1
|
|
340
345
|
- feat:
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
|
|
346
|
+
- [IMPORTANT] 在 `TaskMetrics` 中添加 `upstream_counter` / `downstream_counter` 细致化记录上下游传输数据量
|
|
347
|
+
- 在 `reporter` 中传送节点的 `upstream_counter` / `downstream_counter`
|
|
348
|
+
- 同步更新web端, 现在web端的结构图中可以显示精确的上下游传送任务数量
|
|
349
|
+
- [IMPORTANT] 删除 `duplocate` 机制
|
|
350
|
+
- 这是非常 非常艰难的选择, `duplocate` 机制极其古老, 但在我的仔细评估后我认为问题有三:
|
|
351
|
+
- 1. 传入的任务未必hash able, 现有的hash函数不确定性极大
|
|
352
|
+
- 2. 如果要确保任务可hash, 最好单独传一个处理任务的func, 但这会添加node的参数复杂度
|
|
353
|
+
- 3. 同时duplocate在单node时完全可以被任务输入前的筛选来取代, 而graph时的收益的则非常不明显
|
|
354
|
+
- 反复考虑认为还是遵从简洁的第一性原则
|
|
355
|
+
- 简化 `log.task_success` 输出, 不再显示 `execution_mode`
|
|
356
|
+
- 在 `lifecycle` 中添加 `retry_time` 字段
|
|
357
|
+
- 添加一个开箱即用的 `observer`, `ObserverPrint`
|
|
358
|
+
- 在graph环境下显示的 `total` 会有问题, 下个版本解决
|
|
346
359
|
- refactor:
|
|
347
|
-
- [IMPORTANT]
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
- 删除 `TaskExecutor` 中的 `get_summary`, 这层包装实际上是多余的
|
|
357
|
-
- 同时所有的 `event_client.emit` 也不再附带 `summary` 信息
|
|
358
|
-
- 删除 `OrderGraph` 中的 `_node` 参数
|
|
359
|
-
- 之前这个参数提供: 所有节点名称; 节点的插入顺序
|
|
360
|
-
- 现在前者由 `_out` 提供, 后者不再重视
|
|
361
|
-
- `LifecycleInlet` 中的 `task_in` 改名为 `task_input`, 保持与 log 端一致
|
|
360
|
+
- [IMPORTANT] 大幅简化 `reporter` 中的数据, 现在只传输原始状态数据, 具体的分析交给前端完成
|
|
361
|
+
- 移除 `log.split_trace` / `log.split_success` / `log.route_success`, 并统一使用 `log.task_in` 来表达下游任务成功
|
|
362
|
+
- 移除 `node.get_binding_counter` 和 `node.prev_binding`, 并添加 `node.connect_to` 统一负责绑定上下游节点
|
|
363
|
+
- 在 `TaskNode` 中添加新的泛型 `Y`, 表示向下游传输的任务类型
|
|
364
|
+
- 这是为了优化 `splitter` 和 `router`
|
|
365
|
+
- 节点的 `elapsed_time` 现在由 `dispatch` 来自行计算, 保证精准
|
|
366
|
+
- 话说我之前为什么要弄那么一套即麻烦又不准的算法?
|
|
367
|
+
- 在 `reporter` 中为 `status` 添加门控, 如果当前状态与上一次发送状态一致, 则不进行发送
|
|
368
|
+
- 至此 `reporter` 中所有的 `push_*` 都拥有门控, 避免无效的数据发送
|
|
362
369
|
- fix:
|
|
363
|
-
|
|
364
|
-
-
|
|
365
|
-
|
|
366
|
-
|
|
370
|
+
- chore:
|
|
371
|
+
- 添加 `bench_funnel_vs_lock`, 用来测试并发环境下, 使用funnel和使用locl记录数据的性能差
|
|
372
|
+
- 前者发送延迟低, 但内存占用高
|
|
373
|
+
- 
|
|
374
|
+
- 添加 `demo_web`, 用于进行复杂结构的web演示
|
|
367
375
|
|
|
368
376
|
更多过往日志可看:
|
|
369
377
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# CelestialFlow ——一个轻量级、可并行、基于图结构的 Python 任务调度框架
|
|
2
2
|
|
|
3
|
+
> 📅 最后更新日期: 2026/09/24
|
|
4
|
+
|
|
3
5
|
<p align="center">
|
|
4
6
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/logo.png" width="1080" alt="CelestialFlow Logo">
|
|
5
7
|
</p>
|
|
@@ -244,42 +246,44 @@ flowchart TD
|
|
|
244
246
|
## 文件结构(File Structure)
|
|
245
247
|
|
|
246
248
|
```
|
|
247
|
-
📁 CelestialFlow (
|
|
248
|
-
📁 bench (
|
|
249
|
+
📁 CelestialFlow (329MB 507KB 284B)
|
|
250
|
+
📁 bench (316KB 601B)
|
|
249
251
|
📁 [1项排除的目录] (194KB 222B)
|
|
250
252
|
🐍 bench_datastructures.py (6KB 690B)
|
|
251
253
|
🐍 bench_execution_mode.py (2KB 707B)
|
|
254
|
+
🐍 bench_funnel_vs_lock.py (21KB 888B)
|
|
252
255
|
🐍 bench_futures_memory.py (2KB 269B)
|
|
253
|
-
🐍 bench_gil_vs_nogil.py (
|
|
254
|
-
🐍 bench_graph_mode.py (6KB
|
|
256
|
+
🐍 bench_gil_vs_nogil.py (9KB 983B)
|
|
257
|
+
🐍 bench_graph_mode.py (6KB 614B)
|
|
255
258
|
🐍 bench_hash.py (7KB 67B)
|
|
256
259
|
🐍 bench_hash_container.py (3KB 1009B)
|
|
257
|
-
🐍 bench_hash_memory.py (3KB
|
|
260
|
+
🐍 bench_hash_memory.py (3KB 655B)
|
|
258
261
|
🐍 bench_http_grpc.py (2KB 536B)
|
|
259
262
|
🐍 bench_ipc_queue.py (7KB 104B)
|
|
260
263
|
🐍 bench_lock_overhead.py (9KB 421B)
|
|
261
264
|
🐍 bench_mpqueue_vs_shared_memory.py (13KB 127B)
|
|
262
|
-
🐍 bench_observer.py (
|
|
265
|
+
🐍 bench_observer.py (6KB 761B)
|
|
263
266
|
🐍 bench_persistence_spout.py (4KB 340B)
|
|
264
267
|
🐍 bench_queue.py (5KB 857B)
|
|
265
268
|
🐍 bench_requests.py (6KB 813B)
|
|
266
269
|
🐍 bench_tqdm.py (1KB 235B)
|
|
267
270
|
🐍 bench_utils.py (543B)
|
|
268
|
-
📁 demo (
|
|
269
|
-
📁 [
|
|
271
|
+
📁 demo (353KB 885B)
|
|
272
|
+
📁 [3项排除的目录] (302KB 399B)
|
|
270
273
|
🐍 demo_executor.py (1KB 495B)
|
|
271
274
|
🐍 demo_funnel.py (2KB 289B)
|
|
272
275
|
🐍 demo_graph.py (3KB 222B)
|
|
273
276
|
🐍 demo_network.py (3KB 756B)
|
|
274
|
-
🐍 demo_nodes.py (4KB
|
|
275
|
-
🐍 demo_observer.py (
|
|
276
|
-
🐍 demo_redis.py (
|
|
277
|
-
🐍 demo_structure.py (
|
|
278
|
-
🐍 demo_utils.py (6KB
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
📁
|
|
282
|
-
📁
|
|
277
|
+
🐍 demo_nodes.py (4KB 231B)
|
|
278
|
+
🐍 demo_observer.py (2KB 684B)
|
|
279
|
+
🐍 demo_redis.py (8KB 999B)
|
|
280
|
+
🐍 demo_structure.py (9KB 290B)
|
|
281
|
+
🐍 demo_utils.py (6KB 263B)
|
|
282
|
+
🐍 demo_web.py (9KB 353B)
|
|
283
|
+
📁 docs (2MB 52KB 639B)
|
|
284
|
+
📁 en[已折叠] (689KB 420B)
|
|
285
|
+
📁 ja[已折叠] (788KB 350B)
|
|
286
|
+
📁 zh-CN[已折叠] (622KB 893B)
|
|
283
287
|
📁 experiments (3KB 21B)
|
|
284
288
|
🐍 experiment_networkx.py (1KB 908B)
|
|
285
289
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -288,63 +292,67 @@ flowchart TD
|
|
|
288
292
|
📷 logo(old).png (836KB 542B)
|
|
289
293
|
📷 logo.png (122KB 747B)
|
|
290
294
|
📷 scc_condensation.svg (17KB 1B)
|
|
291
|
-
📁 src (1MB
|
|
292
|
-
📁 celestialflow[已折叠]
|
|
293
|
-
|
|
295
|
+
📁 src (1MB 829KB 441B)
|
|
296
|
+
📁 celestialflow[已折叠] (1MB 809KB 299B)
|
|
297
|
+
📁 [1项排除的目录] (20KB 142B)
|
|
298
|
+
📁 tests (3MB 653KB 168B)
|
|
294
299
|
📁 benchmark[已折叠] (45KB 270B)
|
|
295
300
|
📁 funnel[已折叠] (96KB 339B)
|
|
296
|
-
📁 graph[已折叠] (
|
|
297
|
-
📁 node[已折叠] (
|
|
298
|
-
📁 observability[已折叠] (
|
|
299
|
-
📁 persistence[已折叠] (
|
|
300
|
-
📁 runtime[已折叠] (1MB
|
|
301
|
+
📁 graph[已折叠] (723KB 325B)
|
|
302
|
+
📁 node[已折叠] (461KB 925B)
|
|
303
|
+
📁 observability[已折叠] (221KB 746B)
|
|
304
|
+
📁 persistence[已折叠] (410KB 135B)
|
|
305
|
+
📁 runtime[已折叠] (1MB 253KB 849B)
|
|
301
306
|
📁 [1项排除的目录] (487KB 637B)
|
|
302
307
|
🐍 conftest.py (1KB 38B)
|
|
303
|
-
📁 [
|
|
308
|
+
📁 [13项排除的目录] (315MB 353KB 422B)
|
|
304
309
|
❓ .env (468B)
|
|
305
310
|
❓ .gitignore (1KB 315B)
|
|
306
|
-
📝 AGENTS.md (1KB
|
|
311
|
+
📝 AGENTS.md (1KB 576B)
|
|
307
312
|
❓ LICENSE (1KB 65B)
|
|
308
313
|
❓ Makefile (149B)
|
|
309
314
|
⚙️ pyproject.toml (2KB 668B)
|
|
310
|
-
📝 README.md (
|
|
311
|
-
🔒 uv.lock (120KB
|
|
315
|
+
📝 README.md (18KB 12B)
|
|
316
|
+
🔒 uv.lock (120KB 756B)
|
|
312
317
|
```
|
|
313
318
|
<p align="center">
|
|
314
|
-
<em>celestial-flow 3.3.
|
|
319
|
+
<em>celestial-flow 3.3.1</em>
|
|
315
320
|
</p>
|
|
316
321
|
|
|
317
322
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
318
323
|
|
|
319
324
|
## 版本日志(Version Log)
|
|
320
|
-
- 3.3.
|
|
325
|
+
- 3.3.1
|
|
321
326
|
- feat:
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
|
|
327
|
+
- [IMPORTANT] 在 `TaskMetrics` 中添加 `upstream_counter` / `downstream_counter` 细致化记录上下游传输数据量
|
|
328
|
+
- 在 `reporter` 中传送节点的 `upstream_counter` / `downstream_counter`
|
|
329
|
+
- 同步更新web端, 现在web端的结构图中可以显示精确的上下游传送任务数量
|
|
330
|
+
- [IMPORTANT] 删除 `duplocate` 机制
|
|
331
|
+
- 这是非常 非常艰难的选择, `duplocate` 机制极其古老, 但在我的仔细评估后我认为问题有三:
|
|
332
|
+
- 1. 传入的任务未必hash able, 现有的hash函数不确定性极大
|
|
333
|
+
- 2. 如果要确保任务可hash, 最好单独传一个处理任务的func, 但这会添加node的参数复杂度
|
|
334
|
+
- 3. 同时duplocate在单node时完全可以被任务输入前的筛选来取代, 而graph时的收益的则非常不明显
|
|
335
|
+
- 反复考虑认为还是遵从简洁的第一性原则
|
|
336
|
+
- 简化 `log.task_success` 输出, 不再显示 `execution_mode`
|
|
337
|
+
- 在 `lifecycle` 中添加 `retry_time` 字段
|
|
338
|
+
- 添加一个开箱即用的 `observer`, `ObserverPrint`
|
|
339
|
+
- 在graph环境下显示的 `total` 会有问题, 下个版本解决
|
|
327
340
|
- refactor:
|
|
328
|
-
- [IMPORTANT]
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
-
|
|
337
|
-
- 删除 `TaskExecutor` 中的 `get_summary`, 这层包装实际上是多余的
|
|
338
|
-
- 同时所有的 `event_client.emit` 也不再附带 `summary` 信息
|
|
339
|
-
- 删除 `OrderGraph` 中的 `_node` 参数
|
|
340
|
-
- 之前这个参数提供: 所有节点名称; 节点的插入顺序
|
|
341
|
-
- 现在前者由 `_out` 提供, 后者不再重视
|
|
342
|
-
- `LifecycleInlet` 中的 `task_in` 改名为 `task_input`, 保持与 log 端一致
|
|
341
|
+
- [IMPORTANT] 大幅简化 `reporter` 中的数据, 现在只传输原始状态数据, 具体的分析交给前端完成
|
|
342
|
+
- 移除 `log.split_trace` / `log.split_success` / `log.route_success`, 并统一使用 `log.task_in` 来表达下游任务成功
|
|
343
|
+
- 移除 `node.get_binding_counter` 和 `node.prev_binding`, 并添加 `node.connect_to` 统一负责绑定上下游节点
|
|
344
|
+
- 在 `TaskNode` 中添加新的泛型 `Y`, 表示向下游传输的任务类型
|
|
345
|
+
- 这是为了优化 `splitter` 和 `router`
|
|
346
|
+
- 节点的 `elapsed_time` 现在由 `dispatch` 来自行计算, 保证精准
|
|
347
|
+
- 话说我之前为什么要弄那么一套即麻烦又不准的算法?
|
|
348
|
+
- 在 `reporter` 中为 `status` 添加门控, 如果当前状态与上一次发送状态一致, 则不进行发送
|
|
349
|
+
- 至此 `reporter` 中所有的 `push_*` 都拥有门控, 避免无效的数据发送
|
|
343
350
|
- fix:
|
|
344
|
-
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
|
|
351
|
+
- chore:
|
|
352
|
+
- 添加 `bench_funnel_vs_lock`, 用来测试并发环境下, 使用funnel和使用locl记录数据的性能差
|
|
353
|
+
- 前者发送延迟低, 但内存占用高
|
|
354
|
+
- 
|
|
355
|
+
- 添加 `demo_web`, 用于进行复杂结构的web演示
|
|
348
356
|
|
|
349
357
|
更多过往日志可看:
|
|
350
358
|
|
|
@@ -20,19 +20,19 @@ from .node import (
|
|
|
20
20
|
TaskRouter,
|
|
21
21
|
TaskSplitter,
|
|
22
22
|
)
|
|
23
|
-
from .observability import BaseObserver, TaskReporter
|
|
23
|
+
from .observability import BaseObserver, PrintObserver, TaskReporter
|
|
24
24
|
from .persistence.util_sqlite import (
|
|
25
25
|
load_records,
|
|
26
26
|
load_tasks_grouped_by_stage,
|
|
27
27
|
)
|
|
28
28
|
from .runtime.util_format import format_table
|
|
29
|
-
from .runtime.util_hash import make_hashable
|
|
30
29
|
from .runtime.util_types import TerminationSignal
|
|
31
30
|
|
|
32
31
|
__all__ = [
|
|
33
32
|
"BaseInlet",
|
|
34
33
|
"BaseObserver",
|
|
35
34
|
"BaseSpout",
|
|
35
|
+
"PrintObserver",
|
|
36
36
|
"TaskChain",
|
|
37
37
|
"TaskComplete",
|
|
38
38
|
"TaskCross",
|
|
@@ -50,5 +50,4 @@ __all__ = [
|
|
|
50
50
|
"format_table",
|
|
51
51
|
"load_records",
|
|
52
52
|
"load_tasks_grouped_by_stage",
|
|
53
|
-
"make_hashable",
|
|
54
53
|
]
|
|
@@ -18,10 +18,8 @@ from ..runtime.util_errors import (
|
|
|
18
18
|
InvalidOptionError,
|
|
19
19
|
NodeNotFoundError,
|
|
20
20
|
)
|
|
21
|
-
from ..runtime.util_estimators import calc_remaining
|
|
22
21
|
from ..runtime.util_event import EventClient, LocalEventClient
|
|
23
22
|
from ..runtime.util_format import cluster_by_value_sorted
|
|
24
|
-
from .util_estimators import calc_global_pending
|
|
25
23
|
from .util_order_graph import OrderGraph, compute_node_levels, is_dag, source_nodes
|
|
26
24
|
from .util_render import render_structure_list
|
|
27
25
|
|
|
@@ -134,21 +132,15 @@ class TaskGraph:
|
|
|
134
132
|
"""
|
|
135
133
|
for from_node in from_nodes:
|
|
136
134
|
from_name = from_node.get_name()
|
|
137
|
-
from_out_queue = from_node.result_queue
|
|
138
|
-
|
|
139
135
|
if from_name not in self.node_dict:
|
|
140
136
|
raise NodeNotFoundError(f"from node not found: {from_name}")
|
|
141
137
|
|
|
142
138
|
for to_node in to_nodes:
|
|
143
139
|
to_name = to_node.get_name()
|
|
144
|
-
to_in_queue = to_node.task_queue
|
|
145
|
-
|
|
146
140
|
if to_name not in self.node_dict:
|
|
147
141
|
raise NodeNotFoundError(f"to node not found: {to_name}")
|
|
148
142
|
|
|
149
|
-
|
|
150
|
-
from_out_queue.add_queue(to_in_queue, to_name)
|
|
151
|
-
to_in_queue.add_source_name(from_name)
|
|
143
|
+
from_node.connect_to(to_node)
|
|
152
144
|
self.order_graph.add_edge(from_name, to_name)
|
|
153
145
|
|
|
154
146
|
self._analysis_dirty = True
|
|
@@ -510,68 +502,6 @@ class TaskGraph:
|
|
|
510
502
|
else:
|
|
511
503
|
await asyncio.to_thread(node.start)
|
|
512
504
|
|
|
513
|
-
# ==== 运行时监控 ====
|
|
514
|
-
|
|
515
|
-
def _calc_graph_pending(
|
|
516
|
-
self,
|
|
517
|
-
running_processed_map: dict[str, int],
|
|
518
|
-
running_pending_map: dict[str, int],
|
|
519
|
-
) -> dict[str, int]:
|
|
520
|
-
"""
|
|
521
|
-
根据 DAG/非 DAG 策略计算全局预计待处理任务数量。
|
|
522
|
-
|
|
523
|
-
:param running_processed_map: 各节点已处理任务数
|
|
524
|
-
:param running_pending_map: 各节点待处理任务数
|
|
525
|
-
:return: 全局预计待处理任务数量
|
|
526
|
-
"""
|
|
527
|
-
if not self.is_dag:
|
|
528
|
-
return running_pending_map
|
|
529
|
-
|
|
530
|
-
total_pending_map = calc_global_pending(
|
|
531
|
-
self.order_graph,
|
|
532
|
-
running_processed_map,
|
|
533
|
-
running_pending_map,
|
|
534
|
-
)
|
|
535
|
-
return total_pending_map
|
|
536
|
-
|
|
537
|
-
def collect_runtime_snapshot(self) -> tuple[dict[str, Any], float]:
|
|
538
|
-
"""
|
|
539
|
-
采集一次运行时快照并返回。
|
|
540
|
-
|
|
541
|
-
遍历所有节点采集运行时快照,然后计算 DAG 感知的全局 pending 估算值,
|
|
542
|
-
并补充到每个节点的快照(``total_tasks_pending`` / ``total_remaining_time``)中。
|
|
543
|
-
|
|
544
|
-
:return: ``(status_dict, status_timestamp)`` —— 各节点快照字典与统一采集时间戳
|
|
545
|
-
"""
|
|
546
|
-
status_dict: dict[str, dict[str, Any]] = {}
|
|
547
|
-
now = time.time()
|
|
548
|
-
interval = self.reporter.interval
|
|
549
|
-
|
|
550
|
-
# 为全局预计待处理任务数收集数据
|
|
551
|
-
running_processed_map: dict[str, int] = {}
|
|
552
|
-
running_pending_map: dict[str, int] = {}
|
|
553
|
-
|
|
554
|
-
for node_name, node in self.node_dict.items():
|
|
555
|
-
snapshot = node.snapshot(interval)
|
|
556
|
-
status_dict[node_name] = snapshot
|
|
557
|
-
|
|
558
|
-
running_processed_map[node_name] = int(snapshot["tasks_processed"] or 0)
|
|
559
|
-
running_pending_map[node_name] = int(snapshot["tasks_pending"] or 0)
|
|
560
|
-
|
|
561
|
-
total_pending_map = self._calc_graph_pending(
|
|
562
|
-
running_processed_map,
|
|
563
|
-
running_pending_map,
|
|
564
|
-
)
|
|
565
|
-
for node_name, node_status in status_dict.items():
|
|
566
|
-
node_status["total_tasks_pending"] = total_pending_map[node_name]
|
|
567
|
-
node_status["total_remaining_time"] = calc_remaining(
|
|
568
|
-
node_status["tasks_processed"],
|
|
569
|
-
node_status["total_tasks_pending"],
|
|
570
|
-
node_status["elapsed_time"],
|
|
571
|
-
)
|
|
572
|
-
|
|
573
|
-
return status_dict, now
|
|
574
|
-
|
|
575
505
|
# ==== 查询接口 ====
|
|
576
506
|
|
|
577
507
|
def get_graph_id(self) -> str:
|
|
@@ -599,6 +529,18 @@ class TaskGraph:
|
|
|
599
529
|
"""
|
|
600
530
|
return self.order_graph.out_edges
|
|
601
531
|
|
|
532
|
+
def get_node_meta(self) -> dict[str, dict[str, Any]]:
|
|
533
|
+
"""
|
|
534
|
+
获取各节点的构建期元信息。
|
|
535
|
+
|
|
536
|
+
这些字段在 reporter 启动前已冻结,因此随图结构一次性上报,不进每轮状态推送。
|
|
537
|
+
|
|
538
|
+
:return: ``{node_name: {"class_name": ..., "execution_mode": ..., "max_workers": ...}}``
|
|
539
|
+
"""
|
|
540
|
+
return {
|
|
541
|
+
node_name: node.get_meta() for node_name, node in self.node_dict.items()
|
|
542
|
+
}
|
|
543
|
+
|
|
602
544
|
def get_source_nodes(self) -> list[str]:
|
|
603
545
|
"""
|
|
604
546
|
获取源节点列表
|