Repository navigation
fix(m8): Runner 安装包代理改走内网 OSS endpoint,消除 spot 公网流出 (#489) - #490
Merged
Merged
Conversation
ZTGolem
added a commit
that referenced
this pull request
Dec 4, 2026
runner_tarball() 之前用公网 endpoint 读取私有 OSS,367 台 spot 每台代理下载 228 MB 都产生一次公网流出。改为 internal=True:阿里云部署自动派生 -internal endpoint,非阿里云部署保持现有 endpoint;spot 仍只访问 API 的 VPC 回调地址。 新增回归测试:公共 endpoint 指向不可达地址,经内网 stub 完整流式下载,证明实现没有回退公网。
ZTGolem
force-pushed
the
agent/issue-489-dev-18bed0bf5aac
branch
from
December 4, 2026 01:24
4019e81 to
372af6a
Compare
This was referenced Dec 4, 2026
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.
This is by an automated agent, not a human.
问题
issue #489:12 月 OSS 账单前 3 天约 ¥42,其中约 ¥40 是公网流出。367 台 spot 实例每台经
/runner/v1/runner-tarball/<version>.tar.gz下载约 228 MB 的 runner 包,而runner_tarball()用公网 endpoint 读取私有 OSS;按 ¥0.50/GB 约 ¥41.9,与账单吻合。改动
backend/app/api/runners.py:runner_tarball()改用object_store_from_settings(settings, internal=True)。阿里云部署自动派生-internalendpoint(S3_INTERNAL_ENDPOINT可覆盖),非阿里云部署保持原 endpoint;spot 实例仍只访问 API 的 VPC 回调地址,不直连 OSS 内网。tests/backend/test_runner_tarball.py:新增回归测试。公共 endpoint 指向127.0.0.1:1(不可达),内网指向本地 S3 stub,断言 HTTP 200、完整内容与Content-Length,证明实现没有回退公网。.agents/flow/issues/m8-runner-tarball-internal-endpoint.*:补 flow issue 三件套(m8,P2,in-progress;成本优化,无功能阻塞),scope 覆盖上述文件。验证
pytest tests/backend/test_runner_tarball.py:8 passed。pytest:通过。372af6a,已 rebase 到main54e8ef1):8/8 通过,含 PostgreSQL 后端测试、docs、flow-offline、flow-online、deployment contract、web 与 runner 契约测试。npm test、npm run verify:docs、npm run verify:flow、PR_TITLE=... node scripts/verify-flow.mjs --diff origin/main:通过。6462974(rebase 前e879861,代码树相同);公共 endpoint 保持不可达):4/4 passed。c832c13f…,Content-Length一致runner_token_invalidrunner_tarball_not_foundrunner_tarball_not_found冒烟环境:
uvicorn app.main:app+ 本地 S3 stub 作为S3_INTERNAL_ENDPOINT,S3_ENDPOINT=http://127.0.0.1:1故意不可达。冒烟测试脚本与 HTML 报告仅保留在本地,不提交仓库。UI 证据
本 PR 只改后端 runner 安装包代理的 OSS 读取路径,不涉及任何前端页面,
prototype原型 UI 对比不适用,因此没有 before/after 截图。部署后验证
2.338.2验证 spot 实例仍能下载 runner 包并注册。Refs #489,不在合入时自动关闭 issue。This PR was produced by dsh-superagent under the ZTGolem account.