WDL-第2學(xué)

本節(jié)主要講述如何配置Cromwell和運(yùn)行一個(gè)簡(jiǎn)單的hello world的WDL腳本现使,主要分下面:
本節(jié)內(nèi)容來(lái)自Five minute to Cromwell

  • 2.1 配置Cromwell
  • 2.2 寫(xiě)hello world 的WDL腳本
  • 2.3 檢查和運(yùn)行第一個(gè)WDL腳本

2.1 配置Cromwell

本章節(jié)下載的是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 寫(xiě)hello world 的WDL腳本

WDL腳本一般包括5個(gè)部分:

  • workflow:工作流定義
  • task:工作流包含的任務(wù)定義
  • call:調(diào)用或觸發(fā)工作流里面的 task 執(zhí)行
  • command:task在計(jì)算節(jié)點(diǎn)上要執(zhí)行的命令行
  • runtime:task在計(jì)算節(jié)點(diǎn)上的運(yùn)行時(shí)參數(shù)磨淌,包括 CPU或辖、內(nèi)存氯夷、docker 鏡像等
  • output:task 或 workflow 的輸出定義
    wt.png
workflow myWorkflow {
    call myTask
}

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

上述內(nèi)容保存為myWorkflow.wdl文件,可以先不用關(guān)細(xì)節(jié)雷客,看大致理解裙秋,后面章節(jié)再詳細(xì)講解。

2.3 檢查和運(yùn)行第一個(gè)WDL腳本

run mode梁呈, 等有一定WDL基礎(chǔ)再講后續(xù)的server mode
womtool.jar 可以檢查寫(xiě)的WDL是否有問(wèn)題婚度,但是報(bào)錯(cuò)信息沒(méi)有類似perl或者python那么詳細(xì)清楚。womtool.jar還有其他作用包括輸出json模板官卡,詳見(jiàn)

## 調(diào)用womtool-57.jar檢查wdl
java -jar womtool-57.jar validate myWorkflow.wdl
## 建議安裝conda環(huán)境來(lái)處理
conda install -c bioconda womtool
womtool validate myWorkflow.wdl

cromwell.jar執(zhí)行WDL腳本

## 運(yùn)行命令蝗茁,之前可以先chmod 755 cromwell-57.jar 
java -jar cromwell-57.jar  run myWorkflow.wd

## 輸出信息,非常多寻咒,重點(diǎn)看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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末哮翘,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子毛秘,更是在濱河造成了極大的恐慌饭寺,老刑警劉巖,帶你破解...
    沈念sama閱讀 216,372評(píng)論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件叫挟,死亡現(xiàn)場(chǎng)離奇詭異艰匙,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)抹恳,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門旬薯,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人适秩,你說(shuō)我怎么就攤上這事绊序∷队撸” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,415評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵骤公,是天一觀的道長(zhǎng)抚官。 經(jīng)常有香客問(wèn)我,道長(zhǎng)阶捆,這世上最難降的妖魔是什么凌节? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,157評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮洒试,結(jié)果婚禮上倍奢,老公的妹妹穿的比我還像新娘。我一直安慰自己垒棋,他們只是感情好卒煞,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,171評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著叼架,像睡著了一般畔裕。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上乖订,一...
    開(kāi)封第一講書(shū)人閱讀 51,125評(píng)論 1 297
  • 那天扮饶,我揣著相機(jī)與錄音,去河邊找鬼乍构。 笑死甜无,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的哥遮。 我是一名探鬼主播岂丘,決...
    沈念sama閱讀 40,028評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼昔善!你這毒婦竟也來(lái)了元潘?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 38,887評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤君仆,失蹤者是張志新(化名)和其女友劉穎翩概,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體返咱,經(jīng)...
    沈念sama閱讀 45,310評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡钥庇,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,533評(píng)論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了咖摹。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片评姨。...
    茶點(diǎn)故事閱讀 39,690評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出吐句,到底是詐尸還是另有隱情胁后,我是刑警寧澤,帶...
    沈念sama閱讀 35,411評(píng)論 5 343
  • 正文 年R本政府宣布嗦枢,位于F島的核電站攀芯,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏文虏。R本人自食惡果不足惜侣诺,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,004評(píng)論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望氧秘。 院中可真熱鬧年鸳,春花似錦、人聲如沸丸相。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,659評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)已添。三九已至妥箕,卻和暖如春滥酥,著一層夾襖步出監(jiān)牢的瞬間更舞,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,812評(píng)論 1 268
  • 我被黑心中介騙來(lái)泰國(guó)打工坎吻, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留缆蝉,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,693評(píng)論 2 368
  • 正文 我出身青樓瘦真,卻偏偏與公主長(zhǎng)得像刊头,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子诸尽,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,577評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容