celestialflow 3.3.0__tar.gz → 3.3.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.
- {celestialflow-3.3.0/src/celestialflow.egg-info → celestialflow-3.3.2}/PKG-INFO +66 -69
- {celestialflow-3.3.0 → celestialflow-3.3.2}/README.md +65 -68
- {celestialflow-3.3.0 → celestialflow-3.3.2}/pyproject.toml +5 -1
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/__init__.py +12 -8
- celestialflow-3.3.2/src/celestialflow/assembly/__init__.py +13 -0
- celestialflow-3.3.2/src/celestialflow/assembly/core_run.py +143 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/benchmark/util_benchmark.py +2 -2
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/benchmark/util_clone.py +18 -46
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/funnel/core_spout.py +2 -6
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/graph/core_graph.py +179 -167
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/node/core_dispatch.py +40 -37
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/node/core_node.py +219 -214
- celestialflow-3.3.2/src/celestialflow/node/core_nodes.py +222 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/node/util_types.py +1 -1
- celestialflow-3.3.2/src/celestialflow/observer/__init__.py +43 -0
- celestialflow-3.3.2/src/celestialflow/observer/core_event.py +211 -0
- celestialflow-3.3.2/src/celestialflow/observer/core_hub.py +276 -0
- celestialflow-3.3.2/src/celestialflow/observer/core_metrics.py +198 -0
- celestialflow-3.3.2/src/celestialflow/observer/core_observer.py +139 -0
- celestialflow-3.3.2/src/celestialflow/observer/core_observer_print.py +98 -0
- {celestialflow-3.3.0/src/celestialflow/persistence → celestialflow-3.3.2/src/celestialflow/persist}/__init__.py +1 -11
- {celestialflow-3.3.0/src/celestialflow/persistence → celestialflow-3.3.2/src/celestialflow/persist}/core_lifecycle.py +86 -83
- celestialflow-3.3.2/src/celestialflow/persist/core_log.py +285 -0
- {celestialflow-3.3.0/src/celestialflow/persistence → celestialflow-3.3.2/src/celestialflow/persist}/util_payload.py +1 -1
- {celestialflow-3.3.0/src/celestialflow/persistence → celestialflow-3.3.2/src/celestialflow/persist}/util_sqlite.py +111 -35
- celestialflow-3.3.2/src/celestialflow/reporter/__init__.py +23 -0
- celestialflow-3.3.2/src/celestialflow/reporter/core_inject.py +77 -0
- celestialflow-3.3.2/src/celestialflow/reporter/core_push.py +251 -0
- celestialflow-3.3.2/src/celestialflow/reporter/core_snapshot.py +85 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/__init__.py +14 -16
- celestialflow-3.3.2/src/celestialflow/runtime/core_envelope.py +38 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/core_queue.py +238 -238
- celestialflow-3.3.2/src/celestialflow/runtime/util_config.py +100 -0
- celestialflow-3.3.2/src/celestialflow/runtime/util_types.py +177 -0
- celestialflow-3.3.2/src/celestialflow/ticker/__init__.py +18 -0
- celestialflow-3.3.2/src/celestialflow/ticker/core_event.py +30 -0
- celestialflow-3.3.2/src/celestialflow/ticker/core_handler.py +87 -0
- celestialflow-3.3.2/src/celestialflow/ticker/core_hub.py +99 -0
- celestialflow-3.3.2/src/celestialflow/ticker/core_ticker.py +204 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2/src/celestialflow.egg-info}/PKG-INFO +66 -69
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow.egg-info/SOURCES.txt +24 -16
- 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/observability/__init__.py +0 -15
- celestialflow-3.3.0/src/celestialflow/observability/core_observer.py +0 -112
- celestialflow-3.3.0/src/celestialflow/observability/core_report.py +0 -292
- celestialflow-3.3.0/src/celestialflow/observability/util_types.py +0 -37
- celestialflow-3.3.0/src/celestialflow/persistence/core_log.py +0 -517
- celestialflow-3.3.0/src/celestialflow/persistence/core_scope.py +0 -41
- celestialflow-3.3.0/src/celestialflow/runtime/core_envelope.py +0 -60
- celestialflow-3.3.0/src/celestialflow/runtime/core_metrics.py +0 -309
- celestialflow-3.3.0/src/celestialflow/runtime/util_config.py +0 -40
- 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/src/celestialflow/runtime/util_types.py +0 -181
- {celestialflow-3.3.0 → celestialflow-3.3.2}/LICENSE +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/setup.cfg +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/benchmark/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/funnel/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/funnel/core_inlet.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/funnel/util_count.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/graph/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/graph/core_structure.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/graph/util_order_graph.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/node/__init__.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/node/util_callable.py +0 -0
- {celestialflow-3.3.0/src/celestialflow/graph → celestialflow-3.3.2/src/celestialflow/persist}/util_render.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/util_constant.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/util_errors.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/util_event.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow/runtime/util_format.py +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.3.0 → celestialflow-3.3.2}/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.2
|
|
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,45 @@ flowchart TD
|
|
|
263
265
|
## 文件结构(File Structure)
|
|
264
266
|
|
|
265
267
|
```
|
|
266
|
-
📁 CelestialFlow (
|
|
267
|
-
📁 bench (
|
|
268
|
-
📁 [1项排除的目录] (
|
|
268
|
+
📁 CelestialFlow (539MB 107KB 283B)
|
|
269
|
+
📁 bench (316KB 409B)
|
|
270
|
+
📁 [1项排除的目录] (193KB 163B)
|
|
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 (10KB
|
|
273
|
-
🐍 bench_graph_mode.py (6KB
|
|
275
|
+
🐍 bench_gil_vs_nogil.py (10KB 552B)
|
|
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
|
|
277
|
-
🐍 bench_http_grpc.py (2KB
|
|
279
|
+
🐍 bench_hash_memory.py (3KB 655B)
|
|
280
|
+
🐍 bench_http_grpc.py (2KB 530B)
|
|
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 (7KB
|
|
282
|
-
🐍
|
|
284
|
+
🐍 bench_observer.py (7KB 58B)
|
|
285
|
+
🐍 bench_persist_spout.py (4KB 323B)
|
|
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
|
-
📁 [
|
|
289
|
-
🐍 demo_executor.py
|
|
290
|
-
🐍 demo_funnel.py
|
|
291
|
-
🐍 demo_graph.py
|
|
292
|
-
🐍 demo_network.py
|
|
293
|
-
🐍 demo_nodes.py
|
|
294
|
-
🐍 demo_observer.py
|
|
295
|
-
🐍 demo_redis.py
|
|
296
|
-
🐍
|
|
297
|
-
🐍
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
📁
|
|
290
|
+
📁 demo (604KB 612B)
|
|
291
|
+
📁 [3项排除的目录] (548KB 510B)
|
|
292
|
+
🐍 demo_executor.py (1KB 557B)
|
|
293
|
+
🐍 demo_funnel.py (2KB 289B)
|
|
294
|
+
🐍 demo_graph.py (2KB 975B)
|
|
295
|
+
🐍 demo_network.py (3KB 756B)
|
|
296
|
+
🐍 demo_nodes.py (3KB 915B)
|
|
297
|
+
🐍 demo_observer.py (2KB 1004B)
|
|
298
|
+
🐍 demo_redis.py (8KB 595B)
|
|
299
|
+
🐍 demo_skip_dedup.py (6KB 286B)
|
|
300
|
+
🐍 demo_structure.py (8KB 448B)
|
|
301
|
+
🐍 demo_utils.py (6KB 263B)
|
|
302
|
+
🐍 demo_web.py (9KB 158B)
|
|
303
|
+
📁 docs (2MB 40KB 774B)
|
|
304
|
+
📁 en[已折叠] (689KB 413B)
|
|
305
|
+
📁 ja[已折叠] (788KB 343B)
|
|
306
|
+
📁 zh-CN[已折叠] (611KB 18B)
|
|
302
307
|
📁 experiments (3KB 21B)
|
|
303
308
|
🐍 experiment_networkx.py (1KB 908B)
|
|
304
309
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -307,63 +312,55 @@ flowchart TD
|
|
|
307
312
|
📷 logo(old).png (836KB 542B)
|
|
308
313
|
📷 logo.png (122KB 747B)
|
|
309
314
|
📷 scc_condensation.svg (17KB 1B)
|
|
310
|
-
📁 src (1MB
|
|
311
|
-
📁 celestialflow[已折叠]
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
📁
|
|
315
|
-
📁
|
|
316
|
-
📁
|
|
317
|
-
📁
|
|
318
|
-
📁
|
|
319
|
-
📁
|
|
320
|
-
📁 [
|
|
321
|
-
|
|
322
|
-
|
|
315
|
+
📁 src (1MB 670KB 974B)
|
|
316
|
+
📁 celestialflow[已折叠] (1MB 651KB 430B)
|
|
317
|
+
📁 [1项排除的目录] (19KB 544B)
|
|
318
|
+
📁 tests (3MB 34KB 484B)
|
|
319
|
+
📁 assembly[已折叠] (38KB 341B)
|
|
320
|
+
📁 benchmark[已折叠] (41KB 377B)
|
|
321
|
+
📁 funnel[已折叠] (96KB 339B)
|
|
322
|
+
📁 graph[已折叠] (801KB 83B)
|
|
323
|
+
📁 node[已折叠] (512KB 601B)
|
|
324
|
+
📁 observer[已折叠] (121KB 111B)
|
|
325
|
+
📁 persist[已折叠] (207KB 907B)
|
|
326
|
+
📁 persistence[已折叠] (381KB 89B)
|
|
327
|
+
📁 reporter[已折叠] (171KB 861B)
|
|
328
|
+
📁 runtime[已折叠] (189KB 873B)
|
|
329
|
+
📁 ticker[已折叠] (54KB 761B)
|
|
330
|
+
📁 [1项排除的目录] (488KB 592B)
|
|
331
|
+
🐍 conftest.py (1KB 693B)
|
|
332
|
+
📁 [13项排除的目录] (525MB 488KB 753B)
|
|
323
333
|
❓ .env (468B)
|
|
324
334
|
❓ .gitignore (1KB 315B)
|
|
325
|
-
📝 AGENTS.md (1KB
|
|
335
|
+
📝 AGENTS.md (1KB 1003B)
|
|
326
336
|
❓ LICENSE (1KB 65B)
|
|
327
337
|
❓ Makefile (149B)
|
|
328
|
-
⚙️ pyproject.toml (2KB
|
|
329
|
-
📝 README.md (
|
|
330
|
-
🔒 uv.lock (
|
|
338
|
+
⚙️ pyproject.toml (2KB 858B)
|
|
339
|
+
📝 README.md (16KB 619B)
|
|
340
|
+
🔒 uv.lock (124KB 729B)
|
|
331
341
|
```
|
|
332
342
|
<p align="center">
|
|
333
|
-
<em>celestial-flow 3.3.
|
|
343
|
+
<em>celestial-flow 3.3.2</em>
|
|
334
344
|
</p>
|
|
335
345
|
|
|
336
346
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
337
347
|
|
|
338
348
|
## 版本日志(Version Log)
|
|
339
|
-
- 3.3.
|
|
349
|
+
- 3.3.2
|
|
340
350
|
- feat:
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
-
|
|
351
|
+
- [IMPORTANT] 大幅扩充 `observer` 机制, 添加更多钩子
|
|
352
|
+
- 添加 `ObserverHub` 进行管理, 其本身也是 `observer`
|
|
353
|
+
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
354
|
+
- 作为纯事件驱动的 `observer` 的补充
|
|
355
|
+
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
356
|
+
- 改为在 `.pyproject` 中进行设置
|
|
346
357
|
- refactor:
|
|
347
|
-
- [IMPORTANT]
|
|
348
|
-
-
|
|
349
|
-
|
|
350
|
-
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
- 同时输入参数直接使用 `list[str]` 形式的节点名称列表, 这意味着不再显示 `func_name` `execution_mode` 等信息
|
|
354
|
-
- 修改原本对于 `collect_runtime_snapshot` 奇怪的调用方式
|
|
355
|
-
- 现在reporter端会在 `_push_status` 中直接调用 `collect_runtime_snapshot`
|
|
356
|
-
- 删除 `TaskExecutor` 中的 `get_summary`, 这层包装实际上是多余的
|
|
357
|
-
- 同时所有的 `event_client.emit` 也不再附带 `summary` 信息
|
|
358
|
-
- 删除 `OrderGraph` 中的 `_node` 参数
|
|
359
|
-
- 之前这个参数提供: 所有节点名称; 节点的插入顺序
|
|
360
|
-
- 现在前者由 `_out` 提供, 后者不再重视
|
|
361
|
-
- `LifecycleInlet` 中的 `task_in` 改名为 `task_input`, 保持与 log 端一致
|
|
362
|
-
- fix:
|
|
363
|
-
- 修复 `execution_mode = async` 时, worker崩溃被忽略的问题
|
|
364
|
-
- 修复任务重试日志中 `retry_times` 的含义模糊, 现在使用 `fail_times`
|
|
365
|
-
- 修复 reporter 的 `_push_*` 方法中, 不处理返回值的问题
|
|
366
|
-
- 修复 `TaskReporter._pull_injection` 中, 对拉取的任务列表错误 `put_task` 的问题
|
|
358
|
+
- [IMPORTANT] 将 `log` / `lifecycle` 归并入新的 `observer` 体系
|
|
359
|
+
- 结构更加简洁高效
|
|
360
|
+
- [IMPORTANT] 将 `reporter` 拆为 完全分离的 `push` 与 `pull`
|
|
361
|
+
- 前者由 `PushInlet` 进行事件化收集 `error` `meta` 数据, 并由 `PushSnapshotHandler` 周期化收集状态信息
|
|
362
|
+
- 后者由 `InjectionHandler` 周期化从服务端收集注入任务与注入终止符
|
|
363
|
+
- 将 `metric` 机制归入 `observer` 体系
|
|
367
364
|
|
|
368
365
|
更多过往日志可看:
|
|
369
366
|
|
|
@@ -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,45 @@ flowchart TD
|
|
|
244
246
|
## 文件结构(File Structure)
|
|
245
247
|
|
|
246
248
|
```
|
|
247
|
-
📁 CelestialFlow (
|
|
248
|
-
📁 bench (
|
|
249
|
-
📁 [1项排除的目录] (
|
|
249
|
+
📁 CelestialFlow (539MB 107KB 283B)
|
|
250
|
+
📁 bench (316KB 409B)
|
|
251
|
+
📁 [1项排除的目录] (193KB 163B)
|
|
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 (10KB
|
|
254
|
-
🐍 bench_graph_mode.py (6KB
|
|
256
|
+
🐍 bench_gil_vs_nogil.py (10KB 552B)
|
|
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
|
|
258
|
-
🐍 bench_http_grpc.py (2KB
|
|
260
|
+
🐍 bench_hash_memory.py (3KB 655B)
|
|
261
|
+
🐍 bench_http_grpc.py (2KB 530B)
|
|
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 (7KB
|
|
263
|
-
🐍
|
|
265
|
+
🐍 bench_observer.py (7KB 58B)
|
|
266
|
+
🐍 bench_persist_spout.py (4KB 323B)
|
|
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
|
-
📁 [
|
|
270
|
-
🐍 demo_executor.py
|
|
271
|
-
🐍 demo_funnel.py
|
|
272
|
-
🐍 demo_graph.py
|
|
273
|
-
🐍 demo_network.py
|
|
274
|
-
🐍 demo_nodes.py
|
|
275
|
-
🐍 demo_observer.py
|
|
276
|
-
🐍 demo_redis.py
|
|
277
|
-
🐍
|
|
278
|
-
🐍
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
📁
|
|
271
|
+
📁 demo (604KB 612B)
|
|
272
|
+
📁 [3项排除的目录] (548KB 510B)
|
|
273
|
+
🐍 demo_executor.py (1KB 557B)
|
|
274
|
+
🐍 demo_funnel.py (2KB 289B)
|
|
275
|
+
🐍 demo_graph.py (2KB 975B)
|
|
276
|
+
🐍 demo_network.py (3KB 756B)
|
|
277
|
+
🐍 demo_nodes.py (3KB 915B)
|
|
278
|
+
🐍 demo_observer.py (2KB 1004B)
|
|
279
|
+
🐍 demo_redis.py (8KB 595B)
|
|
280
|
+
🐍 demo_skip_dedup.py (6KB 286B)
|
|
281
|
+
🐍 demo_structure.py (8KB 448B)
|
|
282
|
+
🐍 demo_utils.py (6KB 263B)
|
|
283
|
+
🐍 demo_web.py (9KB 158B)
|
|
284
|
+
📁 docs (2MB 40KB 774B)
|
|
285
|
+
📁 en[已折叠] (689KB 413B)
|
|
286
|
+
📁 ja[已折叠] (788KB 343B)
|
|
287
|
+
📁 zh-CN[已折叠] (611KB 18B)
|
|
283
288
|
📁 experiments (3KB 21B)
|
|
284
289
|
🐍 experiment_networkx.py (1KB 908B)
|
|
285
290
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -288,63 +293,55 @@ flowchart TD
|
|
|
288
293
|
📷 logo(old).png (836KB 542B)
|
|
289
294
|
📷 logo.png (122KB 747B)
|
|
290
295
|
📷 scc_condensation.svg (17KB 1B)
|
|
291
|
-
📁 src (1MB
|
|
292
|
-
📁 celestialflow[已折叠]
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
📁
|
|
296
|
-
📁
|
|
297
|
-
📁
|
|
298
|
-
📁
|
|
299
|
-
📁
|
|
300
|
-
📁
|
|
301
|
-
📁 [
|
|
302
|
-
|
|
303
|
-
|
|
296
|
+
📁 src (1MB 670KB 974B)
|
|
297
|
+
📁 celestialflow[已折叠] (1MB 651KB 430B)
|
|
298
|
+
📁 [1项排除的目录] (19KB 544B)
|
|
299
|
+
📁 tests (3MB 34KB 484B)
|
|
300
|
+
📁 assembly[已折叠] (38KB 341B)
|
|
301
|
+
📁 benchmark[已折叠] (41KB 377B)
|
|
302
|
+
📁 funnel[已折叠] (96KB 339B)
|
|
303
|
+
📁 graph[已折叠] (801KB 83B)
|
|
304
|
+
📁 node[已折叠] (512KB 601B)
|
|
305
|
+
📁 observer[已折叠] (121KB 111B)
|
|
306
|
+
📁 persist[已折叠] (207KB 907B)
|
|
307
|
+
📁 persistence[已折叠] (381KB 89B)
|
|
308
|
+
📁 reporter[已折叠] (171KB 861B)
|
|
309
|
+
📁 runtime[已折叠] (189KB 873B)
|
|
310
|
+
📁 ticker[已折叠] (54KB 761B)
|
|
311
|
+
📁 [1项排除的目录] (488KB 592B)
|
|
312
|
+
🐍 conftest.py (1KB 693B)
|
|
313
|
+
📁 [13项排除的目录] (525MB 488KB 753B)
|
|
304
314
|
❓ .env (468B)
|
|
305
315
|
❓ .gitignore (1KB 315B)
|
|
306
|
-
📝 AGENTS.md (1KB
|
|
316
|
+
📝 AGENTS.md (1KB 1003B)
|
|
307
317
|
❓ LICENSE (1KB 65B)
|
|
308
318
|
❓ Makefile (149B)
|
|
309
|
-
⚙️ pyproject.toml (2KB
|
|
310
|
-
📝 README.md (
|
|
311
|
-
🔒 uv.lock (
|
|
319
|
+
⚙️ pyproject.toml (2KB 858B)
|
|
320
|
+
📝 README.md (16KB 619B)
|
|
321
|
+
🔒 uv.lock (124KB 729B)
|
|
312
322
|
```
|
|
313
323
|
<p align="center">
|
|
314
|
-
<em>celestial-flow 3.3.
|
|
324
|
+
<em>celestial-flow 3.3.2</em>
|
|
315
325
|
</p>
|
|
316
326
|
|
|
317
327
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
318
328
|
|
|
319
329
|
## 版本日志(Version Log)
|
|
320
|
-
- 3.3.
|
|
330
|
+
- 3.3.2
|
|
321
331
|
- feat:
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
-
|
|
332
|
+
- [IMPORTANT] 大幅扩充 `observer` 机制, 添加更多钩子
|
|
333
|
+
- 添加 `ObserverHub` 进行管理, 其本身也是 `observer`
|
|
334
|
+
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
335
|
+
- 作为纯事件驱动的 `observer` 的补充
|
|
336
|
+
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
337
|
+
- 改为在 `.pyproject` 中进行设置
|
|
327
338
|
- refactor:
|
|
328
|
-
- [IMPORTANT]
|
|
329
|
-
-
|
|
330
|
-
|
|
331
|
-
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
- 同时输入参数直接使用 `list[str]` 形式的节点名称列表, 这意味着不再显示 `func_name` `execution_mode` 等信息
|
|
335
|
-
- 修改原本对于 `collect_runtime_snapshot` 奇怪的调用方式
|
|
336
|
-
- 现在reporter端会在 `_push_status` 中直接调用 `collect_runtime_snapshot`
|
|
337
|
-
- 删除 `TaskExecutor` 中的 `get_summary`, 这层包装实际上是多余的
|
|
338
|
-
- 同时所有的 `event_client.emit` 也不再附带 `summary` 信息
|
|
339
|
-
- 删除 `OrderGraph` 中的 `_node` 参数
|
|
340
|
-
- 之前这个参数提供: 所有节点名称; 节点的插入顺序
|
|
341
|
-
- 现在前者由 `_out` 提供, 后者不再重视
|
|
342
|
-
- `LifecycleInlet` 中的 `task_in` 改名为 `task_input`, 保持与 log 端一致
|
|
343
|
-
- fix:
|
|
344
|
-
- 修复 `execution_mode = async` 时, worker崩溃被忽略的问题
|
|
345
|
-
- 修复任务重试日志中 `retry_times` 的含义模糊, 现在使用 `fail_times`
|
|
346
|
-
- 修复 reporter 的 `_push_*` 方法中, 不处理返回值的问题
|
|
347
|
-
- 修复 `TaskReporter._pull_injection` 中, 对拉取的任务列表错误 `put_task` 的问题
|
|
339
|
+
- [IMPORTANT] 将 `log` / `lifecycle` 归并入新的 `observer` 体系
|
|
340
|
+
- 结构更加简洁高效
|
|
341
|
+
- [IMPORTANT] 将 `reporter` 拆为 完全分离的 `push` 与 `pull`
|
|
342
|
+
- 前者由 `PushInlet` 进行事件化收集 `error` `meta` 数据, 并由 `PushSnapshotHandler` 周期化收集状态信息
|
|
343
|
+
- 后者由 `InjectionHandler` 周期化从服务端收集注入任务与注入终止符
|
|
344
|
+
- 将 `metric` 机制归入 `observer` 体系
|
|
348
345
|
|
|
349
346
|
更多过往日志可看:
|
|
350
347
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "celestialflow"
|
|
7
|
-
version = "3.3.
|
|
7
|
+
version = "3.3.2"
|
|
8
8
|
description = "A flexible GRAPH-based task orchestration framework."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -61,6 +61,10 @@ dev = [
|
|
|
61
61
|
|
|
62
62
|
[tool.celestialflow]
|
|
63
63
|
log_level = "INFO"
|
|
64
|
+
# 是否启用上报;默认关闭,需显式开启(开启时 report_url 必填)
|
|
65
|
+
if_report = false
|
|
66
|
+
# 上报服务地址(CelestialFlow Web)
|
|
67
|
+
report_url = "http://127.0.0.1:5005"
|
|
64
68
|
|
|
65
69
|
[tool.pyright]
|
|
66
70
|
include = ["src"]
|
|
@@ -20,19 +20,21 @@ from .node import (
|
|
|
20
20
|
TaskRouter,
|
|
21
21
|
TaskSplitter,
|
|
22
22
|
)
|
|
23
|
-
from .
|
|
24
|
-
from .
|
|
23
|
+
from .observer import Observer, ObserverHub, PrintObserver
|
|
24
|
+
from .persist.util_sqlite import (
|
|
25
25
|
load_records,
|
|
26
|
-
|
|
26
|
+
load_tasks_grouped_by_node,
|
|
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
|
|
30
|
+
from .ticker import Ticker, TickEvent, TickHandler, TickHub
|
|
31
31
|
|
|
32
32
|
__all__ = [
|
|
33
33
|
"BaseInlet",
|
|
34
|
-
"BaseObserver",
|
|
35
34
|
"BaseSpout",
|
|
35
|
+
"Observer",
|
|
36
|
+
"ObserverHub",
|
|
37
|
+
"PrintObserver",
|
|
36
38
|
"TaskChain",
|
|
37
39
|
"TaskComplete",
|
|
38
40
|
"TaskCross",
|
|
@@ -40,15 +42,17 @@ __all__ = [
|
|
|
40
42
|
"TaskGraph",
|
|
41
43
|
"TaskGrid",
|
|
42
44
|
"TaskLoop",
|
|
43
|
-
"TaskReporter",
|
|
44
45
|
"TaskRouter",
|
|
45
46
|
"TaskSplitter",
|
|
46
47
|
"TaskWheel",
|
|
47
48
|
"TerminationSignal",
|
|
49
|
+
"TickEvent",
|
|
50
|
+
"TickHandler",
|
|
51
|
+
"TickHub",
|
|
52
|
+
"Ticker",
|
|
48
53
|
"benchmark_executor",
|
|
49
54
|
"benchmark_graph",
|
|
50
55
|
"format_table",
|
|
51
56
|
"load_records",
|
|
52
|
-
"
|
|
53
|
-
"make_hashable",
|
|
57
|
+
"load_tasks_grouped_by_node",
|
|
54
58
|
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# assembly/__init__.py
|
|
2
|
+
"""CelestialFlow 运行期资源装配模块。
|
|
3
|
+
|
|
4
|
+
负责把 lifecycle / log / 上报三类全局 funnel 观察者注册到运行期 hub,
|
|
5
|
+
并统一管理其 spout 的启停。
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .core_run import run_graph_resources, run_node_resources
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"run_graph_resources",
|
|
12
|
+
"run_node_resources",
|
|
13
|
+
]
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# assembly/core_run.py
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import uuid
|
|
5
|
+
from collections.abc import Generator
|
|
6
|
+
from contextlib import contextmanager
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import requests
|
|
10
|
+
|
|
11
|
+
from ..observer import MetricsObserver, ObserverHub
|
|
12
|
+
from ..persist.core_lifecycle import LifecycleInlet, LifecycleSpout
|
|
13
|
+
from ..persist.core_log import LogInlet, LogSpout
|
|
14
|
+
from ..reporter import (
|
|
15
|
+
InjectionHandler,
|
|
16
|
+
InjectionTarget,
|
|
17
|
+
PushInlet,
|
|
18
|
+
PushSnapshotHandler,
|
|
19
|
+
PushSpout,
|
|
20
|
+
)
|
|
21
|
+
from ..runtime.util_config import (
|
|
22
|
+
load_if_report_from_pyproject,
|
|
23
|
+
load_log_level_from_pyproject,
|
|
24
|
+
load_report_url_from_pyproject,
|
|
25
|
+
)
|
|
26
|
+
from ..ticker import Ticker, TickHub
|
|
27
|
+
|
|
28
|
+
_TICK_INTERVAL: float = 1.0
|
|
29
|
+
"""节拍器基准周期(秒)。各处理器以自己的 ``tick_period`` 缩放出实际周期。"""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@contextmanager
|
|
33
|
+
def run_graph_resources(
|
|
34
|
+
observers: ObserverHub,
|
|
35
|
+
injection_target: InjectionTarget,
|
|
36
|
+
) -> Generator[Path | None, None, None]:
|
|
37
|
+
"""
|
|
38
|
+
任务图运行期资源:``metrics`` + ``lifecycle`` + ``log``,并按 ``if_report``
|
|
39
|
+
决定是否追加远程上报与注入。
|
|
40
|
+
|
|
41
|
+
指标写模型由本入口创建并注册到 ``observers``,其只读视图交给 ``LogInlet``
|
|
42
|
+
与快照处理器。上报开关从项目级 ``pyproject.toml`` 的
|
|
43
|
+
``[tool.celestialflow]`` 节读取:仅当 ``if_report`` 显式配置为 ``true`` 时启用
|
|
44
|
+
上报,此时本入口自行生成一个不透明的上报会话标识,注册 :class:`PushInlet` 与
|
|
45
|
+
:class:`PushSnapshotHandler`、启动 :class:`PushSpout` 并启动一个以
|
|
46
|
+
:data:`_TICK_INTERVAL` 为基准周期的节拍器,按拍把状态快照推送到远端(并在图
|
|
47
|
+
结束时补推一次终态快照),同时按拍从远端拉取任务注入到 ``injection_target``
|
|
48
|
+
(``report_url`` 未配置时回退到
|
|
49
|
+
:data:`~celestialflow.runtime.util_config.DEFAULT_REPORT_URL`)。
|
|
50
|
+
|
|
51
|
+
退出时先停节拍器再统一停止 spout,保证运行期即使抛出异常也能完成回收。
|
|
52
|
+
|
|
53
|
+
:param observers: 任务图自身的观察者 hub
|
|
54
|
+
:param injection_target: 任务注入目标,通常是任务图自身
|
|
55
|
+
:return: 进入时产出 lifecycle 数据库路径,未就绪时为 ``None``
|
|
56
|
+
"""
|
|
57
|
+
log_level = load_log_level_from_pyproject()
|
|
58
|
+
|
|
59
|
+
metrics_view = MetricsObserver()
|
|
60
|
+
observers.add_observer(metrics_view)
|
|
61
|
+
|
|
62
|
+
lifecycle_spout = LifecycleSpout()
|
|
63
|
+
log_spout = LogSpout()
|
|
64
|
+
observers.add_observer(LifecycleInlet().bind_spout(lifecycle_spout))
|
|
65
|
+
observers.add_observer(LogInlet(metrics_view, log_level).bind_spout(log_spout))
|
|
66
|
+
|
|
67
|
+
push_spout: PushSpout | None = None
|
|
68
|
+
session: requests.Session | None = None
|
|
69
|
+
ticker: Ticker | None = None
|
|
70
|
+
if load_if_report_from_pyproject():
|
|
71
|
+
session_id = uuid.uuid4().hex
|
|
72
|
+
push_spout = PushSpout(session_id, load_report_url_from_pyproject())
|
|
73
|
+
push_inlet = PushInlet().bind_spout(push_spout)
|
|
74
|
+
|
|
75
|
+
session = requests.Session()
|
|
76
|
+
hub = TickHub()
|
|
77
|
+
snapshot_handler = PushSnapshotHandler(metrics_view, push_inlet)
|
|
78
|
+
hub.add_handler(snapshot_handler)
|
|
79
|
+
hub.add_handler(
|
|
80
|
+
InjectionHandler(
|
|
81
|
+
push_spout.base_url,
|
|
82
|
+
session_id,
|
|
83
|
+
injection_target,
|
|
84
|
+
session,
|
|
85
|
+
)
|
|
86
|
+
)
|
|
87
|
+
ticker = Ticker(_TICK_INTERVAL, hub, name="report")
|
|
88
|
+
|
|
89
|
+
# 快照处理器同时观察 on_graph_end 补推终态快照;注册在 PushInlet 之前,
|
|
90
|
+
# 保证终态快照先于 shutdown_session 入队。
|
|
91
|
+
observers.add_observer(snapshot_handler)
|
|
92
|
+
observers.add_observer(push_inlet)
|
|
93
|
+
|
|
94
|
+
try:
|
|
95
|
+
lifecycle_spout.start()
|
|
96
|
+
log_spout.start()
|
|
97
|
+
if push_spout is not None:
|
|
98
|
+
push_spout.start()
|
|
99
|
+
if ticker is not None:
|
|
100
|
+
ticker.start()
|
|
101
|
+
yield lifecycle_spout.db_path
|
|
102
|
+
finally:
|
|
103
|
+
if ticker is not None:
|
|
104
|
+
ticker.stop()
|
|
105
|
+
lifecycle_spout.stop()
|
|
106
|
+
log_spout.stop()
|
|
107
|
+
if push_spout is not None:
|
|
108
|
+
push_spout.stop()
|
|
109
|
+
if session is not None:
|
|
110
|
+
session.close()
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@contextmanager
|
|
114
|
+
def run_node_resources(
|
|
115
|
+
observers: ObserverHub,
|
|
116
|
+
) -> Generator[Path | None, None, None]:
|
|
117
|
+
"""
|
|
118
|
+
单节点运行期资源:内部创建并注册指标观察者,仅装配 ``lifecycle`` + ``log``。
|
|
119
|
+
|
|
120
|
+
独立运行的节点不产生图结构、也不参与图级上报,因此本入口既不接收会话标识,
|
|
121
|
+
也不装配推送通道、节拍器或注入目标;指标观察者由本入口创建并注册,运行结束后
|
|
122
|
+
无需外部持有。退出时统一停止 spout,保证运行期即使抛出异常也能完成回收。
|
|
123
|
+
|
|
124
|
+
:param observers: 节点自身的观察者 hub
|
|
125
|
+
:return: 进入时产出 lifecycle 数据库路径,未就绪时为 ``None``
|
|
126
|
+
"""
|
|
127
|
+
log_level = load_log_level_from_pyproject()
|
|
128
|
+
|
|
129
|
+
metrics_view = MetricsObserver()
|
|
130
|
+
observers.add_observer(metrics_view)
|
|
131
|
+
|
|
132
|
+
lifecycle_spout = LifecycleSpout()
|
|
133
|
+
log_spout = LogSpout()
|
|
134
|
+
observers.add_observer(LifecycleInlet().bind_spout(lifecycle_spout))
|
|
135
|
+
observers.add_observer(LogInlet(metrics_view, log_level).bind_spout(log_spout))
|
|
136
|
+
|
|
137
|
+
try:
|
|
138
|
+
lifecycle_spout.start()
|
|
139
|
+
log_spout.start()
|
|
140
|
+
yield lifecycle_spout.db_path
|
|
141
|
+
finally:
|
|
142
|
+
lifecycle_spout.stop()
|
|
143
|
+
log_spout.stop()
|
|
@@ -82,7 +82,7 @@ async def benchmark_graph(
|
|
|
82
82
|
execution_modes = execution_modes or ["serial", "thread", "async"]
|
|
83
83
|
|
|
84
84
|
base_tasks: dict[str, list[Any]] = {
|
|
85
|
-
|
|
85
|
+
node_name: list(tasks) for node_name, tasks in init_tasks_dict.items()
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
test_table_list: list[list[float]] = []
|
|
@@ -100,7 +100,7 @@ async def benchmark_graph(
|
|
|
100
100
|
cloned_graph.set_node_execution_mode(execution_mode)
|
|
101
101
|
|
|
102
102
|
run_tasks: dict[str, Iterable[Any]] = {
|
|
103
|
-
|
|
103
|
+
node_name: list(tasks) for node_name, tasks in base_tasks.items()
|
|
104
104
|
}
|
|
105
105
|
start_time = time.perf_counter()
|
|
106
106
|
if graph_mode == "async":
|