40 lines
1.3 KiB
Markdown
40 lines
1.3 KiB
Markdown
# 简化系统架构
|
||
|
||
```text
|
||
Browser
|
||
|
|
||
v
|
||
Nginx Gateway (静态 React Router SPA + /api + /jupyter 代理)
|
||
|-----------------------------|
|
||
| /api/v1 | /jupyter/
|
||
v v
|
||
FastAPI Backend Shared Jupyter Server
|
||
| ^
|
||
| Runtime HTTP | Runtime 管理会话/票据
|
||
v |
|
||
Runtime Manager ---------------|
|
||
|
|
||
+------ MySQL(编辑租约、运行实例)
|
||
|
||
FastAPI Backend
|
||
| 1. 写 schedule_runs + outbox_events
|
||
| 2. 尝试 HTTP 立即推送
|
||
v
|
||
Schedule Executor(APScheduler)
|
||
|-- MySQL APSchedulerJobStore
|
||
|-- MySQL Outbox 轮询兜底
|
||
|-- DAG 节点执行与重试
|
||
|-- RustFS 日志/结果
|
||
+-- Backend 内部 Storage API
|
||
```
|
||
|
||
## 关键简化
|
||
|
||
1. 删除 Redis 服务、Redis Streams 和 Redis 文件锁。
|
||
2. 调度定义、运行记录、Outbox、Inbox、Cron JobStore 都由 MySQL 保存。
|
||
3. 立即运行采用 Backend -> Schedule Executor 内部 HTTP 推送;推送失败由 MySQL Outbox 轮询兜底。
|
||
4. Schedule Executor 自带 APScheduler,负责 Cron 触发和 DAG 执行。
|
||
5. 文件编辑锁改为 MySQL 租约,Runtime 单副本运行。
|
||
6. Jupyter 使用一个共享容器,工作区目录通过 Volume 挂载同步。
|
||
7. 前端改为 React Router SPA,并按 feature / route / service / component 分层。
|