publish

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Help the user publish a Harbor task or dataset to the registry. Walk them through each step, checking prerequisites and confirming before running publish commands.
All commands use
uvx harbor
so the user does not need to install the CLI globally.
帮助用户将Harbor任务或数据集发布到注册表。引导用户完成每一步操作,检查前置条件并在执行发布命令前进行确认。
所有命令均使用
uvx harbor
,因此用户无需全局安装CLI。

Prerequisites

前置条件

  1. Auth: Ensure the user is logged in by running
    uvx harbor auth status
    . If not logged in, prompt them to run
    uvx harbor auth login
    .
  2. Task identifiers: All tasks must have a
    [task]
    section in their
    task.toml
    with a name like
    <org>/<name>
    . If missing, run:
    bash
    uvx harbor task update "<path/to/task>" --org "<org>"
    To update all tasks in a directory:
    bash
    uvx harbor task update "<path/to/tasks>" --org "<org>" --scan
  1. 身份验证:通过运行
    uvx harbor auth status
    确认用户已登录。若未登录,提示用户执行
    uvx harbor auth login
  2. 任务标识符:所有任务的
    task.toml
    文件中必须包含
    [task]
    部分,且名称格式为
    <org>/<name>
    。若缺失,执行以下命令:
    bash
    uvx harbor task update "<path/to/task>" --org "<org>"
    如需更新目录下的所有任务:
    bash
    uvx harbor task update "<path/to/tasks>" --org "<org>" --scan

Publishing a task

发布任务

bash
uvx harbor publish "<path/to/task>"
Publish multiple tasks or all tasks in a directory:
bash
uvx harbor publish "<path/to/task-a>" "<path/to/task-b>"
uvx harbor publish "<path/to/tasks>"
bash
uvx harbor publish "<path/to/task>"
发布多个任务或目录下的所有任务:
bash
uvx harbor publish "<path/to/task-a>" "<path/to/task-b>"
uvx harbor publish "<path/to/tasks>"

Publishing a dataset

发布数据集

1. Initialize the dataset manifest (if no
dataset.toml
exists)

1. 初始化数据集清单(若不存在
dataset.toml

bash
uvx harbor dataset init "<org>/<dataset>" \
  --description "<description>" \
  --author "Jane Doe <jane@example.com>"
Add
--with-metric
if the user needs a custom metric script. If omitted, the dataset uses the default metric (average reward across tasks, with missing values treated as 0).
Auto-add behavior: If
dataset init
is run in a directory that already contains tasks, those tasks are automatically added to the manifest. After init, ask the user if they want to add additional tasks — either from the Harbor registry or from other local folders.
bash
uvx harbor dataset init "<org>/<dataset>" \
  --description "<description>" \
  --author "Jane Doe <jane@example.com>"
如果用户需要自定义指标脚本,添加
--with-metric
参数。若省略该参数,数据集将使用默认指标(任务的平均奖励,缺失值视为0)。
自动添加行为:若在已包含任务的目录中运行
dataset init
,这些任务会自动添加到清单中。初始化完成后,询问用户是否需要添加额外任务——可来自Harbor注册表或其他本地文件夹。

2. Add additional tasks and files (optional)

2. 添加额外任务和文件(可选)

bash
cd "<path/to/dataset>"
uvx harbor add "<path/to/task-a>" "<path/to/task-b>"   # local tasks from elsewhere
uvx harbor add "<path/to/folder>" --scan                 # all tasks in another folder
uvx harbor add org/task-name                             # published tasks from registry
uvx harbor add org/dataset-name                          # all tasks from a published dataset
uvx harbor add metric.py                                 # metric file (same dir as dataset.toml)
uvx harbor remove "<org>/<task-name>"                     # remove a task
Specific versions:
org/task@tag
,
org/task@revision
, or
org/task@sha256:<hash>
.
bash
cd "<path/to/dataset>"
uvx harbor add "<path/to/task-a>" "<path/to/task-b>"   # 来自其他位置的本地任务
uvx harbor add "<path/to/folder>" --scan                 # 其他文件夹中的所有任务
uvx harbor add org/task-name                             # 注册表中的已发布任务
uvx harbor add org/dataset-name                          # 已发布数据集中的所有任务
uvx harbor add metric.py                                 # 指标文件(与dataset.toml同目录)
uvx harbor remove "<org>/<task-name>"                     # 删除任务
指定版本:
org/task@tag
,
org/task@revision
, or
org/task@sha256:<hash>
.

3. Sync digests (if tasks/metrics changed since last publish)

3. 同步摘要(若自上次发布后任务/指标发生变更)

bash
uvx harbor sync
uvx harbor sync --upgrade   # also upgrade remote tasks to latest
bash
uvx harbor sync
uvx harbor sync --upgrade   # 同时将远程任务升级至最新版本

4. Publish the dataset

4. 发布数据集

bash
uvx harbor publish "<path/to/dataset>"
uvx harbor publish
automatically refreshes digests of local tasks in the dataset directory.
bash
uvx harbor publish "<path/to/dataset>"
uvx harbor publish
会自动刷新数据集目录中本地任务的摘要。

Publish options (tasks and datasets)

发布选项(任务和数据集通用)

  • -t / --tag
    : add tags (repeatable).
    latest
    is always included.
  • -c / --concurrency
    : control upload concurrency.
  • --public
    : make public (private by default).
  • --no-tasks
    (datasets only): skip publishing tasks in the dataset directory.
Example:
bash
uvx harbor publish "<path>" -t v1.0 --public
  • -t / --tag
    : 添加标签(可重复使用)。默认始终包含
    latest
    标签。
  • -c / --concurrency
    : 控制上传并发数。
  • --public
    : 设置为公开(默认私有)。
  • --no-tasks
    (仅适用于数据集):跳过发布数据集目录中的任务。
示例:
bash
uvx harbor publish "<path>" -t v1.0 --public

After publishing

发布后操作

  • Visibility can be changed later with
    uvx harbor task visibility
    /
    uvx harbor dataset visibility
    or on https://registry.harborframework.com/.
  • Run a published dataset with:
    bash
    uvx harbor run -d "<org>/<dataset>@v1.0" -a "<agent>" -m "<model>"
  • 可通过
    uvx harbor task visibility
    /
    uvx harbor dataset visibility
    命令或访问https://registry.harborframework.com/ 修改可见性。
  • 运行已发布数据集的命令:
    bash
    uvx harbor run -d "<org>/<dataset>@v1.0" -a "<agent>" -m "<model>"