publish
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHelp 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 so the user does not need to install the CLI globally.
uvx harbor帮助用户将Harbor任务或数据集发布到注册表。引导用户完成每一步操作,检查前置条件并在执行发布命令前进行确认。
所有命令均使用,因此用户无需全局安装CLI。
uvx harborPrerequisites
前置条件
-
Auth: Ensure the user is logged in by running. If not logged in, prompt them to run
uvx harbor auth status.uvx harbor auth login -
Task identifiers: All tasks must have asection in their
[task]with a name liketask.toml. If missing, run:<org>/<name>bashuvx harbor task update "<path/to/task>" --org "<org>"To update all tasks in a directory:bashuvx harbor task update "<path/to/tasks>" --org "<org>" --scan
-
身份验证:通过运行确认用户已登录。若未登录,提示用户执行
uvx harbor auth status。uvx harbor auth login -
任务标识符:所有任务的文件中必须包含
task.toml部分,且名称格式为[task]。若缺失,执行以下命令:<org>/<name>bashuvx harbor task update "<path/to/task>" --org "<org>"如需更新目录下的所有任务:bashuvx 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)
dataset.toml1. 初始化数据集清单(若不存在dataset.toml
)
dataset.tomlbash
uvx harbor dataset init "<org>/<dataset>" \
--description "<description>" \
--author "Jane Doe <jane@example.com>"Add 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).
--with-metricAuto-add behavior: If 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.
dataset initbash
uvx harbor dataset init "<org>/<dataset>" \
--description "<description>" \
--author "Jane Doe <jane@example.com>"如果用户需要自定义指标脚本,添加参数。若省略该参数,数据集将使用默认指标(任务的平均奖励,缺失值视为0)。
--with-metric自动添加行为:若在已包含任务的目录中运行,这些任务会自动添加到清单中。初始化完成后,询问用户是否需要添加额外任务——可来自Harbor注册表或其他本地文件夹。
dataset init2. 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 taskSpecific versions: , , or .
org/task@tagorg/task@revisionorg/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>" # 删除任务指定版本:, , or .
org/task@tagorg/task@revisionorg/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 latestbash
uvx harbor sync
uvx harbor sync --upgrade # 同时将远程任务升级至最新版本4. Publish the dataset
4. 发布数据集
bash
uvx harbor publish "<path/to/dataset>"uvx harbor publishbash
uvx harbor publish "<path/to/dataset>"uvx harbor publishPublish options (tasks and datasets)
发布选项(任务和数据集通用)
- : add tags (repeatable).
-t / --tagis always included.latest - : control upload concurrency.
-c / --concurrency - : make public (private by default).
--public - (datasets only): skip publishing tasks in the dataset directory.
--no-tasks
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 --publicAfter publishing
发布后操作
- Visibility can be changed later with /
uvx harbor task visibilityor on https://registry.harborframework.com/.uvx harbor dataset visibility - Run a published dataset with:
bash
uvx harbor run -d "<org>/<dataset>@v1.0" -a "<agent>" -m "<model>"
- 可通过/
uvx harbor task visibility命令或访问https://registry.harborframework.com/ 修改可见性。uvx harbor dataset visibility - 运行已发布数据集的命令:
bash
uvx harbor run -d "<org>/<dataset>@v1.0" -a "<agent>" -m "<model>"