celestialflow 3.1.9__tar.gz → 3.2.0__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.1.9 → celestialflow-3.2.0}/PKG-INFO +22 -20
- {celestialflow-3.1.9 → celestialflow-3.2.0}/README.md +21 -19
- {celestialflow-3.1.9 → celestialflow-3.2.0}/pyproject.toml +80 -81
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/core_spout.py +3 -6
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/core_graph.py +147 -196
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/core_structure.py +62 -32
- celestialflow-3.2.0/src/celestialflow/graph/util_analysis.py +73 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/util_serialize.py +23 -16
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_observer.py +4 -1
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_report.py +27 -24
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_fail.py +7 -4
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_log.py +11 -39
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/util_jsonl.py +18 -15
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_dispatch.py +27 -20
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_envelope.py +6 -6
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_metrics.py +10 -13
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_queue.py +18 -23
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_errors.py +5 -21
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_estimators.py +12 -9
- celestialflow-3.2.0/src/celestialflow/runtime/util_factories.py +48 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_hash.py +9 -8
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_types.py +19 -17
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_executor.py +64 -103
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_stage.py +79 -69
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_stages.py +37 -36
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_benchmark.py +45 -33
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_clone.py +30 -22
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_collections.py +1 -1
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_format.py +25 -18
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/__init__.py +1 -1
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/core_server.py +530 -522
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/base.css +108 -1
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/main.js +36 -6
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_analysis.js +3 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_errors.js +9 -7
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_history.js +8 -4
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_injection.js +4 -3
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_statuses.js +16 -7
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_structure.js +7 -4
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_summary.js +4 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/web_config.js +11 -1
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/main.ts +40 -6
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_analysis.ts +3 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_errors.ts +10 -8
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_history.ts +6 -4
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_injection.ts +4 -3
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_statuses.ts +17 -11
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_structure.ts +8 -4
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_summary.ts +4 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/web_config.ts +13 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/templates/index.html +32 -9
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_config.py +4 -3
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/PKG-INFO +22 -20
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/SOURCES.txt +2 -2
- celestialflow-3.2.0/tests/test_analysis.py +132 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_envelope.py +22 -2
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_executor.py +2 -15
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_graph.py +674 -579
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_metrics.py +9 -9
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_stage.py +91 -120
- celestialflow-3.2.0/tests/test_structure.py +85 -0
- celestialflow-3.1.9/src/celestialflow/graph/util_analysis.py +0 -55
- celestialflow-3.1.9/src/celestialflow/runtime/util_factories.py +0 -95
- celestialflow-3.1.9/src/celestialflow/runtime/util_queue.py +0 -13
- celestialflow-3.1.9/src/celestialflow/utils/util_debug.py +0 -16
- {celestialflow-3.1.9 → celestialflow-3.2.0}/setup.cfg +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/core_inlet.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_progress.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_success.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/util_constant.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/__init__.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/config.json +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/_colors.css +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/dashboard.css +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/errors.css +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/inject.css +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/favicon.ico +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_config.js +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_topology.js +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/utils.js +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/utils.ts +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_cal.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_error.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/dependency_links.txt +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/entry_points.txt +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/requires.txt +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/top_level.txt +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_queue.py +0 -0
- {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: celestialflow
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.2.0
|
|
4
4
|
Summary: A flexible GRAPH-based task orchestration framework.
|
|
5
5
|
Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -155,7 +155,7 @@ if __name__ == "__main__":
|
|
|
155
155
|
|
|
156
156
|
# 构建任务图结构
|
|
157
157
|
graph = TaskGraph()
|
|
158
|
-
graph.set_stages(
|
|
158
|
+
graph.set_stages(stages=[stage1, stage2])
|
|
159
159
|
graph.connect([stage1], [stage2])
|
|
160
160
|
|
|
161
161
|
# 初始化任务并启动
|
|
@@ -261,29 +261,31 @@ flowchart TD
|
|
|
261
261
|
<p align="center">
|
|
262
262
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
|
|
263
263
|
<br/>
|
|
264
|
-
<em>celestial-flow 3.
|
|
264
|
+
<em>celestial-flow 3.2.0</em>
|
|
265
265
|
</p>
|
|
266
266
|
|
|
267
267
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
268
268
|
|
|
269
269
|
## 版本日志(Version Log)
|
|
270
|
-
- 3.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
-
|
|
283
|
-
|
|
284
|
-
-
|
|
285
|
-
|
|
286
|
-
-
|
|
270
|
+
- 3.2.0
|
|
271
|
+
- feat:
|
|
272
|
+
- [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
|
|
273
|
+
- bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
|
|
274
|
+
- [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
|
|
275
|
+
- 重补了不少图论课
|
|
276
|
+
- 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
|
|
277
|
+
- 在web页面中添加配置按钮
|
|
278
|
+
- 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
|
|
279
|
+
- refactor:
|
|
280
|
+
- 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
|
|
281
|
+
- 例如将所有的MPValue和MPQueue改为int与Queue
|
|
282
|
+
- 尚未进行严格的bench测试, 但应该会带来一定的性能优化
|
|
283
|
+
- 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
|
|
284
|
+
- 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
|
|
285
|
+
- 根据 bench_hash_memory, 节省内存约23%
|
|
286
|
+
- 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
|
|
287
|
+
- fix:
|
|
288
|
+
- 删除InQueue.get中的错误捕获, 这会导致错过panic级error
|
|
287
289
|
|
|
288
290
|
更多过往日志可看:
|
|
289
291
|
|
|
@@ -130,7 +130,7 @@ if __name__ == "__main__":
|
|
|
130
130
|
|
|
131
131
|
# 构建任务图结构
|
|
132
132
|
graph = TaskGraph()
|
|
133
|
-
graph.set_stages(
|
|
133
|
+
graph.set_stages(stages=[stage1, stage2])
|
|
134
134
|
graph.connect([stage1], [stage2])
|
|
135
135
|
|
|
136
136
|
# 初始化任务并启动
|
|
@@ -236,29 +236,31 @@ flowchart TD
|
|
|
236
236
|
<p align="center">
|
|
237
237
|
<img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
|
|
238
238
|
<br/>
|
|
239
|
-
<em>celestial-flow 3.
|
|
239
|
+
<em>celestial-flow 3.2.0</em>
|
|
240
240
|
</p>
|
|
241
241
|
|
|
242
242
|
(该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
|
|
243
243
|
|
|
244
244
|
## 版本日志(Version Log)
|
|
245
|
-
- 3.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
-
|
|
245
|
+
- 3.2.0
|
|
246
|
+
- feat:
|
|
247
|
+
- [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
|
|
248
|
+
- bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
|
|
249
|
+
- [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
|
|
250
|
+
- 重补了不少图论课
|
|
251
|
+
- 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
|
|
252
|
+
- 在web页面中添加配置按钮
|
|
253
|
+
- 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
|
|
254
|
+
- refactor:
|
|
255
|
+
- 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
|
|
256
|
+
- 例如将所有的MPValue和MPQueue改为int与Queue
|
|
257
|
+
- 尚未进行严格的bench测试, 但应该会带来一定的性能优化
|
|
258
|
+
- 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
|
|
259
|
+
- 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
|
|
260
|
+
- 根据 bench_hash_memory, 节省内存约23%
|
|
261
|
+
- 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
|
|
262
|
+
- fix:
|
|
263
|
+
- 删除InQueue.get中的错误捕获, 这会导致错过panic级error
|
|
262
264
|
|
|
263
265
|
更多过往日志可看:
|
|
264
266
|
|
|
@@ -1,81 +1,80 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "celestialflow"
|
|
7
|
-
version = "3.
|
|
8
|
-
description = "A flexible GRAPH-based task orchestration framework."
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
license = { text = "MIT" }
|
|
11
|
-
authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
|
|
12
|
-
keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
|
|
13
|
-
requires-python = ">=3.10"
|
|
14
|
-
|
|
15
|
-
dependencies = [
|
|
16
|
-
"tqdm",
|
|
17
|
-
"fastapi",
|
|
18
|
-
"uvicorn",
|
|
19
|
-
"requests",
|
|
20
|
-
"networkx",
|
|
21
|
-
"redis",
|
|
22
|
-
"jinja2",
|
|
23
|
-
"celestialtree>=0.1.2",
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
classifiers = [
|
|
27
|
-
"Programming Language :: Python :: 3",
|
|
28
|
-
"License :: OSI Approved :: MIT License",
|
|
29
|
-
"Operating System :: OS Independent",
|
|
30
|
-
"Framework :: FastAPI",
|
|
31
|
-
"Topic :: Software Development :: Libraries",
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
[project.urls]
|
|
35
|
-
"Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
|
|
36
|
-
"Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
|
|
37
|
-
|
|
38
|
-
[project.scripts]
|
|
39
|
-
celestialflow-web = "celestialflow.web.core_server:main_entry"
|
|
40
|
-
|
|
41
|
-
[tool.setuptools]
|
|
42
|
-
license-files = []
|
|
43
|
-
|
|
44
|
-
[tool.setuptools.package-data]
|
|
45
|
-
celestialflow = [
|
|
46
|
-
"web/templates/**/*.html",
|
|
47
|
-
"web/static/**/*",
|
|
48
|
-
"web/config.json"
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
[tool.pytest.ini_options]
|
|
52
|
-
addopts = "-s"
|
|
53
|
-
log_cli = true
|
|
54
|
-
log_cli_level = "INFO"
|
|
55
|
-
log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
|
|
56
|
-
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
|
|
57
|
-
|
|
58
|
-
filterwarnings = [
|
|
59
|
-
"ignore::DeprecationWarning",
|
|
60
|
-
"ignore::pytest.PytestDeprecationWarning",
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
asyncio_default_fixture_loop_scope = "function"
|
|
64
|
-
|
|
65
|
-
[dependency-groups]
|
|
66
|
-
dev = [
|
|
67
|
-
"build>=1.2.2.post1",
|
|
68
|
-
"twine>=6.1.0",
|
|
69
|
-
"pytest>=8.3.4",
|
|
70
|
-
"pytest-asyncio>=0.25.3",
|
|
71
|
-
"httpx>=0.28.1",
|
|
72
|
-
"python-dotenv>=1.2.2",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
[
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
disable_error_code = ["import-untyped"]
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "celestialflow"
|
|
7
|
+
version = "3.2.0"
|
|
8
|
+
description = "A flexible GRAPH-based task orchestration framework."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
|
|
12
|
+
keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
|
|
15
|
+
dependencies = [
|
|
16
|
+
"tqdm",
|
|
17
|
+
"fastapi",
|
|
18
|
+
"uvicorn",
|
|
19
|
+
"requests",
|
|
20
|
+
"networkx",
|
|
21
|
+
"redis",
|
|
22
|
+
"jinja2",
|
|
23
|
+
"celestialtree>=0.1.2",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"License :: OSI Approved :: MIT License",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Framework :: FastAPI",
|
|
31
|
+
"Topic :: Software Development :: Libraries",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
"Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
|
|
36
|
+
"Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
celestialflow-web = "celestialflow.web.core_server:main_entry"
|
|
40
|
+
|
|
41
|
+
[tool.setuptools]
|
|
42
|
+
license-files = []
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.package-data]
|
|
45
|
+
celestialflow = [
|
|
46
|
+
"web/templates/**/*.html",
|
|
47
|
+
"web/static/**/*",
|
|
48
|
+
"web/config.json"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
addopts = "-s"
|
|
53
|
+
log_cli = true
|
|
54
|
+
log_cli_level = "INFO"
|
|
55
|
+
log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
|
|
56
|
+
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
|
|
57
|
+
|
|
58
|
+
filterwarnings = [
|
|
59
|
+
"ignore::DeprecationWarning",
|
|
60
|
+
"ignore::pytest.PytestDeprecationWarning",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
64
|
+
|
|
65
|
+
[dependency-groups]
|
|
66
|
+
dev = [
|
|
67
|
+
"build>=1.2.2.post1",
|
|
68
|
+
"twine>=6.1.0",
|
|
69
|
+
"pytest>=8.3.4",
|
|
70
|
+
"pytest-asyncio>=0.25.3",
|
|
71
|
+
"httpx>=0.28.1",
|
|
72
|
+
"python-dotenv>=1.2.2",
|
|
73
|
+
"ruff>=0.15.0",
|
|
74
|
+
"pyright>=1.1.409",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.pyright]
|
|
78
|
+
include = ["src"]
|
|
79
|
+
strict = ["src/celestialflow/runtime", "src/celestialflow/stage", "src/celestialflow/graph", "src/celestialflow/persistence", "src/celestialflow/funnel", "src/celestialflow/observability", "src/celestialflow/utils"]
|
|
80
|
+
stubsPath = "typings"
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# funnel/core_spout.py
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from queue import Empty
|
|
4
|
+
from queue import Empty, Queue
|
|
6
5
|
from threading import Thread
|
|
7
6
|
from typing import Any
|
|
8
7
|
|
|
9
|
-
from ..runtime.util_queue import cleanup_mpqueue
|
|
10
8
|
from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
|
|
11
9
|
|
|
12
10
|
|
|
@@ -15,7 +13,7 @@ class BaseSpout:
|
|
|
15
13
|
|
|
16
14
|
def __init__(self) -> None:
|
|
17
15
|
"""初始化监听器及其内部队列和线程引用。"""
|
|
18
|
-
self.queue: Any =
|
|
16
|
+
self.queue: Queue[Any] = Queue()
|
|
19
17
|
self._thread: Thread | None = None
|
|
20
18
|
|
|
21
19
|
def _before_start(self) -> None:
|
|
@@ -46,7 +44,7 @@ class BaseSpout:
|
|
|
46
44
|
except Exception: # ← 新增:防止线程崩溃
|
|
47
45
|
continue # 或记录到 stderr,至少不丢后续记录
|
|
48
46
|
|
|
49
|
-
def get_queue(self) ->
|
|
47
|
+
def get_queue(self) -> Queue[Any]:
|
|
50
48
|
"""获取监听器的输入队列。"""
|
|
51
49
|
return self.queue
|
|
52
50
|
|
|
@@ -58,5 +56,4 @@ class BaseSpout:
|
|
|
58
56
|
self.queue.put(TERMINATION_SIGNAL)
|
|
59
57
|
self._thread.join()
|
|
60
58
|
self._thread = None
|
|
61
|
-
cleanup_mpqueue(self.queue)
|
|
62
59
|
self._after_stop()
|