Bohrium Job Management — Bohrium 作业管理
v1通过bohr CLI或open.bohrium.com API管理Bohrium计算任务。使用时机:用户询问提交、列出、杀死或删除Bohrium计算任务,检查任务日志,或监控任务状态。非适用场景:节点管理、镜像管理或项目管理。
运行时依赖
安装命令
点击复制技能文档
SKILL:Bohrium 作业管理概述 在 Bohrium 平台上管理计算作业。优先使用 bohr CLI;仅在 CLI 不支持的高级操作中回退到 API。 身份验证 ACCESS_KEY 和 PROJECT_ID 从 OpenClaw 配置文件 ~/.openclaw/openclaw.json 中读取: "bohrium-job": { "enabled": true, "apiKey": "YOUR_ACCESS_KEY", "env": { "ACCESS_KEY": "YOUR_ACCESS_KEY", "PROJECT_ID": "YOUR_PROJECT_ID" } } OpenClaw 自动将环境变量注入到运行时。bohr CLI 通过 ACCESS_KEY 环境变量进行身份验证。 前提条件: 安装 bohr CLI # macOS /bin/bash -c "$(curl -fsSL https://dp-public.oss-cn-beijing.aliyuncs.com/bohrctl/1.0.0/install_bohr_mac_curl.sh)" # Linux /bin/bash -c "$(curl -fsSL https://dp-public.oss-cn-beijing.aliyuncs.com/bohrctl/1.0.0/install_bohr_linux_curl.sh)" # 验证 source ~/.bashrc # 或 source ~/.zshrc export PATH="$HOME/.bohrium:$PATH" bohr version 安装程序自动配置 OPENAPI_HOST 和 TIEFBLUE_HOST。如果它们不生效,请手动设置: export OPENAPI_HOST=https://open.bohrium.com export TIEFBLUE_HOST=https://tiefblue.dp.tech 提交作业 方法 1:CLI 参数(推荐) bohr job submit \ -m "registry.dp.tech/dptech/deepmd-kit:3.1.1" \ -t "c4_m15_1 NVIDIA T4" \ -c "python train.py" \ -p ./input_dir/ \ --project_id 154 \ -n "my-job-name" 参数: 参数 缩写 必需 描述 --image_address -m 是 全镜像 URL(例如 registry.dp.tech/dptech/xxx:tag) --machine_type -t 是 机器规格 --command -c 是 执行命令 --input_directory -p 否 输入文件目录(默认 ./) --project_id 是 项目 ID --job_name -n 否 作业名称 --log_file -l 否 日志文件路径 --result_path -r 否 自动下载结果路径(仅 /data、/personal、/share) --job_group_id -g 否 作业组 ID(使用 bohr job_group create 创建) --max_run_time 否 最大运行时间(分钟);超时自动终止 --max_reschedule_times 否 异常中断后自动重试次数 --nnode 否 并行计算节点数(默认 1) 方法 2:配置文件(用于复杂场景) bohr job submit -i job.json -p ./input_dir/ 完整的 job.json 示例: { "job_name": "my-training-job", "command": "python train.py --epochs 10", "log_file": "train.log", "backward_files": ["model.pt", "results/"], "project_id": 154, "machine_type": "c4_m15_1 NVIDIA T4", "image_address": "registry.dp.tech/dptech/deepmd-kit:3.1.1", "job_type": "container", "disk_size": 50, "dataset_path": ["/bohr/my-dataset/v1"], "result_path": "/personal", "max_reschedule_times": 2, "max_run_time": 120, "nnode": 1 } job.json 字段参考: 字段 描述 示例 job_name 作业名称 "DeePMD-kit test" command 命令;使用相对路径 "cd se_e2_a && dp train input.json" log_file 日志文件 "train.log" backward_files 下载文件;空 = 保留所有 ["model.pt", "results/"] project_id 项目 ID 154 machine_type 机器规格 "c4_m15_1 NVIDIA T4" image_address 全镜像 URL(不仅仅是名称) "registry.dp.tech/dptech/deepmd-kit:2.1.5-cuda11.6" job_type 必须是 "container" "container" dataset_path 挂载的数据集路径 ["/bohr/my-dataset/v1"] result_path 自动收集结果到数据磁盘 "/personal" max_run_time 最大运行时间(分钟) 120 max_reschedule_times 中断后重试次数 2 disk_size 磁盘大小(GB) 50 重要注意事项 主题 详情 工作目录 Bohrium 自动切换到提取的输入目录;使用相对路径 不要 cd /root/input 实际路径是 /home/input_lbg-{userId}-{jobId}/,不可预测 image_address 格式 必须是全 URL registry.dp.tech/dptech/xxx:tag machine_type 格式 CPU:c2_m4_cpu;GPU:c4_m15_1 NVIDIA T4 WAF 阻塞 如果命令触发 Alibaba Cloud WAF(405),写入脚本,使用 bash run.sh 大文件在 -p 中没有输出?检查是否有大型隐藏文件导致压缩缓慢 自动重试 max_reschedule_times 重试次数在中断后(全重新运行) job_type 必须是 "container";VM 作业自 2023 年以来已弃用 查看作业 bohr job list -n 10 # 最近 10 个 bohr job list -n 5 --json # JSON 输出 bohr job list -r # 运行中 bohr job list -f # 失败 bohr job list -i # 已完成 bohr job list -p # 等待中 bohr job list -j 15954383 # 特定组的作业 作业详情 bohr job describe -j 22153612 --json bohr job describe -j 22153612 -l # 全部详情 查看/下载日志 bohr job log -j 22153612 # 查看 bohr job log -j 22153612 -o ./logs/ # 下载 下载结果 bohr job download -j 22153612 -o ./results/ bohr job_group download -j 15954383 -o ./results/ 管理作业 bohr job terminate 22153612 # 终止(保留结果 -> 已完成) bohr job kill 22153612 # 强制停止(丢弃结果,保留记录) bohr job delete 22153612 # 删除(删除所有) bohr job terminate 22153612 22153613 # 批量