celestialflow 3.3.2__tar.gz → 3.3.4__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.2/src/celestialflow.egg-info → celestialflow-3.3.4}/PKG-INFO +66 -68
- {celestialflow-3.3.2 → celestialflow-3.3.4}/README.md +65 -67
- {celestialflow-3.3.2 → celestialflow-3.3.4}/pyproject.toml +1 -8
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/__init__.py +3 -5
- celestialflow-3.3.4/src/celestialflow/assembly/core_run.py +161 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/benchmark/util_benchmark.py +4 -4
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/funnel/core_inlet.py +2 -2
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/funnel/core_spout.py +5 -3
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/graph/core_graph.py +93 -60
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/core_dispatch.py +18 -17
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/core_node.py +56 -29
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/core_nodes.py +9 -9
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/observer/__init__.py +3 -3
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/observer/core_event.py +28 -25
- celestialflow-3.3.4/src/celestialflow/observer/core_hub.py +131 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/observer/core_metrics.py +59 -81
- celestialflow-3.3.4/src/celestialflow/observer/core_observer.py +50 -0
- celestialflow-3.3.4/src/celestialflow/observer/core_print.py +79 -0
- celestialflow-3.3.4/src/celestialflow/persist/__init__.py +39 -0
- celestialflow-3.3.4/src/celestialflow/persist/core_lifecycle.py +325 -0
- celestialflow-3.3.4/src/celestialflow/persist/core_log.py +268 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/persist/util_sqlite.py +0 -247
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/reporter/core_inject.py +2 -2
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/reporter/core_push.py +54 -52
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/reporter/core_snapshot.py +16 -9
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/__init__.py +3 -0
- celestialflow-3.3.4/src/celestialflow/runtime/core_config.py +57 -0
- celestialflow-3.3.4/src/celestialflow/runtime/util_log_level.py +38 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/util_types.py +2 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4/src/celestialflow.egg-info}/PKG-INFO +66 -68
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow.egg-info/SOURCES.txt +3 -2
- celestialflow-3.3.2/src/celestialflow/assembly/core_run.py +0 -143
- celestialflow-3.3.2/src/celestialflow/observer/core_hub.py +0 -276
- celestialflow-3.3.2/src/celestialflow/observer/core_observer.py +0 -139
- celestialflow-3.3.2/src/celestialflow/observer/core_observer_print.py +0 -98
- celestialflow-3.3.2/src/celestialflow/persist/__init__.py +0 -21
- celestialflow-3.3.2/src/celestialflow/persist/core_lifecycle.py +0 -213
- celestialflow-3.3.2/src/celestialflow/persist/core_log.py +0 -285
- celestialflow-3.3.2/src/celestialflow/runtime/util_config.py +0 -100
- {celestialflow-3.3.2 → celestialflow-3.3.4}/LICENSE +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/setup.cfg +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/assembly/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/benchmark/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/benchmark/util_clone.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/funnel/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/funnel/util_count.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/graph/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/graph/core_structure.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/graph/util_order_graph.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/util_callable.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/node/util_types.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/persist/util_payload.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/persist/util_render.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/reporter/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/core_envelope.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/core_queue.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/util_constant.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/util_errors.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/util_event.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/runtime/util_format.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/ticker/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/ticker/core_event.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/ticker/core_handler.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/ticker/core_hub.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow/ticker/core_ticker.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.4}/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.4
|
|
4
4
|
Summary: A flexible GRAPH-based task orchestration framework.
|
|
5
5
|
Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -19,7 +19,7 @@ Dynamic: license-file
|
|
|
19
19
|
|
|
20
20
|
# CelestialFlow ——一个轻量级、可并行、基于图结构的 Python 任务调度框架
|
|
21
21
|
|
|
22
|
-
> 📅 最后更新日期: 2026/
|
|
22
|
+
> 📅 最后更新日期: 2026/11/13
|
|
23
23
|
|
|
24
24
|
<p align="center">
|
|
25
25
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/logo.png" width="1080" alt="CelestialFlow Logo">
|
|
@@ -42,7 +42,7 @@ Dynamic: license-file
|
|
|
42
42
|
<a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/README.md">中文</a> | <a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/en/README.md">English</a> | <a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/ja/README.md">日本語</a>
|
|
43
43
|
</p>
|
|
44
44
|
|
|
45
|
-
**CelestialFlow**
|
|
45
|
+
**CelestialFlow** 是一个轻量级但功能完整、基于图结构的 Python 任务流框架,适合需要 **复杂依赖关系**、**灵活执行模型**、**跨设备运行** 与 **可观测执行链路** 的中/大型 Python 任务系统。
|
|
46
46
|
|
|
47
47
|
- 相比 Airflow/Dagster 更轻、更快开始
|
|
48
48
|
- 相比 multiprocessing/threading 更结构化,可直接表达 loop / complete graph 等复杂依赖模式
|
|
@@ -59,7 +59,7 @@ Dynamic: license-file
|
|
|
59
59
|
* **多线程(thread)**
|
|
60
60
|
* **协程(async)**
|
|
61
61
|
|
|
62
|
-
`TaskExecutor`
|
|
62
|
+
`TaskExecutor` 支持自定义跳过函数(可用作任务去重)、失败重试、队列上限与多执行模式切换,单独使用也很好用。
|
|
63
63
|
|
|
64
64
|
节点之间通过 **TaskGraph** 互相连接,形成具有上游与下游依赖关系的任务图。下游节点会自动接收上游执行完成的结果作为输入,从而形成明确的数据流。TaskGraph 同时提供 `TaskChain` / `TaskCross` / `TaskGrid` / `TaskLoop` / `TaskWheel` / `TaskComplete` 等预置拓扑结构,方便快速搭建常见依赖模式。
|
|
65
65
|
|
|
@@ -143,7 +143,8 @@ uv sync --group dev
|
|
|
143
143
|
from celestialflow import TaskExecutor, TaskGraph
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def add(
|
|
146
|
+
def add(task):
|
|
147
|
+
x, y = task
|
|
147
148
|
return x + y
|
|
148
149
|
|
|
149
150
|
|
|
@@ -186,11 +187,11 @@ if __name__ == "__main__":
|
|
|
186
187
|
- [BaseTaskNode.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/node/core_node.md)
|
|
187
188
|
- [TaskExecutor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/node/core_nodes.md)
|
|
188
189
|
- [TaskGraph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/graph/core_graph.md)
|
|
189
|
-
- [
|
|
190
|
+
- [MetricsObserver.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/observer/core_metrics.md)
|
|
190
191
|
- [TaskQueue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/core_queue.md)
|
|
191
|
-
- [
|
|
192
|
+
- [ReportConfig.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/core_config.md)
|
|
192
193
|
- [TaskStructure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/graph/core_structure.md)
|
|
193
|
-
- [
|
|
194
|
+
- [Observer.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/observer/core_observer.md)
|
|
194
195
|
- [Go Worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/other/go_worker.md)
|
|
195
196
|
|
|
196
197
|
推荐阅读顺序:
|
|
@@ -203,11 +204,11 @@ flowchart TD
|
|
|
203
204
|
classDef execution fill:#f3e8ff,stroke:#a855f7,color:#581c87;
|
|
204
205
|
|
|
205
206
|
BTN[BaseTaskNode.md] --> TE[TaskExecutor.md] --> TG[TaskGraph.md]
|
|
206
|
-
TE --> OB[
|
|
207
|
-
TE --> TME[
|
|
207
|
+
TE --> OB[Observer.md]
|
|
208
|
+
TE --> TME[MetricsObserver.md]
|
|
208
209
|
|
|
209
210
|
TG --> TQ[TaskQueue.md]
|
|
210
|
-
TG -->
|
|
211
|
+
TG --> TRC[ReportConfig.md]
|
|
211
212
|
TG --> TSR[TaskStructure.md]
|
|
212
213
|
|
|
213
214
|
TG --> GW[Go Worker.md]
|
|
@@ -216,16 +217,19 @@ flowchart TD
|
|
|
216
217
|
class TME runtime;
|
|
217
218
|
class TSR structure;
|
|
218
219
|
class TQ,GW execution;
|
|
219
|
-
class
|
|
220
|
+
class TRC execution;
|
|
220
221
|
```
|
|
221
222
|
|
|
222
|
-
|
|
223
|
+
以下八篇可以作为补充阅读:
|
|
223
224
|
|
|
224
|
-
- [UtilHash.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_hash.md)
|
|
225
225
|
- [UtilTypes.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_types.md)
|
|
226
226
|
- [UtilErrors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_errors.md)
|
|
227
|
-
- [
|
|
228
|
-
- [
|
|
227
|
+
- [UtilFormat.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_format.md)
|
|
228
|
+
- [Lifecycle.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/persist/core_lifecycle.md)
|
|
229
|
+
- [Log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/persist/core_log.md)
|
|
230
|
+
- [Ticker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/ticker/core_ticker.md)
|
|
231
|
+
- [Reporter.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/reporter/core_push.md)
|
|
232
|
+
- [Assembly.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/assembly/core_run.md)
|
|
229
233
|
|
|
230
234
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇利用 TaskGraph 从零开始构建项目的教程:
|
|
231
235
|
|
|
@@ -265,12 +269,12 @@ flowchart TD
|
|
|
265
269
|
## 文件结构(File Structure)
|
|
266
270
|
|
|
267
271
|
```
|
|
268
|
-
📁 CelestialFlow (
|
|
269
|
-
📁 bench (
|
|
270
|
-
📁 [1项排除的目录] (
|
|
272
|
+
📁 CelestialFlow (594MB 775KB 69B)
|
|
273
|
+
📁 bench (356KB 464B)
|
|
274
|
+
📁 [1项排除的目录] (233KB 797B)
|
|
271
275
|
🐍 bench_datastructures.py (6KB 690B)
|
|
272
276
|
🐍 bench_execution_mode.py (2KB 707B)
|
|
273
|
-
🐍 bench_funnel_vs_lock.py (21KB
|
|
277
|
+
🐍 bench_funnel_vs_lock.py (21KB 885B)
|
|
274
278
|
🐍 bench_futures_memory.py (2KB 269B)
|
|
275
279
|
🐍 bench_gil_vs_nogil.py (10KB 552B)
|
|
276
280
|
🐍 bench_graph_mode.py (6KB 614B)
|
|
@@ -281,29 +285,29 @@ flowchart TD
|
|
|
281
285
|
🐍 bench_ipc_queue.py (7KB 104B)
|
|
282
286
|
🐍 bench_lock_overhead.py (9KB 421B)
|
|
283
287
|
🐍 bench_mpqueue_vs_shared_memory.py (13KB 127B)
|
|
284
|
-
🐍 bench_observer.py (
|
|
285
|
-
🐍 bench_persist_spout.py (4KB
|
|
288
|
+
🐍 bench_observer.py (6KB 657B)
|
|
289
|
+
🐍 bench_persist_spout.py (4KB 172B)
|
|
286
290
|
🐍 bench_queue.py (5KB 857B)
|
|
287
291
|
🐍 bench_requests.py (6KB 813B)
|
|
288
292
|
🐍 bench_tqdm.py (1KB 235B)
|
|
289
293
|
🐍 bench_utils.py (543B)
|
|
290
|
-
📁 demo (
|
|
291
|
-
📁 [
|
|
294
|
+
📁 demo (809KB 719B)
|
|
295
|
+
📁 [4项排除的目录] (754KB 603B)
|
|
292
296
|
🐍 demo_executor.py (1KB 557B)
|
|
293
|
-
🐍 demo_funnel.py (2KB
|
|
297
|
+
🐍 demo_funnel.py (2KB 286B)
|
|
294
298
|
🐍 demo_graph.py (2KB 975B)
|
|
295
299
|
🐍 demo_network.py (3KB 756B)
|
|
296
300
|
🐍 demo_nodes.py (3KB 915B)
|
|
297
|
-
🐍 demo_observer.py (2KB
|
|
301
|
+
🐍 demo_observer.py (2KB 445B)
|
|
298
302
|
🐍 demo_redis.py (8KB 595B)
|
|
299
303
|
🐍 demo_skip_dedup.py (6KB 286B)
|
|
300
304
|
🐍 demo_structure.py (8KB 448B)
|
|
301
305
|
🐍 demo_utils.py (6KB 263B)
|
|
302
|
-
🐍 demo_web.py (
|
|
303
|
-
📁 docs (2MB
|
|
304
|
-
📁 en[已折叠] (
|
|
305
|
-
📁 ja[已折叠] (
|
|
306
|
-
📁 zh-CN[已折叠] (
|
|
306
|
+
🐍 demo_web.py (8KB 734B)
|
|
307
|
+
📁 docs (2MB 424KB 355B)
|
|
308
|
+
📁 en[已折叠] (759KB 226B)
|
|
309
|
+
📁 ja[已折叠] (874KB 132B)
|
|
310
|
+
📁 zh-CN[已折叠] (838KB 1021B)
|
|
307
311
|
📁 experiments (3KB 21B)
|
|
308
312
|
🐍 experiment_networkx.py (1KB 908B)
|
|
309
313
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -312,55 +316,49 @@ flowchart TD
|
|
|
312
316
|
📷 logo(old).png (836KB 542B)
|
|
313
317
|
📷 logo.png (122KB 747B)
|
|
314
318
|
📷 scc_condensation.svg (17KB 1B)
|
|
315
|
-
📁 src (1MB
|
|
316
|
-
📁 celestialflow[已折叠] (1MB
|
|
317
|
-
📁 [1项排除的目录] (19KB
|
|
318
|
-
📁 tests (3MB
|
|
319
|
-
📁 assembly[已折叠] (
|
|
320
|
-
📁 benchmark[已折叠] (
|
|
321
|
-
📁 funnel[已折叠] (
|
|
322
|
-
📁 graph[已折叠] (
|
|
323
|
-
📁 node[已折叠] (
|
|
324
|
-
📁 observer[已折叠] (
|
|
325
|
-
📁 persist[已折叠] (
|
|
326
|
-
📁
|
|
327
|
-
📁
|
|
328
|
-
📁
|
|
329
|
-
📁
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
❓ .env (468B)
|
|
319
|
+
📁 src (1MB 660KB 11B)
|
|
320
|
+
📁 celestialflow[已折叠] (1MB 640KB 713B)
|
|
321
|
+
📁 [1项排除的目录] (19KB 322B)
|
|
322
|
+
📁 tests (3MB 662KB 157B)
|
|
323
|
+
📁 assembly[已折叠] (76KB 371B)
|
|
324
|
+
📁 benchmark[已折叠] (75KB 37B)
|
|
325
|
+
📁 funnel[已折叠] (119KB 944B)
|
|
326
|
+
📁 graph[已折叠] (1MB 22KB 263B)
|
|
327
|
+
📁 node[已折叠] (704KB 568B)
|
|
328
|
+
📁 observer[已折叠] (229KB 814B)
|
|
329
|
+
📁 persist[已折叠] (269KB 262B)
|
|
330
|
+
📁 reporter[已折叠] (248KB 570B)
|
|
331
|
+
📁 runtime[已折叠] (327KB 569B)
|
|
332
|
+
📁 ticker[已折叠] (98KB 313B)
|
|
333
|
+
📁 [3项排除的目录] (536KB 268B)
|
|
334
|
+
🐍 conftest.py (2KB 298B)
|
|
335
|
+
📁 [12项排除的目录] (579MB 932KB 150B)
|
|
336
|
+
❓ .env (484B)
|
|
334
337
|
❓ .gitignore (1KB 315B)
|
|
335
|
-
📝 AGENTS.md (
|
|
338
|
+
📝 AGENTS.md (2KB 800B)
|
|
336
339
|
❓ LICENSE (1KB 65B)
|
|
337
340
|
❓ Makefile (149B)
|
|
338
|
-
⚙️ pyproject.toml (2KB
|
|
339
|
-
📝 README.md (16KB
|
|
340
|
-
🔒 uv.lock (
|
|
341
|
+
⚙️ pyproject.toml (2KB 624B)
|
|
342
|
+
📝 README.md (16KB 802B)
|
|
343
|
+
🔒 uv.lock (126KB 855B)
|
|
341
344
|
```
|
|
342
345
|
<p align="center">
|
|
343
|
-
<em>celestial-flow 3.3.
|
|
346
|
+
<em>celestial-flow 3.3.4</em>
|
|
344
347
|
</p>
|
|
345
348
|
|
|
346
349
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
347
350
|
|
|
348
351
|
## 版本日志(Version Log)
|
|
349
|
-
- 3.3.
|
|
352
|
+
- 3.3.4
|
|
350
353
|
- feat:
|
|
351
|
-
-
|
|
352
|
-
- 添加 `ObserverHub` 进行管理, 其本身也是 `observer`
|
|
353
|
-
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
354
|
-
- 作为纯事件驱动的 `observer` 的补充
|
|
355
|
-
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
356
|
-
- 改为在 `.pyproject` 中进行设置
|
|
354
|
+
- 在 `ObserverHub` 中添加 `find` 方法, 用于查找指定类型的observer
|
|
357
355
|
- refactor:
|
|
358
|
-
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
-
|
|
356
|
+
- 将observer中各个事件处理方法归于 `on_event`
|
|
357
|
+
- 将 `log` 与 `lifecycle` 中混乱的 `observer/inlet` 拆开
|
|
358
|
+
- 现在建立单独的 `*Observer` 来统筹 `spout/inlet`
|
|
359
|
+
- 在 `lifecycle` 中用明确的dataclass取代 `dict[str, Any]`
|
|
360
|
+
- `graph` 与 `node` 中不再存储 `_lifecycle_db_path`
|
|
361
|
+
- 归一化 `graph.run` 与 `graph.inject_tasks` 的输入参数类型
|
|
364
362
|
|
|
365
363
|
更多过往日志可看:
|
|
366
364
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CelestialFlow ——一个轻量级、可并行、基于图结构的 Python 任务调度框架
|
|
2
2
|
|
|
3
|
-
> 📅 最后更新日期: 2026/
|
|
3
|
+
> 📅 最后更新日期: 2026/11/13
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/logo.png" width="1080" alt="CelestialFlow Logo">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/README.md">中文</a> | <a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/en/README.md">English</a> | <a href="https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/ja/README.md">日本語</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
**CelestialFlow**
|
|
26
|
+
**CelestialFlow** 是一个轻量级但功能完整、基于图结构的 Python 任务流框架,适合需要 **复杂依赖关系**、**灵活执行模型**、**跨设备运行** 与 **可观测执行链路** 的中/大型 Python 任务系统。
|
|
27
27
|
|
|
28
28
|
- 相比 Airflow/Dagster 更轻、更快开始
|
|
29
29
|
- 相比 multiprocessing/threading 更结构化,可直接表达 loop / complete graph 等复杂依赖模式
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* **多线程(thread)**
|
|
41
41
|
* **协程(async)**
|
|
42
42
|
|
|
43
|
-
`TaskExecutor`
|
|
43
|
+
`TaskExecutor` 支持自定义跳过函数(可用作任务去重)、失败重试、队列上限与多执行模式切换,单独使用也很好用。
|
|
44
44
|
|
|
45
45
|
节点之间通过 **TaskGraph** 互相连接,形成具有上游与下游依赖关系的任务图。下游节点会自动接收上游执行完成的结果作为输入,从而形成明确的数据流。TaskGraph 同时提供 `TaskChain` / `TaskCross` / `TaskGrid` / `TaskLoop` / `TaskWheel` / `TaskComplete` 等预置拓扑结构,方便快速搭建常见依赖模式。
|
|
46
46
|
|
|
@@ -124,7 +124,8 @@ uv sync --group dev
|
|
|
124
124
|
from celestialflow import TaskExecutor, TaskGraph
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
def add(
|
|
127
|
+
def add(task):
|
|
128
|
+
x, y = task
|
|
128
129
|
return x + y
|
|
129
130
|
|
|
130
131
|
|
|
@@ -167,11 +168,11 @@ if __name__ == "__main__":
|
|
|
167
168
|
- [BaseTaskNode.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/node/core_node.md)
|
|
168
169
|
- [TaskExecutor.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/node/core_nodes.md)
|
|
169
170
|
- [TaskGraph.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/graph/core_graph.md)
|
|
170
|
-
- [
|
|
171
|
+
- [MetricsObserver.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/observer/core_metrics.md)
|
|
171
172
|
- [TaskQueue.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/core_queue.md)
|
|
172
|
-
- [
|
|
173
|
+
- [ReportConfig.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/core_config.md)
|
|
173
174
|
- [TaskStructure.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/graph/core_structure.md)
|
|
174
|
-
- [
|
|
175
|
+
- [Observer.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/observer/core_observer.md)
|
|
175
176
|
- [Go Worker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/other/go_worker.md)
|
|
176
177
|
|
|
177
178
|
推荐阅读顺序:
|
|
@@ -184,11 +185,11 @@ flowchart TD
|
|
|
184
185
|
classDef execution fill:#f3e8ff,stroke:#a855f7,color:#581c87;
|
|
185
186
|
|
|
186
187
|
BTN[BaseTaskNode.md] --> TE[TaskExecutor.md] --> TG[TaskGraph.md]
|
|
187
|
-
TE --> OB[
|
|
188
|
-
TE --> TME[
|
|
188
|
+
TE --> OB[Observer.md]
|
|
189
|
+
TE --> TME[MetricsObserver.md]
|
|
189
190
|
|
|
190
191
|
TG --> TQ[TaskQueue.md]
|
|
191
|
-
TG -->
|
|
192
|
+
TG --> TRC[ReportConfig.md]
|
|
192
193
|
TG --> TSR[TaskStructure.md]
|
|
193
194
|
|
|
194
195
|
TG --> GW[Go Worker.md]
|
|
@@ -197,16 +198,19 @@ flowchart TD
|
|
|
197
198
|
class TME runtime;
|
|
198
199
|
class TSR structure;
|
|
199
200
|
class TQ,GW execution;
|
|
200
|
-
class
|
|
201
|
+
class TRC execution;
|
|
201
202
|
```
|
|
202
203
|
|
|
203
|
-
|
|
204
|
+
以下八篇可以作为补充阅读:
|
|
204
205
|
|
|
205
|
-
- [UtilHash.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_hash.md)
|
|
206
206
|
- [UtilTypes.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_types.md)
|
|
207
207
|
- [UtilErrors.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_errors.md)
|
|
208
|
-
- [
|
|
209
|
-
- [
|
|
208
|
+
- [UtilFormat.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/runtime/util_format.md)
|
|
209
|
+
- [Lifecycle.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/persist/core_lifecycle.md)
|
|
210
|
+
- [Log.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/persist/core_log.md)
|
|
211
|
+
- [Ticker.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/ticker/core_ticker.md)
|
|
212
|
+
- [Reporter.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/reporter/core_push.md)
|
|
213
|
+
- [Assembly.md](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/zh-CN/src/assembly/core_run.md)
|
|
210
214
|
|
|
211
215
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇利用 TaskGraph 从零开始构建项目的教程:
|
|
212
216
|
|
|
@@ -246,12 +250,12 @@ flowchart TD
|
|
|
246
250
|
## 文件结构(File Structure)
|
|
247
251
|
|
|
248
252
|
```
|
|
249
|
-
📁 CelestialFlow (
|
|
250
|
-
📁 bench (
|
|
251
|
-
📁 [1项排除的目录] (
|
|
253
|
+
📁 CelestialFlow (594MB 775KB 69B)
|
|
254
|
+
📁 bench (356KB 464B)
|
|
255
|
+
📁 [1项排除的目录] (233KB 797B)
|
|
252
256
|
🐍 bench_datastructures.py (6KB 690B)
|
|
253
257
|
🐍 bench_execution_mode.py (2KB 707B)
|
|
254
|
-
🐍 bench_funnel_vs_lock.py (21KB
|
|
258
|
+
🐍 bench_funnel_vs_lock.py (21KB 885B)
|
|
255
259
|
🐍 bench_futures_memory.py (2KB 269B)
|
|
256
260
|
🐍 bench_gil_vs_nogil.py (10KB 552B)
|
|
257
261
|
🐍 bench_graph_mode.py (6KB 614B)
|
|
@@ -262,29 +266,29 @@ flowchart TD
|
|
|
262
266
|
🐍 bench_ipc_queue.py (7KB 104B)
|
|
263
267
|
🐍 bench_lock_overhead.py (9KB 421B)
|
|
264
268
|
🐍 bench_mpqueue_vs_shared_memory.py (13KB 127B)
|
|
265
|
-
🐍 bench_observer.py (
|
|
266
|
-
🐍 bench_persist_spout.py (4KB
|
|
269
|
+
🐍 bench_observer.py (6KB 657B)
|
|
270
|
+
🐍 bench_persist_spout.py (4KB 172B)
|
|
267
271
|
🐍 bench_queue.py (5KB 857B)
|
|
268
272
|
🐍 bench_requests.py (6KB 813B)
|
|
269
273
|
🐍 bench_tqdm.py (1KB 235B)
|
|
270
274
|
🐍 bench_utils.py (543B)
|
|
271
|
-
📁 demo (
|
|
272
|
-
📁 [
|
|
275
|
+
📁 demo (809KB 719B)
|
|
276
|
+
📁 [4项排除的目录] (754KB 603B)
|
|
273
277
|
🐍 demo_executor.py (1KB 557B)
|
|
274
|
-
🐍 demo_funnel.py (2KB
|
|
278
|
+
🐍 demo_funnel.py (2KB 286B)
|
|
275
279
|
🐍 demo_graph.py (2KB 975B)
|
|
276
280
|
🐍 demo_network.py (3KB 756B)
|
|
277
281
|
🐍 demo_nodes.py (3KB 915B)
|
|
278
|
-
🐍 demo_observer.py (2KB
|
|
282
|
+
🐍 demo_observer.py (2KB 445B)
|
|
279
283
|
🐍 demo_redis.py (8KB 595B)
|
|
280
284
|
🐍 demo_skip_dedup.py (6KB 286B)
|
|
281
285
|
🐍 demo_structure.py (8KB 448B)
|
|
282
286
|
🐍 demo_utils.py (6KB 263B)
|
|
283
|
-
🐍 demo_web.py (
|
|
284
|
-
📁 docs (2MB
|
|
285
|
-
📁 en[已折叠] (
|
|
286
|
-
📁 ja[已折叠] (
|
|
287
|
-
📁 zh-CN[已折叠] (
|
|
287
|
+
🐍 demo_web.py (8KB 734B)
|
|
288
|
+
📁 docs (2MB 424KB 355B)
|
|
289
|
+
📁 en[已折叠] (759KB 226B)
|
|
290
|
+
📁 ja[已折叠] (874KB 132B)
|
|
291
|
+
📁 zh-CN[已折叠] (838KB 1021B)
|
|
288
292
|
📁 experiments (3KB 21B)
|
|
289
293
|
🐍 experiment_networkx.py (1KB 908B)
|
|
290
294
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -293,55 +297,49 @@ flowchart TD
|
|
|
293
297
|
📷 logo(old).png (836KB 542B)
|
|
294
298
|
📷 logo.png (122KB 747B)
|
|
295
299
|
📷 scc_condensation.svg (17KB 1B)
|
|
296
|
-
📁 src (1MB
|
|
297
|
-
📁 celestialflow[已折叠] (1MB
|
|
298
|
-
📁 [1项排除的目录] (19KB
|
|
299
|
-
📁 tests (3MB
|
|
300
|
-
📁 assembly[已折叠] (
|
|
301
|
-
📁 benchmark[已折叠] (
|
|
302
|
-
📁 funnel[已折叠] (
|
|
303
|
-
📁 graph[已折叠] (
|
|
304
|
-
📁 node[已折叠] (
|
|
305
|
-
📁 observer[已折叠] (
|
|
306
|
-
📁 persist[已折叠] (
|
|
307
|
-
📁
|
|
308
|
-
📁
|
|
309
|
-
📁
|
|
310
|
-
📁
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
❓ .env (468B)
|
|
300
|
+
📁 src (1MB 660KB 11B)
|
|
301
|
+
📁 celestialflow[已折叠] (1MB 640KB 713B)
|
|
302
|
+
📁 [1项排除的目录] (19KB 322B)
|
|
303
|
+
📁 tests (3MB 662KB 157B)
|
|
304
|
+
📁 assembly[已折叠] (76KB 371B)
|
|
305
|
+
📁 benchmark[已折叠] (75KB 37B)
|
|
306
|
+
📁 funnel[已折叠] (119KB 944B)
|
|
307
|
+
📁 graph[已折叠] (1MB 22KB 263B)
|
|
308
|
+
📁 node[已折叠] (704KB 568B)
|
|
309
|
+
📁 observer[已折叠] (229KB 814B)
|
|
310
|
+
📁 persist[已折叠] (269KB 262B)
|
|
311
|
+
📁 reporter[已折叠] (248KB 570B)
|
|
312
|
+
📁 runtime[已折叠] (327KB 569B)
|
|
313
|
+
📁 ticker[已折叠] (98KB 313B)
|
|
314
|
+
📁 [3项排除的目录] (536KB 268B)
|
|
315
|
+
🐍 conftest.py (2KB 298B)
|
|
316
|
+
📁 [12项排除的目录] (579MB 932KB 150B)
|
|
317
|
+
❓ .env (484B)
|
|
315
318
|
❓ .gitignore (1KB 315B)
|
|
316
|
-
📝 AGENTS.md (
|
|
319
|
+
📝 AGENTS.md (2KB 800B)
|
|
317
320
|
❓ LICENSE (1KB 65B)
|
|
318
321
|
❓ Makefile (149B)
|
|
319
|
-
⚙️ pyproject.toml (2KB
|
|
320
|
-
📝 README.md (16KB
|
|
321
|
-
🔒 uv.lock (
|
|
322
|
+
⚙️ pyproject.toml (2KB 624B)
|
|
323
|
+
📝 README.md (16KB 802B)
|
|
324
|
+
🔒 uv.lock (126KB 855B)
|
|
322
325
|
```
|
|
323
326
|
<p align="center">
|
|
324
|
-
<em>celestial-flow 3.3.
|
|
327
|
+
<em>celestial-flow 3.3.4</em>
|
|
325
328
|
</p>
|
|
326
329
|
|
|
327
330
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
328
331
|
|
|
329
332
|
## 版本日志(Version Log)
|
|
330
|
-
- 3.3.
|
|
333
|
+
- 3.3.4
|
|
331
334
|
- feat:
|
|
332
|
-
-
|
|
333
|
-
- 添加 `ObserverHub` 进行管理, 其本身也是 `observer`
|
|
334
|
-
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
335
|
-
- 作为纯事件驱动的 `observer` 的补充
|
|
336
|
-
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
337
|
-
- 改为在 `.pyproject` 中进行设置
|
|
335
|
+
- 在 `ObserverHub` 中添加 `find` 方法, 用于查找指定类型的observer
|
|
338
336
|
- refactor:
|
|
339
|
-
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
-
|
|
337
|
+
- 将observer中各个事件处理方法归于 `on_event`
|
|
338
|
+
- 将 `log` 与 `lifecycle` 中混乱的 `observer/inlet` 拆开
|
|
339
|
+
- 现在建立单独的 `*Observer` 来统筹 `spout/inlet`
|
|
340
|
+
- 在 `lifecycle` 中用明确的dataclass取代 `dict[str, Any]`
|
|
341
|
+
- `graph` 与 `node` 中不再存储 `_lifecycle_db_path`
|
|
342
|
+
- 归一化 `graph.run` 与 `graph.inject_tasks` 的输入参数类型
|
|
345
343
|
|
|
346
344
|
更多过往日志可看:
|
|
347
345
|
|
|
@@ -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.4"
|
|
8
8
|
description = "A flexible GRAPH-based task orchestration framework."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -59,13 +59,6 @@ dev = [
|
|
|
59
59
|
"tqdm",
|
|
60
60
|
]
|
|
61
61
|
|
|
62
|
-
[tool.celestialflow]
|
|
63
|
-
log_level = "INFO"
|
|
64
|
-
# 是否启用上报;默认关闭,需显式开启(开启时 report_url 必填)
|
|
65
|
-
if_report = false
|
|
66
|
-
# 上报服务地址(CelestialFlow Web)
|
|
67
|
-
report_url = "http://127.0.0.1:5005"
|
|
68
|
-
|
|
69
62
|
[tool.pyright]
|
|
70
63
|
include = ["src"]
|
|
71
64
|
ignore = ["tests", "**/tests/**", "typings", "demo", "bench", "experiments", "examples", "temp"]
|
|
@@ -21,10 +21,8 @@ from .node import (
|
|
|
21
21
|
TaskSplitter,
|
|
22
22
|
)
|
|
23
23
|
from .observer import Observer, ObserverHub, PrintObserver
|
|
24
|
-
from .persist.util_sqlite import
|
|
25
|
-
|
|
26
|
-
load_tasks_grouped_by_node,
|
|
27
|
-
)
|
|
24
|
+
from .persist.util_sqlite import load_tasks_grouped_by_node
|
|
25
|
+
from .runtime import ReportConfig
|
|
28
26
|
from .runtime.util_format import format_table
|
|
29
27
|
from .runtime.util_types import TerminationSignal
|
|
30
28
|
from .ticker import Ticker, TickEvent, TickHandler, TickHub
|
|
@@ -35,6 +33,7 @@ __all__ = [
|
|
|
35
33
|
"Observer",
|
|
36
34
|
"ObserverHub",
|
|
37
35
|
"PrintObserver",
|
|
36
|
+
"ReportConfig",
|
|
38
37
|
"TaskChain",
|
|
39
38
|
"TaskComplete",
|
|
40
39
|
"TaskCross",
|
|
@@ -53,6 +52,5 @@ __all__ = [
|
|
|
53
52
|
"benchmark_executor",
|
|
54
53
|
"benchmark_graph",
|
|
55
54
|
"format_table",
|
|
56
|
-
"load_records",
|
|
57
55
|
"load_tasks_grouped_by_node",
|
|
58
56
|
]
|