ops: harden deploy automation contracts#196
Merged
liujuanjuan1984 merged 2 commits intomainfrom Mar 18, 2026
Merged
Conversation
This was referenced Mar 18, 2026
Collaborator
Author
|
补一条后续边界说明: 本 PR 在 deploy 层加入了“已知 LLM provider 的最小必要校验”,这是为了让 但从长期架构边界看,LLM provider/model/secret 的权威校验不应长期停留在 后续跟踪已单独记录在: |
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.
变更概览
本 PR 聚焦补齐
deploy.sh/deploy_release.sh主路径的自动化契约,让部署脚本在 agent/非交互执行场景下更可编排、失败更可判定。相关提交:
e900c22ops: harden deploy automation contracts #148da468c8fix: preserve provider secret bootstrap flow #148模块一:deploy 主入口与 sudo 预检
scripts/shell_helpers.sh增加统一ensure_sudo_ready()scripts/deploy.sh主路径前置执行sudo预检sudo -n可用,避免部署执行到一半才因为权限交互失败deploy_healthcheck_timeout_seconds/deploy_healthcheck_interval_seconds输入,供部署验收阶段使用模块二:systemd 启动后的 readiness / timeout / 状态契约
scripts/deploy/enable_instance.sh中补齐/health轮询systemctl enable --now,还要求GET /health返回{"status":"ok"}systemd_reload_failedsystemd_start_failedsystemd_not_activereadiness_timeoutmissing_dependencyinvalid_argument模块三:provider/model/secret 组合校验
scripts/deploy/setup_instance.sh增加OPENCODE_PROVIDER_ID/OPENCODE_MODEL_ID成对校验scripts/deploy/run_opencode.sh保留 defense in depth,运行时再次校验已知 provider 的必需 secretscripts/deploy/install_release_runtime.sh同步安装 provider helper,保证 release runtime 路径行为一致模块四:文档与测试
scripts/deploy_readme.md,明确新的 deploy 契约、输入项与 exit codedocs/agent_deploy_sop.md,明确非交互 sudo 预检与 JSON 状态输出tests/test_deploy_security_contract.py,覆盖新的部署契约文本基线验证
已执行:
uv run pre-commit run --all-filesuv run pytest关联
Closes #148
Relates to #145