Skip to content

ui-browser.yml setup-uv 加 prune-cache: false——共享 CI 宿主上 prune 会删掉其它 job 在用的 uv 临时环境(实录 gate-hub#1418) #214

Closed

Description

@zj1123581321

问题:ui-browser.yml 的 setup-uv 默认 prune-cache 会在 job 结束时删掉 VM201 共享 uv 缓存里其它 job 正在使用的临时环境

实录(2026-10-09)

本仓 ui-browser.yml 的 chromium-regression job(runs-on self-hosted ci 池)用:

- uses: astral-sh/setup-uv@v8.1.0
  with:
    enable-cache: true

setup-uv 的 prune-cache 默认 "true"(其 action.yml:62-64)→ job 结束 post 步骤执行 uv cache prune --ci。

uv 的 cache prune 会无条件删除 builds-v0 下全部条目(astral-sh/uv crates/uv-cache/src/lib.rs:「Third, remove all temporary build environments」,无占用检查)。CI 池宿主的 uv 缓存是全部 slot 共享的 bind mount,于是本仓这个 job 结束时把同一宿主上其它 job 正在使用的 uv run --with 临时 venv 一并删掉——实录:gate-hub PR #1417 的 quality job 225 项测试 FileNotFoundError(全部指向被删的 builds-v0/.tmpMzQjSl/bin/python),完整根因取证见 zlxlabs/gate-hub#1418。

建议

setup-uv 加一行 prune-cache: false:

- uses: astral-sh/setup-uv@v8.1.0
  with:
    enable-cache: true
    prune-cache: false

理由:

  • uv cache prune --ci 在共享宿主缓存上的唯一正确性杀伤面就是 builds-v0(gate-hub 侧会另做 per-job 隔离根治);关闭它同时避免每次 job 结束把共享 unzipped wheels 删冷,其它仓的暖缓存收益保得住。
  • 本仓自己的缓存寿命不受影响:uv cache prune 本来就只该作用于「缓存属于本 job 独占」的 hosted runner 场景。

Activity

  1. added
    优先级:P1影响开发/验收/交付效率,或阻塞上游流程
    落点:本仓修复代码在本仓 git 跟踪路径内
    on Oct 10, 2026
  2. zj1123581321 commented on Oct 10, 2026

    @zj1123581321
    CollaboratorAuthor

    分诊核实(2026-10-10):.github/workflows/ui-browser.yml:18-20 的 setup-uv 仍只有 enable-cache: true、无 prune-cache 覆盖(默认 true),单子有效。定 P1:已实录打爆共享宿主上其它 job(gate-hub#1417 quality 全量 FileNotFoundError)。已派 quick 卡补 prune-cache: false,合并后按谓词(workflow 文件含该行)验证关单。

  3. zj1123581321 commented on Oct 10, 2026

    @zj1123581321
    CollaboratorAuthor

    已修复并合并,按谓词验证关单。

    • PR 关闭 ui-browser setup-uv 的 prune-cache 保护共享 CI 宿主 #220(merge commit 32284f7),卡 vta-261010-214-prune(grok-pi,quick)
    • 谓词核验(origin/main @32284f70):ui-browser.yml:20-21 现为
      enable-cache: true
      prune-cache: false
      
      ——setup-uv 的 post 步骤不再执行 uv cache prune --ci,共享宿主上其它 job 的 builds-v0 临时环境不再被本 job 删除(gate-hub#1418 机理关断)
    • 验证链:yaml.safe_load 解析绿、红验(删行 grep 转红 exit=1)、PR ready 后完整 gate SUCCESS(run 38018501753)、Browser regression attempt 2 SUCCESS(首跑撞 15min 超时+网络劣化窗口,annotation "exceeded the maximum execution time of 15m0s",重跑自愈,与改动无关)
    • 遗留观察:per-job 缓存隔离根治在 gate-hub 侧(本单正文原注),不落本仓
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    优先级:P1影响开发/验收/交付效率,或阻塞上游流程落点:本仓修复代码在本仓 git 跟踪路径内

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions