fix(ops): prune old docker artifacts after deploy

This commit is contained in:
Xiaoxia AI
2026-06-23 22:39:18 +08:00
parent 8b2f4b3a34
commit bf452e3510
4 changed files with 19 additions and 6 deletions
+3 -3
View File
@@ -139,8 +139,8 @@
- 全局项目列表。
- 全局成员管理。
- 完整标题库。
- 素材智能视图仍缺:高风险细分、未使用、真实最近使用回写
- 素材缺口诊断已开放基础版:准备度评分、推荐/慎用/未分类/最近上传/配音统计、生成前 critical 缺口拦截。
- 素材智能视图仍缺:高风险细分、复核操作入口
- 素材缺口诊断已开放基础版:准备度评分、推荐/慎用/未分类/最近上传/未使用/已使用/待复核/配音统计、生成前 critical 缺口拦截。
- 成片历史管理、封面预览、批量下载、复核状态。
- 统一任务中心和任务重试。
- 模板编排和剪辑计划预览。
@@ -222,6 +222,6 @@
## 7. 下一步
1. 继续开发包 2 剩余项:素材使用次数/最近使用回写、复核状态、高风险细分。
1. 继续开发包 2 剩余项:高风险细分、复核操作入口
2. 执行真实浏览器 UAT:登录 → 工作空间 → 项目 → 批量上传 → 智能诊断 → 生成 → 下载。
3. 处理生产资源长期风险:升级生产机或迁移 Gitea。
+3 -3
View File
@@ -110,8 +110,8 @@
- [x] 设计素材分类字段。
- [x] 设计风险分和质量分字段。
- [ ] 设计使用次数和最近使用字段。
- [ ] 设计复核状态字段。
- [x] 设计使用次数和最近使用字段。
- [x] 设计复核状态字段。
- [x] 增加分类 Worker 流程。
- [x] 增加智能视图 API。
- [x] 增加素材诊断 API。
@@ -124,7 +124,7 @@
- [x] 生产浏览器 E2E 验证上传诊断与生成下载。
- [x] 生产 API 负向 smoke 验证空视频库生成返回 422。
当前生产基线:`v0.1.33`。剩余未完成:使用次数/最近使用、复核状态、素材使用回写
当前生产基线:`v0.1.36`。剩余未完成:高风险细分、复核操作入口
验收:系统能回答“素材够不够、缺什么、哪些推荐、哪些慎用”。
+5
View File
@@ -91,3 +91,8 @@ if [ -n "$RELEASE_VERSION" ] && [ -d "$HOST_PREFIX/etc/cron.d" ]; then
*/5 * * * * root cd /var/lib/xiaoxia-saas-production/repo && EXPECTED_VERSION=$RELEASE_VERSION sh scripts/production_resource_check.sh >/var/log/xiaoxia-resource-check.log 2>&1
EOF
fi
if [ "${PRUNE_UNUSED_DOCKER_AFTER_DEPLOY:-true}" = "true" ]; then
docker image prune -af --filter "until=168h" || true
docker builder prune -af --filter "until=168h" || true
fi
+8
View File
@@ -135,6 +135,14 @@ def test_deploy_scripts_build_web_image_explicitly():
assert "WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-1}" in compose
def test_production_deploy_prunes_old_unused_docker_artifacts():
script = Path("infra/docker/deploy-production.sh").read_text(encoding="utf-8")
assert "PRUNE_UNUSED_DOCKER_AFTER_DEPLOY" in script
assert "docker image prune -af --filter \"until=168h\"" in script
assert "docker builder prune -af --filter \"until=168h\"" in script
def test_worker_runtime_is_constrained_by_environment():
dockerfile = Path("infra/docker/worker.Dockerfile").read_text(encoding="utf-8")