WDL-第2学

本节主要讲述如何配置Cromwell和运行一个简单的hello world的WDL脚本,主要分下面:
本节内容来自Five minute to Cromwell

  • 2.1 配置Cromwell
  • 2.2 写hello world 的WDL脚本
  • 2.3 检查和运行第一个WDL脚本

2.1 配置Cromwell

本章节下载的是Cromwell 版本 57 中的 cromwell-57.jarwomtool-57.jar

cd your_workspace
mkdir cromwell
cp your_path/Downloads/cromwell-57.jar cromwell/
cp your_path/Downloads/womtool-57.jar cromwell/
cd cromwell/

2.2 写hello world 的WDL脚本

WDL脚本一般包括5个部分:

  • workflow:工作流定义
  • task:工作流包含的任务定义
  • call:调用或触发工作流里面的 task 执行
  • command:task在计算节点上要执行的命令行
  • runtime:task在计算节点上的运行时参数,包括 CPU、内存、docker 镜像等
  • output:task 或 workflow 的输出定义
    wt.png
workflow myWorkflow {
    call myTask
}

task myTask {
    command {
        echo "hello world"
    }
    output {
        String out = read_string(stdout())
    }
}

上述内容保存为myWorkflow.wdl文件,可以先不用关细节,看大致理解,后面章节再详细讲解。

2.3 检查和运行第一个WDL脚本

run mode, 等有一定WDL基础再讲后续的server mode
womtool.jar 可以检查写的WDL是否有问题,但是报错信息没有类似perl或者python那么详细清楚。womtool.jar还有其他作用包括输出json模板,详见

## 调用womtool-57.jar检查wdl
java -jar womtool-57.jar validate myWorkflow.wdl
## 建议安装conda环境来处理
conda install -c bioconda womtool
womtool validate myWorkflow.wdl

cromwell.jar执行WDL脚本

## 运行命令,之前可以先chmod 755 cromwell-57.jar 
java -jar cromwell-57.jar  run myWorkflow.wd

