devops: 镜像出处 —— tag=git SHA + 运行体自报版本 + 冒烟断言一致
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 背景
`apps/skill-sandbox` 的镜像在 devapp 上**自 2026-08-21 首次部署起冻结了半个月**,
其间所有源码改动(预装库、CJK 字体)一次都没上线,而每轮部署都是绿的。
直接原因(已修,#2830):`docker compose up -d` 对带 `build:` 的服务只在镜像不存在时
构建。但更深的问题是:**没有任何机制能回答"跑着的这个容器是哪一版代码"**。
`git log` 说改动在 main 上——这句话对,而且完全不相干。
deep-agent-service 那条已经有先例做对了:`docker build -t deep-agent-service:$GIT_SHA`,
tag 就是出处。沙箱这条还是 `:latest`。
## 要做什么
1. 沙箱镜像(以及其它由 compose `build:` 起的服务)打 **`tag = git SHA`**,
compose 用 `${IMAGE_TAG}` 引用;
2. 服务启动时把自己的版本写进日志,并在 `/healthz` 返回里带上(沙箱那条已经有
healthz,加一个字段即可);
3. 部署冒烟断言:**运行体自报的版本 == 本次部署的 SHA**。不一致红退。
⚠ 第 3 条是关键。只做 1、2 相当于把出处写在了痕迹里,还是要有人去比对它。
## 验收
- 部署完成后 `curl --unix-socket ... /healthz` 能拿到 SHA,且与 `git rev-parse HEAD` 一致;
- **反证**:手工用旧镜像起容器再跑冒烟,必须红在版本不一致上。
## 参考
- `.harness/instructions/deployment-verification-standard.md` 第一节表格第 1 行
- `.harness/scripts/vm/deploy.sh`(deep-agent 那段的 `DEEP_AGENT_IMAGE` 是可照抄的形状)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with .harness/instructions/deployment-verification-standard.md and .harness/scripts/vm/deploy.sh, especially the deep-agent image handling. Then locate the compose build services and apps/skill-sandbox healthz implementation; done means the deployed SHA is reported and the smoke check passes only when it matches, including failure with an old image.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, git, shell, typescript
- Domain
- devops, infrastructure, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100