更新时间:2024-05-14 GMT+08:00
分享

查询作业

功能描述

查询指定job详情。

命令结构

health nextflow get job ID [flags] 
表1 参数说明

参数

简写

是否必选

说明

ID

不涉及

job id,不指定job-id时,列出当前project的全部job的基本信息。

--type

-t

查询类型,默认detail。此参数用于获取作业列表。

取值:logs、detail、reports 。

  • logs:获取job日志。
  • detail:获取job详情。
  • reports:获取job报告 。

--sortDir

-d

排序规则,按创建时间排序,默认DESC。此参数用于获取作业列表。

取值:DESC、ASC。

--sortKey

-y

指定需要排序的key,如:create_time。此参数用于获取作业列表。

取值:create_time,finish_time,name,status,user_name,workflow_name

--limit

-l

代表当次请求获取的最大条数。此参数用于获取作业列表。

默认值:100。

--offset

-o

代表从哪个位置开始。默认为0。此参数用于获取作业列表。

--jobName

-j

作业名。此参数用于获取作业列表。

--labels

-a

按标签筛选列表,标签间用, 分隔。例子:label1,label2。此参数用于获取作业列表。

--status

-s

作业状态。此参数用于获取作业列表。

取值:CANCELLED,COMPLETED,FAILED,RUNNING,SUBMITTED,UNKNOWN

--workflowName

-w

流程名。此参数用于获取作业列表。

--userName

-u

用户名。此参数用于获取作业列表。

--createStartTime

-c

最小创建时间,格式:YYYY-MM-DD HH:MM:SS。例子:"2006-01-02 15:04:05"。此参数用于获取作业列表。

--createEndTime

-e

最大创建时间,格式:YYYY-MM-DD HH:MM:SS。例子:"2006-01-02 15:04:05"。此参数用于获取作业列表。

--finishStartTime

-f

最小完成时间,格式:YYYY-MM-DD HH:MM:SS。例子:"2006-01-02 15:04:05"。此参数用于获取作业列表。

--finishEndTime

-m

最大完成时间,格式:YYYY-MM-DD HH:MM:SS。例子:"2006-01-02 15:04:05"。此参数用于获取作业列表。

