feat(p1): OSS 双endpoint分离 — 上传/下载走VPC内网,签名URL走公网 #2085
Reference in New Issue
Block a user
Delete Branch "fix/p1-oss-internal-endpoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
P0 #2084 把 GPU mezzanine transport 从 relay 切到 OSS 后,GPU 编码链路打通(NVENC 1.67s、无 CPU fallback),但实测总渲染 278s。运维逐阶段拆解发现:
根因:
.env.staging里 OSS_ENDPOINT 是公网域名,116 杭州 ECS 应走 VPC internal endpoint(千兆带宽),但代码把同一 endpoint 同时用于 SDK 和 public_url/sign_url,直接改会让外网签名 URL 失效改动(4 文件,-212 行)
oss_internal_endpoint配置 +effective_oss_internal_endpoint属性。阿里云公网域名(oss-cn-.aliyuncs.com)自动推导 -internal 内网域名;MinIO/自定义域名回退公网;可显式覆盖OSS_INTERNAL_ENDPOINTpropertyself.bucket用 internal endpoint 跑所有 SDK 操作(put/get/delete/exists/resumable_upload,VPC 千兆);self.public_bucket用公网 endpoint 仅 sign_url 用。public_url永远是公网域名兼容性
预期效果
验证
CI 通过后 watchtower 自动部署 staging:
OSS initialized: ... dual=yes、internal_ep=oss-cn-hangzhou-internal.aliyuncs.com🚀 预览环境已部署
🗑️ 预览环境已清理
PR #2085 已关闭或合并,对应的预览环境已被清理。