Repository navigation
Enforce the Docker workspace startup contract (fix #1441) - #1529
Open
Zhong-Chenchen wants to merge 5 commits into
Open
Zhong-Chenchen wants to merge 5 commits into
Zhong-Chenchen wants to merge 5 commits into
Conversation
Keep local readiness deadlines out of the Worker interrupt retry path. Use exact object-specific NotFound responses across workspace inspect and removal, and keep fixed diagnostic hints without leaking CLI output.
Leave shared sidecars untouched on unknown status, recover missing owners and first starts, and let native Ensure work independently of Docker. Cover state, generations and diagnostics with fake and real Docker regressions.
Explain when to back up container-local data and why login profiles must tolerate repeated readiness checks.
Keep execution-machine authorization and cgroup delegation while validating the workspace entrypoint, readiness probe, and Docker state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1441
问题
自定义 Docker 沙箱镜像会继承平台镜像的
ENTRYPOINT ["/app/bin/agentflow"]。运行时只替换了CMD(保活 shell),于是保活脚本变成了平台命令的参数,容器实际启动的是平台服务 —— 因缺少AGENTFLOW_SESSION_SECRET立即退出 1。随后浏览器 sidecar 用--network container:<sandbox>加入这个已停止的容器,Docker 返回 125cannot join network namespace of a non running container;而 UI 仍显示该节点running。根因
构建层保留了镜像自身的语义,但运行时从未明确声明「谁拥有工作区主进程」。预装平台镜像路径用
--entrypoint sh,自定义 Dockerfile 路径只替换CMD,两条路径对同一个镜像给出不同结果。再叠加「旧就绪逻辑反复探测已退出的容器」和「浏览器用内存中的 started 快路径」,底层故障被表现为网络错误。改动
--entrypoint sh IMAGE -c 'cd /workspace && exec sleep infinity'启动保活进程,忽略镜像原有ENTRYPOINT/CMD。镜像构建产物、缓存键与独立启动镜像不变。sh -lc进入/workspace,校验退出码与每次调用独立的随机标记;标记用明确的首尾换行分隔,避免登录脚本输出不带换行时把标记粘住而误判。探针输出不回传给调用方。docker start与登录探针共用的预算超时,按「本地启动超时」归类,不再产生signal: killed被上层当成执行实例中断而无限重排;父 context 取消仍按原语义处理。workspace复用,按完整 owner ID 入网。docs/deployment.md补启动契约、依赖旧入口的用户如何迁移、以及升级与人工重建的边界。升级影响(重要)
sh、支持sleep infinity,且运行用户在启动时就能访问/workspace。原入口里的工具安装移到 DockerfileRUN,静态设置移到ENV,每次初始化移到显式的工作区准备或工作流步骤。docker rm -f <错误给出的容器名>,再准备工作区或发起下一次运行。宿主/workspacebind 与未提交文件保留;旧容器可写层与匿名卷不会自动迁移或重新挂载。既有的整 LOOP 重跑与失败运行闲置清理仍可能删除旧容器。sh -lc,会再次运行登录 profile:脚本应可重复执行,且不得提前退出跳过探针。随机标记只用于区分登录输出与探针执行,不是镜像完整性校验。docker start与登录探针,不含构建、容器创建或独立存活状态查询。验证
go vet(Runtime/Engine/Runner/Procwatch/HTTP API)与定向测试通过。v0.4.2衍生镜像实测:继承平台入口的镜像按契约启动、工作区可docker exec、存量不合规容器被拒绝并给出重建指引、首次轻量 HTTP sidecar 能以container:<owner-ID>入网。验证边界
internal/httpapi/browser_stream_test.go)在本分支与主线fd039e51上同点超时,夹具未指定沙箱、首次navigate也未检查返回状态,因此不计为本次回归;建议后续独立修该夹具。