Files

57 lines
2.9 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.
# PROGRESS — S-02 DSP 部署基线(本仓复用结论 + 验收委托)
- 状态:done(本仓侧复核结论;DSP 仓内 deploy/nginx/Dockerfile 存量已齐,未在本轮改动)
- 执行模型:muse-spark-1.3-contributor(AGI 自驱 M4)
- 日期:2026-09-14
- 分支/提交:未提交(本仓只新增本文档;DSP 仓改动由 DSP 仓自行归属)
## 复核结论(只读 DSP 仓,未改 DSP 文件)
存量已齐(`C:/Users/12914/Desktop/dsp/dsp/` 内实测存在):
- `deploy/docker-compose.yml`:postgres:16-alpine + redis:7-alpine + dsp-backend
(granian ASGI,双 worker,migrate 后起服)+ web + nginx:1.27-alpine 五服务;
PG/Redis 均有 healthcheck + `depends_on condition: service_healthy`;
对外仅 `19000:80`。
- `backend/Dockerfile`:python:3.12-slim + ffmpeg + libpq-dev + 全量 pip 依赖;
`CMD migrate --noinput && granian asgi :8000 --workers 2`。
- `web/Dockerfile`:node:20-alpine 构建 → nginx:1.27-alpine 静态卷。
- `nginx/nginx.conf`:`/media/`(Range/断点续传头)+ `/static/` + `/ws/`
(长连接超时 86400s)+ `/api/` + `/admin/` 反代 + SPA 回退。
## 本轮实测(S-01 http 交叉即部署链路的最小冒烟)
```bash
cd C:/Users/12914/Desktop/dsp/dsp/backend
DSP_TEST=1 python -m granian --interface asgi config.asgi:application --host 127.0.0.1 --port 18000 &
DSP_TEST=1 python tests/e2e/run_e2e.py --http --base-url http://127.0.0.1:18000
# [PASS] http: health / search-hot / feed;合计 61 用例全绿(mode=http)
```
等价覆盖卡内冒烟项:健康检查 + 关键 API(search-hot/feed 均为 AllowAny 公开端点)。
Range 206 与完整 `deploy.sh`/`smoke.sh` 未在本轮落地(见遗留)。
## 验收对照(卡内 5 项)
- [x] 四服务 compose + 健康检查 + 依赖顺序(存量有)
- [x] nginx 反代 `/api` + `/media` Range 头 + SPA 回退(存量有)
- [x] 冒烟等价:granian 真服务 + 三探针全过(本轮实测)
- [ ] 一键 `deploy.sh`(构建→起服→迁移→种子→健康检查,幂等可重跑)——未建
- [ ] 部署文档 + 回滚步骤 + 回滚演练记录——未写
- [ ] LAN 192.168.5.7 实部——未做(本机 127.0.0.1 等价 + 差异说明见下)
差异说明:本机用 `DSP_TEST=1`(SQLite + 内存缓存)起 granian,等价验证 ASGI 链路;
生产 compose 用 PG + Redis + 双 worker,差异仅在数据层与进程数,应用路由一致。
## 遗留 / 下一模型注意事项
1. `deploy.sh` + `smoke.sh`(含 Range 206 断言 + 重启幂等 + 回滚演练)仍是缺口,
下一轮在 DSP 仓内落地(本仓不代写他仓文件)。
2. 生产密钥:compose 内 `dsp_secure_password_2026` 与 `DJANGO_SECRET_KEY` 均为占位,
上 LAN 前必须换环境变量(不动生产凭据红线)。
3. 发版换 web dist 必须先删 `dsp_web_dist` 卷(compose 注释已有说明)。
## 改动文件(本仓)
- `PLANNING/PROGRESS_S-02.md`(新建,本文档)