Files
model-platform/REFACTOR_NOTES.md
T
tao.chen 309b657d35 docs: align with new storage architecture (s3 + local + server-proxied PUT)
All operator- and developer-facing docs updated to reflect:

  - The unified AsyncStorageBackend abstraction (s3 + local backends).
  - The STORAGE_BACKEND toggle ("s3" default, "local" for dev /
    single-node / air-gapped deployments).
  - The 4-purpose-bucket layout (workspace / version / run_log / trash)
    in both modes — 4 separate S3 buckets in s3 mode, 4 subdirectories
    of LOCAL_STORAGE_BASE_DIR in local mode.
  - The S3_* env var naming (was RUSTFS_*).
  - The server-proxied upload flow (was browser-direct presign-PUT):
    POST /internal/v1/uploads → PUT /internal/v1/uploads/{id} with
    raw bytes → server calls backend.put().
  - The factory helpers workspaces_root() (runtime's view of the
    workspace bucket on disk) and rclone_remote_spec() (s3-mode mount
    source).
  - The "two settings describing the same thing" cleanup: the deleted
    settings.workspace_root, settings.workspaces_root, and
    settings.remote_bucket fields.

Files touched:
  - API.md (§5 data-resource upload flow, §9 storage control plane,
    §10 readiness example)
  - ARCHITECTURE.md (storage layer diagram)
  - CLAUDE.md (architecture description + volume-preservation note)
  - DEVELOP.md (settings list, Storage section, "Wire a new bucket"
    how-to, dev-export example, troubleshooting network hint)
  - README.md (architecture diagram, container table, quick-start
    credentials note, tear-down note, Storage layout section)
  - REFACTOR_NOTES.md (final container list with s3 explanation)
  - backend/README.md (storage backend description)
  - migrations/data/README.md (step 11/12 record mentioning object
    storage)

A handful of historical "RustFS" mentions are intentionally retained
where they name a specific S3-compatible product (e.g. as an example
in REFACTOR_NOTES.md's container list) or document the pre-2026
abstraction name (DEVELOP.md Storage section).
2026-08-05 13:13:20 +08:00

2.3 KiB
Raw Blame History

本次重构说明

已完成

前端

  • 将原 frontend/src 页面迁入 React Router SPA 结构;
  • 主入口改为 app/routes/platform.tsx
  • 拆分为 components / features / routes / services / styles
  • 保留脚本管理、目录管理、Jupyter 编辑、版本发布、调度画布、运行记录和系统管理功能;
  • 将原 Hash 页面切换改为 React Router 路径://scripts/schedules/system
  • Nginx 使用 SPA fallback,刷新子路径不会 404。

后端

  • 合并 Platform API 和 Storage API 到同一个 backend 进程;
  • 删除 Redis 容器、依赖、Streams 消费和锁实现;
  • 文件锁改为 MySQL edit_sessions 租约;
  • Jupyter 短期票据由单 Runtime 进程内存保存;
  • Schedule Executor 内置 APScheduler,并使用 MySQL apscheduler_jobs
  • Backend 创建运行和 Outbox 后,通过内部 HTTP 尝试立即推送;
  • Schedule Executor 轮询 MySQL Outbox 作为失败兜底;
  • 增加迁移 20260730_0004,兼容旧数据库的 redis_lock_key -> lock_key

Docker

最终容器:

mysql
s3                # 外部 S3-兼容服务(MinIO/RustFS/SeaweedFS/...),由运维在 compose 外启动
jupyter            # 注释保留;当前实现未在 compose 启此独立容器
migrate(一次性)
backend
runtime
schedule
gateway

补充说明:STORAGE_BACKEND=local 模式下不需要外部 S3 服务,backend 与 runtime 共享 docker 卷 local-storage,挂载到 LOCAL_STORAGE_BASE_DIR(默认 /data/storage);runtime 也跳过 rclone FUSE 挂载(见 runtime/src/runtime/mount.py)。

已执行检查

  • Python 全项目 compileall 通过;
  • SQLAlchemy 模型导入通过,共加载 26 张表;
  • Alembic upgrade head --sql 离线生成通过;
  • docker-compose.yml YAML 解析通过;
  • 前端 feature、route 和 root 文件 TypeScript 静态检查通过。

未在当前沙箱执行

当前执行环境没有 Docker 命令,并且无法连接 npm/PyPI,因此没有在沙箱内完成:

  • docker compose up --build
  • 正式 pnpm install && pnpm build
  • Python 依赖在线安装后的集成测试。

请在安装了 Docker Desktop且网络可访问依赖仓库的 Windows 电脑上执行根目录 README 中的启动命令。