docs(project): add production-ready documentation
Add a top-level README plus production configuration, API, and rollout documentation. Also align deployment and runbook docs with the current runtime semantics, ports, and daily pipeline entrypoints.
This commit is contained in:
32
RUNBOOK.md
32
RUNBOOK.md
@@ -1,8 +1,14 @@
|
||||
# LLM Intelligence Hub - 运维手册
|
||||
|
||||
> 版本: v1.0
|
||||
> 日期: 2026-05-10
|
||||
> 适用版本: Phase 1
|
||||
> 版本: v1.1
|
||||
> 日期: 2026-05-14
|
||||
> 适用版本: Phase 3 / Phase 5
|
||||
|
||||
相关文档:
|
||||
|
||||
- `docs/PRODUCTION_CHECKLIST.md`:上线前门禁、发布步骤、回滚流程
|
||||
- `docs/CONFIGURATION.md`:环境变量与产物路径约定
|
||||
- `docs/API_REFERENCE.md`:健康检查与只读接口说明
|
||||
|
||||
---
|
||||
|
||||
@@ -32,11 +38,15 @@ docker-compose logs -f db
|
||||
```bash
|
||||
psql "$DATABASE_URL" -c "SELECT COUNT(*) FROM models WHERE deleted_at IS NULL"
|
||||
psql "$DATABASE_URL" -c "SELECT source, success, created_at FROM collector_stats ORDER BY created_at DESC LIMIT 5"
|
||||
psql "$DATABASE_URL" -c "SELECT report_date, run_kind, trigger_source, is_official_daily, status FROM daily_report ORDER BY updated_at DESC LIMIT 5"
|
||||
psql "$DATABASE_URL" -c "SELECT report_date, run_kind, trigger_source, is_official_daily, status FROM report_runs ORDER BY report_date DESC, created_at DESC LIMIT 5"
|
||||
```
|
||||
|
||||
### 日报检查
|
||||
```bash
|
||||
ls -la reports/daily/daily_report_$(date +%Y-%m-%d).md
|
||||
ls -la reports/daily/html/daily_report_$(date +%Y-%m-%d).html
|
||||
ls -la reports/daily/$(date +%Y)/$(date +%m)/daily_report_$(date +%Y-%m-%d).md
|
||||
```
|
||||
|
||||
### 磁盘空间
|
||||
@@ -63,6 +73,13 @@ df -h /tmp
|
||||
1. 检查 cron: `crontab -l | grep llm-intelligence`
|
||||
2. 手动运行: `bash scripts/run_daily.sh`
|
||||
3. 检查降级报告: `ls reports/daily/*.md | tail -1`
|
||||
4. 如果是历史补跑,使用 `REPORT_RUN_KIND=historical_rebuild` 和 `REPORT_TRIGGER_SOURCE=rebuild_script`,不要当作正式定时产出读取
|
||||
|
||||
### 正式日报与历史重建
|
||||
- 正式定时产出由 `scripts/run_daily.sh` 生成,`is_official_daily=true`
|
||||
- 真实复跑由 `scripts/run_real_pipeline.sh` 负责,通常用于手工验证真实采集 + 真实写库 + 报告生成
|
||||
- 历史重建通过 `scripts/rebuild_historical_report.sh <date>` 执行,运行语义应保持 `run_kind=historical_rebuild`
|
||||
- 前端 `/api/v1/reports/latest` 默认只读正式日报,不会把历史重建当成最新正式产出
|
||||
|
||||
### 前端无法访问
|
||||
1. 检查 Nginx: `docker-compose ps nginx`
|
||||
@@ -99,6 +116,15 @@ gunzip < backup_file.sql.gz | psql "$DATABASE_URL"
|
||||
| 数据库连接 | 失败 | `pg_isready` |
|
||||
| 磁盘空间 | > 80% | `df -h` |
|
||||
|
||||
## 运行审计
|
||||
|
||||
正式日报与历史重建现在会写入运行语义字段,排障时优先看这些字段:
|
||||
|
||||
- `run_kind`: `scheduled` / `historical_rebuild` / `manual`
|
||||
- `trigger_source`: `cron` / `rebuild_script` / `pipeline`
|
||||
- `is_official_daily`: 是否属于当天定时正式产出
|
||||
- `summary_md`: 真实运行审计前缀 + 报告摘要
|
||||
|
||||
---
|
||||
|
||||
## 扩容指南
|
||||
|
||||
Reference in New Issue
Block a user