## 输出信息,非常多,重点看output和id部分
[2021-03-24 12:14:22,69] [info] Running with database db.url = jdbc:hsqldb:mem:27d3f637-78fb-4c04-8616-dcb1af4f205f;shutdown=false;hsqldb.tx=mvcc
[2021-03-24 12:14:38,22] [info] Running migration RenameWorkflowOptionsInMetadata with a read batch size of 100000 and a write batch size of 100000
[2021-03-24 12:14:38,26] [info] [RenameWorkflowOptionsInMetadata] 100%
[2021-03-24 12:14:38,54] [info] Running with database db.url = jdbc:hsqldb:mem:e01dfafb-a775-44c0-bd5a-2e892cc29103;shutdown=false;hsqldb.tx=mvcc
[2021-03-24 12:14:39,51] [info] Slf4jLogger started
[2021-03-24 12:14:39,88] [info] Workflow heartbeat configuration:
{
  "cromwellId" : "cromid-7316809",
  "heartbeatInterval" : "2 minutes",
  "ttl" : "10 minutes",
  "failureShutdownDuration" : "5 minutes",
  "writeBatchSize" : 10000,
  "writeThreshold" : 10000
}
[2021-03-24 12:14:39,97] [info] Metadata summary refreshing every 1 second.
[2021-03-24 12:14:40,05] [warn] 'docker.hash-lookup.gcr-api-queries-per-100-seconds' is being deprecated, use 'docker.hash-lookup.gcr.throttle' instead (see reference.conf)
[2021-03-24 12:14:40,06] [info] KvWriteActor configured to flush with batch size 200 and process rate 5 seconds.
[2021-03-24 12:14:40,07] [info] CallCacheWriteActor configured to flush with batch size 100 and process rate 3 seconds.
[2021-03-24 12:14:40,08] [info] WriteMetadataActor configured to flush with batch size 200 and process rate 5 seconds.
[2021-03-24 12:14:40,76] [info] JobExecutionTokenDispenser - Distribution rate: 50 per 1 seconds.
[2021-03-24 12:14:40,91] [info] SingleWorkflowRunnerActor: Version 57
[2021-03-24 12:14:40,93] [info] SingleWorkflowRunnerActor: Submitting workflow
[2021-03-24 12:14:41,01] [info] Unspecified type (Unspecified version) workflow f28db7de-821c-4f82-8084-7a808bc0c781 submitted
[2021-03-24 12:14:41,05] [info] SingleWorkflowRunnerActor: Workflow submitted f28db7de-821c-4f82-8084-7a808bc0c781
[2021-03-24 12:14:41,07] [info] 1 new workflows fetched by cromid-7316809: f28db7de-821c-4f82-8084-7a808bc0c781
[2021-03-24 12:14:41,10] [info] WorkflowManagerActor Starting workflow f28db7de-821c-4f82-8084-7a808bc0c781
[2021-03-24 12:14:41,12] [info] WorkflowManagerActor Successfully started WorkflowActor-f28db7de-821c-4f82-8084-7a808bc0c781
[2021-03-24 12:14:41,12] [info] Retrieved 1 workflows from the WorkflowStoreActor
[2021-03-24 12:14:41,24] [info] WorkflowStoreHeartbeatWriteActor configured to flush with batch size 10000 and process rate 2 minutes.
[2021-03-24 12:14:41,56] [info] MaterializeWorkflowDescriptorActor [f28db7de]: Parsing workflow as WDL draft-2
[2021-03-24 12:14:44,79] [info] MaterializeWorkflowDescriptorActor [f28db7de]: Call-to-Backend assignments: myWorkflow.myTask -> Local
[2021-03-24 12:14:45,78] [info] Not triggering log of token queue status. Effective log interval = None
[2021-03-24 12:14:46,51] [info] WorkflowExecutionActor-f28db7de-821c-4f82-8084-7a808bc0c781 [f28db7de]: Starting myWorkflow.myTask
[2021-03-24 12:14:46,80] [info] Assigned new job execution tokens to the following groups: f28db7de: 1
[2021-03-24 12:14:47,04] [info] BackgroundConfigAsyncJobExecutionActor [f28db7demyWorkflow.myTask:NA:1]: echo "hello world"
[2021-03-24 12:14:47,18] [info] BackgroundConfigAsyncJobExecutionActor [f28db7demyWorkflow.myTask:NA:1]: executing: /bin/bash /Users/liji/cromwell/cromwell-executions/myWorkflow/f28db7de-821c-4f82-8084-7a808bc0c781/call-myTask/execution/script
[2021-03-24 12:14:50,14] [info] BackgroundConfigAsyncJobExecutionActor [f28db7demyWorkflow.myTask:NA:1]: job id: 28617
[2021-03-24 12:14:50,16] [info] BackgroundConfigAsyncJobExecutionActor [f28db7demyWorkflow.myTask:NA:1]: Status change from - to Done
[2021-03-24 12:14:51,65] [info] WorkflowExecutionActor-f28db7de-821c-4f82-8084-7a808bc0c781 [f28db7de]: Workflow myWorkflow complete. Final Outputs:
{
  "myWorkflow.myTask.out": "hello world"
}
[2021-03-24 12:14:51,73] [info] WorkflowManagerActor WorkflowActor-f28db7de-821c-4f82-8084-7a808bc0c781 is in a terminal state: WorkflowSucceededState
[2021-03-24 12:14:58,13] [info] SingleWorkflowRunnerActor workflow finished with status 'Succeeded'.
{
  "outputs": {
    "myWorkflow.myTask.out": "hello world"
  },
  "id": "f28db7de-821c-4f82-8084-7a808bc0c781"
}
[2021-03-24 12:15:00,18] [info] Workflow polling stopped
[2021-03-24 12:15:00,20] [info] 0 workflows released by cromid-7316809
[2021-03-24 12:15:00,20] [info] Shutting down WorkflowStoreActor - Timeout = 5 seconds
[2021-03-24 12:15:00,21] [info] Shutting down WorkflowLogCopyRouter - Timeout = 5 seconds
[2021-03-24 12:15:00,21] [info] Shutting down JobExecutionTokenDispenser - Timeout = 5 seconds
[2021-03-24 12:15:00,22] [info] JobExecutionTokenDispenser stopped
[2021-03-24 12:15:00,22] [info] Aborting all running workflows.
[2021-03-24 12:15:00,24] [info] WorkflowStoreActor stopped
[2021-03-24 12:15:00,24] [info] Shutting down WorkflowManagerActor - Timeout = 3600 seconds
[2021-03-24 12:15:00,24] [info] WorkflowLogCopyRouter stopped
[2021-03-24 12:15:00,25] [info] WorkflowManagerActor All workflows finished
[2021-03-24 12:15:00,25] [info] WorkflowManagerActor stopped
[2021-03-24 12:15:00,76] [info] Connection pools shut down
[2021-03-24 12:15:00,76] [info] Shutting down SubWorkflowStoreActor - Timeout = 1800 seconds
[2021-03-24 12:15:00,76] [info] Shutting down JobStoreActor - Timeout = 1800 seconds
[2021-03-24 12:15:00,77] [info] Shutting down CallCacheWriteActor - Timeout = 1800 seconds
[2021-03-24 12:15:00,77] [info] Shutting down ServiceRegistryActor - Timeout = 1800 seconds
[2021-03-24 12:15:00,77] [info] Shutting down DockerHashActor - Timeout = 1800 seconds
[2021-03-24 12:15:00,77] [info] Shutting down IoProxy - Timeout = 1800 seconds
[2021-03-24 12:15:00,77] [info] CallCacheWriteActor Shutting down: 0 queued messages to process
[2021-03-24 12:15:00,77] [info] SubWorkflowStoreActor stopped
[2021-03-24 12:15:00,77] [info] JobStoreActor stopped
[2021-03-24 12:15:00,77] [info] CallCacheWriteActor stopped
[2021-03-24 12:15:00,78] [info] WriteMetadataActor Shutting down: 0 queued messages to process
[2021-03-24 12:15:00,78] [info] KvWriteActor Shutting down: 0 queued messages to process
[2021-03-24 12:15:00,78] [info] IoProxy stopped
[2021-03-24 12:15:00,78] [info] DockerHashActor stopped
[2021-03-24 12:15:00,79] [info] ServiceRegistryActor stopped
[2021-03-24 12:15:00,88] [info] Database closed
[2021-03-24 12:15:00,88] [info] Stream materializer shut down
[2021-03-24 12:15:00,89] [info] WDL HTTP import resolver closed
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,240评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,328评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,182评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,121评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,135评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,093评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,013评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,854评论 0 273
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,295评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,513评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,678评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,398评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,989评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,636评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,801评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,657评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,558评论 2 352

推荐阅读更多精彩内容