feat(ci): M-2 local cache为主 + registry cache兜底 - 解决缓存导入慢247s问题 #362

Closed
xiaoxia wants to merge 1 commits from ci/local-cache-optimization into develop
Owner

问题

Web构建缓存导入慢(importing cache manifest 247s),根因是Gitea内置registry拉取缓存清单性能差。大blob上传还会触发60秒超时500错误。

方案:两级缓存(M-2)

一级缓存:local cache(主)

  • buildx缓存存储在Runner本地BuildKit容器内
  • 读写都是本地磁盘操作,秒级命中
  • 彻底解决registry性能瓶颈

二级缓存:registry cache(兜底)

  • 保留registry cache作为跨Runner共享的兜底
  • 新Runner/缓存丢失时从registry恢复
  • best effort同步,失败不影响主构建

性能收益预估

  • 缓存导入:247s → <10s(本地读取,预计降95%+)
  • 构建稳定性:registry完全不影响主构建
  • 跨Runner共享:保留,新Runner有兜底

验证

  • CI三门禁通过
  • Staging构建成功
  • 缓存导入耗时显著下降
## 问题 Web构建缓存导入慢(importing cache manifest 247s),根因是Gitea内置registry拉取缓存清单性能差。大blob上传还会触发60秒超时500错误。 ## 方案:两级缓存(M-2) ### 一级缓存:local cache(主) - buildx缓存存储在Runner本地BuildKit容器内 - 读写都是本地磁盘操作,秒级命中 - 彻底解决registry性能瓶颈 ### 二级缓存:registry cache(兜底) - 保留registry cache作为跨Runner共享的兜底 - 新Runner/缓存丢失时从registry恢复 - best effort同步,失败不影响主构建 ### 性能收益预估 - 缓存导入:247s → <10s(本地读取,预计降95%+) - 构建稳定性:registry完全不影响主构建 - 跨Runner共享:保留,新Runner有兜底 ## 验证 - [ ] CI三门禁通过 - [ ] Staging构建成功 - [ ] 缓存导入耗时显著下降
xiaoxia added 1 commit 2026-07-15 12:58:24 +08:00
feat(ci): M-2 local cache为主 + registry cache兜底 - 解决缓存导入慢247s问题
CI/CD Pipeline / Frontend Lint (push) Successful in 51s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 50s
CI/CD Pipeline / Unit Tests (push) Successful in 2m14s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 2m25s
CI/CD Pipeline / Build Staging API Image (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 2m7s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Successful in 2m15s
CI/CD Pipeline / Integration Tests (push) Successful in 1m53s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m7s
167d186c85
xiaoxia closed this pull request 2026-07-15 13:17:48 +08:00
Some checks are pending
CI/CD Pipeline / Frontend Lint (push) Successful in 51s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 50s
CI/CD Pipeline / Unit Tests (push) Successful in 2m14s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 2m25s
CI/CD Pipeline / Build Staging API Image (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 2m7s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Successful in 2m15s
CI/CD Pipeline / Integration Tests (push) Successful in 1m53s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m7s

Pull request closed

Sign in to join this conversation.