命令示例

  • 获取作业列表
     health nextflow get job --limit 2 --offset 0 --sortDir DESC --sortKey create_time --jobName j1 --labels "a"  --status "SUBMITTED" --workflowName "h5" --userName "ei_eihealth_01" --createStartTime "2023-03-07 07:47:54"
    
     {
            "jobs": [
                    {
                            "id": "a37c22fc-0c8f-4ca2-a354-97f997a5ab96",
                            "name": "j1",
                            "description": "htest",
                            "labels": [
                                    "a",
                                    "b",
                                    "c"
                            ],
                            "status": "SUBMITTED",
                            "has_ignore_failed_tasks": false,
                            "create_time": "2023-03-07T07:47:54Z",
                            "failed_message": "",
                            "failed_reason": "",
                            "user_name": "ei_eihealth_01",
                            "workflow_name": "h5",
                            "workflow_id": "113b2ee6-bcb3-11ed-b7f6-fa163e504fdd"
                    }
            ],
            "count": 4
    }
  • 按创建时间由小到大获取作业列表
    health  nextflow  get job  --sortKey "create_time" --sortDir ASC
    
     {
            "jobs": [
                    {
                            "id": "a37c22fc-0c8f-4ca2-a354-97f99xxx",
                            "name": "j1",
                            "description": "htest",
                            "labels": [
                                    "a",
                                    "b",
                                    "c"
                            ],
                            "status": "SUBMITTED",
                            "has_ignore_failed_tasks": false,
                            "create_time": "2023-03-07T07:47:54Z",
                            "failed_message": "",
                            "failed_reason": "",
                            "user_name": "ei_eihealth_01",
                            "workflow_name": "h5",
                            "workflow_id": "113b2ee6-bcb3-11ed-b7f6-fa1xxx"
                    },
                    {
                            "id": "020cf2a1-36ca-4c2e-9be6-aa070325f2e5",
                            "name": "j1",
                            "description": "htest",
                            "labels": [
                                    "d"
                            ],
                            "status": "SUBMITTED",
                            "has_ignore_failed_tasks": false,
                            "create_time": "2023-03-07T09:44:44Z",
                            "failed_message": "",
                            "failed_reason": "",
                            "user_name": "ei_eihealth_01",
                            "workflow_name": "h5",
                            "workflow_id": "113b2ee6-bcb3-11ed-b7f6-fa163xxx"
                    }
            ],
            "count": 4
    }
  • 获取作业日志
    # 获取作业日志
    health nextflow get job "a37c22fc-0c8f-4ca2-a354-97f997a5ab96" -t logs
    {
            "count": 14,
            "logs": [
                    "Mar-07 15:48:04.575 [main] DEBUG nextflow.cli.Launcher - $> nextflow -log ./e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/nextflow.log run ./e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/h5/m.nf -name q07ae83e-b12c-4137-b417-0fa3ac61094c -w /nextflow/__nextflow_work__/e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c -c ./e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/nextflow.config -params-file ./e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/params.json -with-trace -with-report -with-timeline -with-dag -with-weblog 'http://127.0.0.1:8445/v1.0/nextflow/web-log'",
                    "Mar-07 15:48:05.285 [main] INFO  nextflow.cli.CmdRun - N E X T F L O W  ~  version 22.10.6",
                    "Mar-07 15:48:05.309 [main] DEBUG nextflow.plugin.PluginsFacade - Setting up plugin manager > mode=prod; embedded=false; plugins-dir=/home/service/.nextflow/plugins; core-plugins: nf-amazon@1.11.3,nf-azure@0.14.2,nf-codecommit@0.1.2,nf-console@1.0.4,nf-ga4gh@1.0.4,nf-google@1.4.5,nf-tower@1.5.6,nf-wave@0.5.3",
                    "Mar-07 15:48:05.390 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Enabled plugins: []",
                    "Mar-07 15:48:05.415 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Disabled plugins: []",
                    "Mar-07 15:48:05.420 [main] INFO  org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode",
                    "Mar-07 15:48:05.718 [main] INFO  org.pf4j.AbstractPluginManager - No plugins",
                    "Mar-07 15:48:05.869 [main] DEBUG nextflow.scm.ProviderConfig - Using SCM config path: /home/service/.nextflow/scm",
                    "Mar-07 15:48:05.880 [main] DEBUG nextflow.cli.Launcher - Operation aborted",
                    "nextflow.exception.AbortOperationException: Cannot find script file: ./e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/h5/m.nf",
                    "\tat nextflow.cli.CmdRun.getScriptFile(CmdRun.groovy:448)",
                    "\tat nextflow.cli.CmdRun.run(CmdRun.groovy:300)",
                    "\tat nextflow.cli.Launcher.run(Launcher.groovy:487)",
                    "\tat nextflow.cli.Launcher.main(Launcher.groovy:646)"
            ],
            "download_url": "https://xxx/__nextflow_run__/e6dcd289-dadb-48d9-b53b-e0c6c256932e/q07ae83e-b12c-4137-b417-0fa3ac61094c/nextflow.log?AccessKeyId=VQ52M3Q7I4WPWPDUB5XZ&Expires=1678190993&Signature=oRiADod2TExnsP56Q9k%2FSgm4h9g%3D"
    }
  • 获取作业详情
    # 获取作业详情
    health nextflow get job "a37c22fc-0c8f-4ca2-a354-97f997a5ab96"
    {
            "id": "a37c22fc-0c8f-4ca2-a354-97f997axxx",
            "name": "j1",
            "description": "htest",
            "labels": [
                    "a",
                    "b",
                    "c"
            ],
            "status": "SUBMITTED",
            "has_ignore_failed_tasks": false,
            "create_time": "2023-03-07T07:47:54Z",
            "failed_message": "",
            "failed_reason": "",
            "workflow_name": "h5",
            "workflow_id": "113b2ee6-bcb3-11ed-b7f6-fa163e5xxx",
            "command_line": "nextflow run m.nf",
            "params": [],
            "config_context": ""
    }

相关文档