argus-cluster/walkthrough.md

28 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 源码走读
## API Server
API Server是平台服务入口提供API和web UI功能。
- 入口src/mvp/py/server.py
- 配置文件src/mvp/configs/dev.yaml解析成V2Config数据结构
- 核心模块:
- service服务层包括API服务任务调度模型调度等后台任务
- core 核心数据结构任务IDsubmission IDmodel serving ID定义
- ray 对接ray cluster的client
## service核心模块
API Server核心模块包括
- app.py: API 入口层提供webui将API请求转化为各类数据库操作以及协调SFTPGo服务
- scheduler.py定时任务调度训练任务队列提交ray job更新数据库中任务状态
- serving_reconciler.py: 定时任务模型推理调度提交ray serve app调整副本数更新数据库中模型实例状态
- db.py: 数据库操作基础工具类
- janitor.py定时清理训练任务中间过程数据
- sftpgo.py: 对接SFTPGo的客户端创建用户、重置密码、初始化用户目录等
## core核心模块
- ray_job_tool.py通过builder模板构建ray job命令提交ray job到ray集群。
- head_publisher.py: Ray head节点自动写head IP 文件到共享存储
- worker_watchdog.py: 自动检查最新head IP文件加入head的ray集群。
- models: 定义RayConfig/JobSepc/AdvancedTaskSpec等核心数据结构