celestialflow 3.3.2__tar.gz → 3.3.3__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.3}/PKG-INFO +51 -55
- {celestialflow-3.3.2 → celestialflow-3.3.3}/README.md +50 -54
- {celestialflow-3.3.2 → celestialflow-3.3.3}/pyproject.toml +1 -8
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/__init__.py +3 -5
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/assembly/core_run.py +147 -143
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/benchmark/util_benchmark.py +2 -2
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/graph/core_graph.py +78 -32
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/core_dispatch.py +17 -16
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/core_node.py +21 -4
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/__init__.py +0 -2
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/core_event.py +6 -14
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/core_hub.py +0 -16
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/core_metrics.py +6 -2
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/core_observer.py +0 -9
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/core_lifecycle.py +2 -2
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/core_log.py +11 -22
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/util_sqlite.py +0 -247
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/reporter/core_push.py +13 -5
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/reporter/core_snapshot.py +1 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/__init__.py +3 -0
- celestialflow-3.3.3/src/celestialflow/runtime/core_config.py +57 -0
- celestialflow-3.3.3/src/celestialflow/runtime/util_log_level.py +38 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/util_types.py +2 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3/src/celestialflow.egg-info}/PKG-INFO +51 -55
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow.egg-info/SOURCES.txt +2 -1
- celestialflow-3.3.2/src/celestialflow/runtime/util_config.py +0 -100
- {celestialflow-3.3.2 → celestialflow-3.3.3}/LICENSE +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/setup.cfg +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/assembly/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/benchmark/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/benchmark/util_clone.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/funnel/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/funnel/core_inlet.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/funnel/core_spout.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/funnel/util_count.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/graph/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/graph/core_structure.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/graph/util_order_graph.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/core_nodes.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/util_callable.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/node/util_types.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/observer/core_observer_print.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/util_payload.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/persist/util_render.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/reporter/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/reporter/core_inject.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/core_envelope.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/core_queue.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/util_constant.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/util_errors.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/util_event.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/runtime/util_format.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/ticker/__init__.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/ticker/core_event.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/ticker/core_handler.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/ticker/core_hub.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow/ticker/core_ticker.py +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.3.2 → celestialflow-3.3.3}/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.3
|
|
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/10/30
|
|
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,16 @@ 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)
|
|
229
230
|
|
|
230
231
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇利用 TaskGraph 从零开始构建项目的教程:
|
|
231
232
|
|
|
@@ -265,7 +266,7 @@ flowchart TD
|
|
|
265
266
|
## 文件结构(File Structure)
|
|
266
267
|
|
|
267
268
|
```
|
|
268
|
-
📁 CelestialFlow (
|
|
269
|
+
📁 CelestialFlow (560MB 757KB 428B)
|
|
269
270
|
📁 bench (316KB 409B)
|
|
270
271
|
📁 [1项排除的目录] (193KB 163B)
|
|
271
272
|
🐍 bench_datastructures.py (6KB 690B)
|
|
@@ -287,8 +288,8 @@ flowchart TD
|
|
|
287
288
|
🐍 bench_requests.py (6KB 813B)
|
|
288
289
|
🐍 bench_tqdm.py (1KB 235B)
|
|
289
290
|
🐍 bench_utils.py (543B)
|
|
290
|
-
📁 demo (
|
|
291
|
-
📁 [
|
|
291
|
+
📁 demo (811KB 650B)
|
|
292
|
+
📁 [4项排除的目录] (755KB 996B)
|
|
292
293
|
🐍 demo_executor.py (1KB 557B)
|
|
293
294
|
🐍 demo_funnel.py (2KB 289B)
|
|
294
295
|
🐍 demo_graph.py (2KB 975B)
|
|
@@ -299,11 +300,11 @@ flowchart TD
|
|
|
299
300
|
🐍 demo_skip_dedup.py (6KB 286B)
|
|
300
301
|
🐍 demo_structure.py (8KB 448B)
|
|
301
302
|
🐍 demo_utils.py (6KB 263B)
|
|
302
|
-
🐍 demo_web.py (
|
|
303
|
-
📁 docs (2MB
|
|
304
|
-
📁 en[已折叠] (
|
|
305
|
-
📁 ja[已折叠] (
|
|
306
|
-
📁 zh-CN[已折叠] (
|
|
303
|
+
🐍 demo_web.py (8KB 734B)
|
|
304
|
+
📁 docs (2MB 88KB 855B)
|
|
305
|
+
📁 en[已折叠] (678KB 928B)
|
|
306
|
+
📁 ja[已折叠] (778KB 854B)
|
|
307
|
+
📁 zh-CN[已折叠] (679KB 97B)
|
|
307
308
|
📁 experiments (3KB 21B)
|
|
308
309
|
🐍 experiment_networkx.py (1KB 908B)
|
|
309
310
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -312,55 +313,50 @@ flowchart TD
|
|
|
312
313
|
📷 logo(old).png (836KB 542B)
|
|
313
314
|
📷 logo.png (122KB 747B)
|
|
314
315
|
📷 scc_condensation.svg (17KB 1B)
|
|
315
|
-
📁 src (1MB
|
|
316
|
-
📁 celestialflow[已折叠] (1MB
|
|
317
|
-
📁 [1项排除的目录] (19KB
|
|
318
|
-
📁 tests (3MB
|
|
319
|
-
📁 assembly[已折叠] (
|
|
316
|
+
📁 src (1MB 661KB 60B)
|
|
317
|
+
📁 celestialflow[已折叠] (1MB 641KB 309B)
|
|
318
|
+
📁 [1项排除的目录] (19KB 775B)
|
|
319
|
+
📁 tests (3MB 65KB 73B)
|
|
320
|
+
📁 assembly[已折叠] (42KB 929B)
|
|
320
321
|
📁 benchmark[已折叠] (41KB 377B)
|
|
321
322
|
📁 funnel[已折叠] (96KB 339B)
|
|
322
|
-
📁 graph[已折叠] (
|
|
323
|
-
📁 node[已折叠] (
|
|
324
|
-
📁 observer[已折叠] (
|
|
325
|
-
📁 persist[已折叠] (
|
|
323
|
+
📁 graph[已折叠] (803KB 239B)
|
|
324
|
+
📁 node[已折叠] (510KB 93B)
|
|
325
|
+
📁 observer[已折叠] (122KB 937B)
|
|
326
|
+
📁 persist[已折叠] (186KB 828B)
|
|
326
327
|
📁 persistence[已折叠] (381KB 89B)
|
|
327
|
-
📁 reporter[已折叠] (
|
|
328
|
-
📁 runtime[已折叠] (189KB
|
|
328
|
+
📁 reporter[已折叠] (173KB 986B)
|
|
329
|
+
📁 runtime[已折叠] (189KB 800B)
|
|
329
330
|
📁 ticker[已折叠] (54KB 761B)
|
|
330
|
-
📁 [
|
|
331
|
+
📁 [3项排除的目录] (532KB 170B)
|
|
331
332
|
🐍 conftest.py (1KB 693B)
|
|
332
|
-
📁 [13项排除的目录] (
|
|
333
|
-
❓ .env (
|
|
333
|
+
📁 [13项排除的目录] (546MB 860KB 667B)
|
|
334
|
+
❓ .env (484B)
|
|
334
335
|
❓ .gitignore (1KB 315B)
|
|
335
|
-
📝 AGENTS.md (
|
|
336
|
+
📝 AGENTS.md (2KB 800B)
|
|
336
337
|
❓ LICENSE (1KB 65B)
|
|
337
338
|
❓ Makefile (149B)
|
|
338
|
-
⚙️ pyproject.toml (2KB
|
|
339
|
-
📝 README.md (16KB
|
|
340
|
-
🔒 uv.lock (
|
|
339
|
+
⚙️ pyproject.toml (2KB 624B)
|
|
340
|
+
📝 README.md (16KB 321B)
|
|
341
|
+
🔒 uv.lock (126KB 837B)
|
|
341
342
|
```
|
|
342
343
|
<p align="center">
|
|
343
|
-
<em>celestial-flow 3.3.
|
|
344
|
+
<em>celestial-flow 3.3.3</em>
|
|
344
345
|
</p>
|
|
345
346
|
|
|
346
347
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
347
348
|
|
|
348
349
|
## 版本日志(Version Log)
|
|
349
|
-
- 3.3.
|
|
350
|
+
- 3.3.3
|
|
350
351
|
- feat:
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
354
|
-
- 作为纯事件驱动的 `observer` 的补充
|
|
355
|
-
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
356
|
-
- 改为在 `.pyproject` 中进行设置
|
|
352
|
+
- 在 `GraphEndEvent` / `NodeEndEvent` 中添加 `end_time`
|
|
353
|
+
- 在 `GraphStartEvent` 中删除 `class_name`
|
|
357
354
|
- refactor:
|
|
358
|
-
-
|
|
359
|
-
|
|
360
|
-
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
- 将 `metric` 机制归入 `observer` 体系
|
|
355
|
+
- 移除部分无用的observer事件, 如 `on_worker_crash`
|
|
356
|
+
- 将log与reporter设置从 `.toml` 中移到运行时配置中
|
|
357
|
+
- 删除部分无用的sqlite函数
|
|
358
|
+
- fix:
|
|
359
|
+
- 修复图分析缓存的问题
|
|
364
360
|
|
|
365
361
|
更多过往日志可看:
|
|
366
362
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CelestialFlow ——一个轻量级、可并行、基于图结构的 Python 任务调度框架
|
|
2
2
|
|
|
3
|
-
> 📅 最后更新日期: 2026/
|
|
3
|
+
> 📅 最后更新日期: 2026/10/30
|
|
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,16 @@ 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)
|
|
210
211
|
|
|
211
212
|
如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇利用 TaskGraph 从零开始构建项目的教程:
|
|
212
213
|
|
|
@@ -246,7 +247,7 @@ flowchart TD
|
|
|
246
247
|
## 文件结构(File Structure)
|
|
247
248
|
|
|
248
249
|
```
|
|
249
|
-
📁 CelestialFlow (
|
|
250
|
+
📁 CelestialFlow (560MB 757KB 428B)
|
|
250
251
|
📁 bench (316KB 409B)
|
|
251
252
|
📁 [1项排除的目录] (193KB 163B)
|
|
252
253
|
🐍 bench_datastructures.py (6KB 690B)
|
|
@@ -268,8 +269,8 @@ flowchart TD
|
|
|
268
269
|
🐍 bench_requests.py (6KB 813B)
|
|
269
270
|
🐍 bench_tqdm.py (1KB 235B)
|
|
270
271
|
🐍 bench_utils.py (543B)
|
|
271
|
-
📁 demo (
|
|
272
|
-
📁 [
|
|
272
|
+
📁 demo (811KB 650B)
|
|
273
|
+
📁 [4项排除的目录] (755KB 996B)
|
|
273
274
|
🐍 demo_executor.py (1KB 557B)
|
|
274
275
|
🐍 demo_funnel.py (2KB 289B)
|
|
275
276
|
🐍 demo_graph.py (2KB 975B)
|
|
@@ -280,11 +281,11 @@ flowchart TD
|
|
|
280
281
|
🐍 demo_skip_dedup.py (6KB 286B)
|
|
281
282
|
🐍 demo_structure.py (8KB 448B)
|
|
282
283
|
🐍 demo_utils.py (6KB 263B)
|
|
283
|
-
🐍 demo_web.py (
|
|
284
|
-
📁 docs (2MB
|
|
285
|
-
📁 en[已折叠] (
|
|
286
|
-
📁 ja[已折叠] (
|
|
287
|
-
📁 zh-CN[已折叠] (
|
|
284
|
+
🐍 demo_web.py (8KB 734B)
|
|
285
|
+
📁 docs (2MB 88KB 855B)
|
|
286
|
+
📁 en[已折叠] (678KB 928B)
|
|
287
|
+
📁 ja[已折叠] (778KB 854B)
|
|
288
|
+
📁 zh-CN[已折叠] (679KB 97B)
|
|
288
289
|
📁 experiments (3KB 21B)
|
|
289
290
|
🐍 experiment_networkx.py (1KB 908B)
|
|
290
291
|
🐍 experiment_tqdm.py (1KB 137B)
|
|
@@ -293,55 +294,50 @@ flowchart TD
|
|
|
293
294
|
📷 logo(old).png (836KB 542B)
|
|
294
295
|
📷 logo.png (122KB 747B)
|
|
295
296
|
📷 scc_condensation.svg (17KB 1B)
|
|
296
|
-
📁 src (1MB
|
|
297
|
-
📁 celestialflow[已折叠] (1MB
|
|
298
|
-
📁 [1项排除的目录] (19KB
|
|
299
|
-
📁 tests (3MB
|
|
300
|
-
📁 assembly[已折叠] (
|
|
297
|
+
📁 src (1MB 661KB 60B)
|
|
298
|
+
📁 celestialflow[已折叠] (1MB 641KB 309B)
|
|
299
|
+
📁 [1项排除的目录] (19KB 775B)
|
|
300
|
+
📁 tests (3MB 65KB 73B)
|
|
301
|
+
📁 assembly[已折叠] (42KB 929B)
|
|
301
302
|
📁 benchmark[已折叠] (41KB 377B)
|
|
302
303
|
📁 funnel[已折叠] (96KB 339B)
|
|
303
|
-
📁 graph[已折叠] (
|
|
304
|
-
📁 node[已折叠] (
|
|
305
|
-
📁 observer[已折叠] (
|
|
306
|
-
📁 persist[已折叠] (
|
|
304
|
+
📁 graph[已折叠] (803KB 239B)
|
|
305
|
+
📁 node[已折叠] (510KB 93B)
|
|
306
|
+
📁 observer[已折叠] (122KB 937B)
|
|
307
|
+
📁 persist[已折叠] (186KB 828B)
|
|
307
308
|
📁 persistence[已折叠] (381KB 89B)
|
|
308
|
-
📁 reporter[已折叠] (
|
|
309
|
-
📁 runtime[已折叠] (189KB
|
|
309
|
+
📁 reporter[已折叠] (173KB 986B)
|
|
310
|
+
📁 runtime[已折叠] (189KB 800B)
|
|
310
311
|
📁 ticker[已折叠] (54KB 761B)
|
|
311
|
-
📁 [
|
|
312
|
+
📁 [3项排除的目录] (532KB 170B)
|
|
312
313
|
🐍 conftest.py (1KB 693B)
|
|
313
|
-
📁 [13项排除的目录] (
|
|
314
|
-
❓ .env (
|
|
314
|
+
📁 [13项排除的目录] (546MB 860KB 667B)
|
|
315
|
+
❓ .env (484B)
|
|
315
316
|
❓ .gitignore (1KB 315B)
|
|
316
|
-
📝 AGENTS.md (
|
|
317
|
+
📝 AGENTS.md (2KB 800B)
|
|
317
318
|
❓ LICENSE (1KB 65B)
|
|
318
319
|
❓ Makefile (149B)
|
|
319
|
-
⚙️ pyproject.toml (2KB
|
|
320
|
-
📝 README.md (16KB
|
|
321
|
-
🔒 uv.lock (
|
|
320
|
+
⚙️ pyproject.toml (2KB 624B)
|
|
321
|
+
📝 README.md (16KB 321B)
|
|
322
|
+
🔒 uv.lock (126KB 837B)
|
|
322
323
|
```
|
|
323
324
|
<p align="center">
|
|
324
|
-
<em>celestial-flow 3.3.
|
|
325
|
+
<em>celestial-flow 3.3.3</em>
|
|
325
326
|
</p>
|
|
326
327
|
|
|
327
328
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
328
329
|
|
|
329
330
|
## 版本日志(Version Log)
|
|
330
|
-
- 3.3.
|
|
331
|
+
- 3.3.3
|
|
331
332
|
- feat:
|
|
332
|
-
-
|
|
333
|
-
|
|
334
|
-
- [IMPORTANT] 添加 `ticker` 机制, 以周期性的时间为驱动
|
|
335
|
-
- 作为纯事件驱动的 `observer` 的补充
|
|
336
|
-
- 由于 `reprter` 机制的完全重构, 其开启与使用方法也有所变化
|
|
337
|
-
- 改为在 `.pyproject` 中进行设置
|
|
333
|
+
- 在 `GraphEndEvent` / `NodeEndEvent` 中添加 `end_time`
|
|
334
|
+
- 在 `GraphStartEvent` 中删除 `class_name`
|
|
338
335
|
- refactor:
|
|
339
|
-
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
- 将 `metric` 机制归入 `observer` 体系
|
|
336
|
+
- 移除部分无用的observer事件, 如 `on_worker_crash`
|
|
337
|
+
- 将log与reporter设置从 `.toml` 中移到运行时配置中
|
|
338
|
+
- 删除部分无用的sqlite函数
|
|
339
|
+
- fix:
|
|
340
|
+
- 修复图分析缓存的问题
|
|
345
341
|
|
|
346
342
|
更多过往日志可看:
|
|
347
343
|
|
|
@@ -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.3"
|
|
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
|
]
|