Skip to content

Packaging: 机器人 mesh 切换至 HF 下载与用户缓存,wheel 瘦身(#1326 子任务 2) #1422

Description

@TATP-233

Parent: #1326(发布方案子任务 2/3,依赖:子任务 1 包布局闭环,后续:发布工作流)
Work type: implementation
Area: packaging / assets

一句话问题

把 git 中 140.7 MiB 的机器人 mesh/纹理切换到仓库已有的 Hugging Face 下载机制(用户可写缓存),wheel 只保留 XML 与小体积元数据。

背景事实(#1326 复核结论)

  • git 追踪的 src/unilab/assets/ 共 252 个文件、140.7 MiB:g1 52.3 / go2 31.8 / a2 14.1 / allegro_hand 12.2 / sharpa_wave 11.1 / go1 9.9 / go2_arm 8.8 MiB(49 个 XML + 182 个 mesh/纹理);对 34880c7a 的 clean build 实测 wheel 55,860,217 bytes。
  • src/unilab/assets/hub.py 已实现 motions / caches / checkpoints 三类资产的 HF 下载;assets/pull.py + unilab-pull-assets 已覆盖 microduck / x2 / t800(这三个机器人在 git 中占用 ≈ 0)。本子任务扩展既有机制,无需新建基础设施。
  • 许可证先例:robots/microduck/LICENSE.pollen-robotics.txtrobots/t800/LICENSE.engineai.txt 已随资产分发。
  • 该体量超出 PyPI 合理包体积;HF 缓存路线同时满足仓库的 cold-path asset access 原则(热路径不解析 asset)。

In scope

  • hub.py 下载机制扩展到 g1 / go2 / a2 / allegro_hand / sharpa_wave / go2_arm(约 100 行);unilab-pull-assets 同步覆盖。
  • uv_build exclude 规则,wheel/sdist 排除大体积 mesh/纹理(约 10 行);XML 与小型元数据保留在包内。
  • 缓存目录约定(HF cache 或 ~/.cache/unilab),首次使用自动下载、离线复用缓存;相应文档与错误提示。
  • 被移出 git 的资产随包附带 LICENSE 文件一并托管到 HF。

Non-goals

Owner 与预计改动

Owner layer 为 assets + build 配置。预计:约 6 个文件,净手写约 120 行,1 个 PR。创建或更新 PR 前在最终 head 运行 make test-all

Acceptance criteria

  • uv build 产物清单不含大体积 mesh/纹理,wheel 体积 < 20 MB。
  • 干净环境(无本地缓存)首次运行涉及 g1/go2 等机器人的任务时自动下载并成功加载;二次运行离线命中缓存。
  • make test-all 通过;unilab-pull-assets 支持全部受影响机器人。

Stop conditions

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions