跳到主要内容

任务管理命令:job

查询:list

入口: bohr job list

概要:

Usage:
bohr job list [flags]

Aliases:
list, -ls

Flags:
--csv Output in CSV format
-h, --help help for list
--json Output in JSON format
--yaml Output in YAML format

案例:

bohr job list 
# 查看最近10个job信息(按 Ctrl+c 退出)
bohr job list --csv
#以CSV格式展示最近10个job信息

bohrctl job list

提交:submit

入口: bohr job submit

概要:

Usage:
bohr job submit [flags]

Examples:
$ bohr job submit


Flags:
-c, --command string command
-i, --config_file string config file
-h, --help help for submit
-m, --image_address string image name
-p, --input_file_path string input directory path (default "./")
-g, --job_group_id int job group id
-n, --job_name string job name
-t, --machine_type string machine type
-o, --ondemand ondemand
-f, --platform string platform
--project_id int project id
-r, --result_path string result path
参数缩写必填说明
--command-c任务执行命令
--config_file-i配置预定义文件,如果相同字段在命令行声明则会替换
--image_address-m镜像地址, 根据任务类型不同,选择不同的镜像地址
--input_file_path-p输入文件,例如:-p ./ 表示当前目录(默认是./)
--job_group_id-gjob分组id
--job_name-njob名称
--machine_type-t机型配置
--on_demand-o是否使用抢占式
  • 0: 使用抢占式
  • 1: 使用按量付费
  • --platform-f任务提交到哪个平台
    --result_path-r结果文件自动下载至指定目录,注:数据支持自动下载至 personal 盘或者 share 盘,参数 -r 后指定路径以 /share 或者 /personal 开头
    --project_id项目id, 是您创建的项目ID,可在项目管理中查看
    注意

    这里的使用的的job_group_id和创建任务后得到的JobGroupId不同。job_group_id需要通过通过bohr job_group create去创建任务组ID,来满足多个任务提交到同一个任务组中的需求,

    案例:

    bohr job submit -i job.json -p ./input 
    # 使用job.json下的文件并用input目录下的文件当作输入

    --config_file -i json文件示例

    {
    "job_name": "DeePMD-kit test",
    "command": " cd se_e2_a && dp train input.json > tmp_log 2>&1 && dp freeze -o graph.pb",
    "log_file": "se_e2_a/tmp_log",
    "backward_files": ["se_e2_a/lcurve.out","se_e2_a/graph.pb"],
    "project_id": 0000,
    "machine_type": "c4_m15_1 * NVIDIA T4",
    "job_type": "container",
    "image_address": "registry.dp.tech/dptech/deepmd-kit:2.1.5-cuda11.6"
    }

    删除:delete

    入口:

    bohr job delete

    概要:

    Usage:
    bohr job delete [flags]

    Flags:
    -h, --help help for delete
    -j, --job_id int job id

    参数说明:

    参数缩写说明必填
    --job_id-j删除的job id

    案例:

    $ bohr job delete -j 1235  
    # 删除ID为1235的任务

    提前终止:terminate

    入口:

    bohr job terminate

    概要:

    Usage:
    bohr job terminate [flags]

    Flags:
    -h, --help help for terminate
    -j, --job_id int job id

    参数说明:

    参数缩写说明必填
    --job_id-j提前终止的job id

    案例:

    $ bohr job terminate -j 1235 
    # 提前终止ID为1235的任务

    停止:kill

    入口:

    bohr job kill

    概要:

    Usage:
    bohr job kill [flags]

    Flags:
    -h, --help help for kill
    -j, --job_id int job id

    参数说明:

    参数缩写说明必填
    --job_id-j停止的job id

    案例:

    $ bohr job kill -j 1235 
    # 停止ID为1235的任务

    日志:log

    入口:

    bohr job log

    概要:

    Usage:
    bohr job log [flags]

    Flags:
    -h, --help help for log
    -j, --job_id ints id of the job
    -o, --out string save file location (default "./")

    参数说明:

    参数缩写说明必填
    --job_id-jjob id
    --out-o将日志保存到本地某路径 例如:-o ./ 表示当前目录(默认是./)

    案例:

    $ bohr job log -j 1235 -j 2345 -o /personal
    # 下载Job ID为 1235 和 2345 的日志文件,并且保存到本地的/personal目录下

    下载:download

    入口:

    bohr job download

    概要:

    Usage:
    bohr job download [flags]

    Aliases:
    download, -d

    Flags:
    -h, --help help for download
    -j, --job_id string job_id for downloaded file

    参数说明:

    参数缩写说明必填
    --job_id-j下载的job id

    案例:

    $ bohr job download -j 1235 
    # 下载Job ID 1235的文件

    查看详情:describe

    入口:

    bohr job describe

    概要:

    Usage:
    bohr job describe [flags]

    Flags:
    --csv output with csv format
    -h, --help help for describe
    -j, --job_id ints Job ID(s)
    --json output with json format
    -l, --long Long listing format
    --noheader does not print header information
    --table output with table format
    --yaml output with yaml format

    参数说明:

    参数缩写说明必填
    --job_id-j任务ID
    --long-l是否详细展示任务的所有信息

    案例:

    $ bohr job describe -j 1235 --json 
    # 以json的格式展示Job ID为 1235 和 2345 的任务详情
    $ bohr job describe -j 1235 -l
    # 查看Job ID为1235的任务,并详细展示任务的所有信息