LoginSignup
2
0

More than 5 years have passed since last update.

0. cromwell でCWLを実行してみる

Last updated at Posted at 2018-05-30

cromwell

cromwellとは何か?

cromwell はワークフロー(Workflow)の実行エンジン

Broad Institute のワークフロー記述言語WDL(ウィドゥル)で記述されたワークフローの実行エンジン

cromwellの実行に必要な環境

  • Unix環境
  • Java 8のランタイム

今回はこの環境をDockerを利用して構築し、その上でcromwellの動作を確認する

cromwellの実行環境の構築

Dockerが利用可能な環境下でまず、ubuntu:latestを取得

$ docker pull ubuntu:latest

取得したイメージを利用して環境を構築する

$ docker run -it ubuntu:latest

以下はDocker内のubuntu環境で実行する

ubuntuのバージョン確認

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"

念のため、ubuntuの環境をアップデート

# apt update
# apt -y upgrade 

Java 8 ランタイムのインストール

openjdk-8-jreをインストール

# apt-get -y install openjdk-8-jre

javaのバージョンを確認

# java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

ついでに curl をインストールする

# apt-get -y install curl

cromwell を取得

cromwell.jarを取得して、シンボリックリンクを作成

# curl -LO https://github.com/broadinstitute/cromwell/releases/download/32/cromwell-32.jar
# ln -s ./cromwell-32.jar ./cromwell.jar

cromwellの動作を確認する

# java -jar cromwell.jar --version
cromwell 32

サンプルの実行

CromwellのQuick Introductionに記載のWDLの簡単なサンプルを実行してみる

echoコマンドを利用してhello worldの文字列を標準出力に出力するというもの

myWorkflow.wdl
workflow myWorkflow {
    call myTask
}

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

サンプルのワークフローを実行する
(出力結果の一部を省略...)

# java -jar cromwell.jar run myWorkflow.wdl
[2018-05-30 06:10:23,18] [info] Running with database db.url = jdbc:hsqldb:mem:3416168e-ddee-4563-a493-6180bfbc6cda;shutdown=false;hsqldb.tx=mvcc
[2018-05-30 06:10:27,62] [info] Running migration RenameWorkflowOptionsInMetadata with a read batch size of 100000 and a write batch size of 100000
[2018-05-30 06:10:27,63] [info] [RenameWorkflowOptionsInMetadata] 100%
[2018-05-30 06:10:27,70] [info] Running with database db.url = jdbc:hsqldb:mem:4b412c57-0ac1-4334-b7b3-da57f7e88dab;shutdown=false;hsqldb.tx=mvcc
[2018-05-30 06:10:28,06] [info] Slf4jLogger started
[2018-05-30 06:10:28,26] [info] Workflow heartbeat configuration:
{
  "cromwellId" : "cromid-c949801",
  "heartbeatInterval" : "2 minutes",
  "ttl" : "10 minutes",
  "writeBatchSize" : 10000,
  "writeThreshold" : 10000
}
[2018-05-30 06:10:28,51] [info] Metadata summary refreshing every 2 seconds.
[2018-05-30 06:10:28,54] [info] WriteMetadataActor configured to flush with batch size 200 and process rate 5 seconds.
...
...
[56662e52myWorkflow.myTask:NA:1]: Status change from - to Done
[2018-05-30 06:10:35,23] [info] WorkflowExecutionActor-56662e52-0ded-4da9-b69b-23afd8b6595c [56662e52]: Workflow myWorkflow complete. Final Outputs:
{
  "myWorkflow.myTask.out": "hello world"
}
[2018-05-30 06:10:35,25] [info] WorkflowManagerActor WorkflowActor-56662e52-0ded-4da9-b69b-23afd8b6595c is in a terminal state: WorkflowSucceededState
[2018-05-30 06:10:40,06] [info] SingleWorkflowRunnerActor workflow finished with status 'Succeeded'.
{
  "outputs": {
    "myWorkflow.myTask.out": "hello world"
  },
  "id": "56662e52-0ded-4da9-b69b-23afd8b6595c"
}
[2018-05-30 06:10:43,60] [info] Workflow polling stopped
...
...
[2018-05-30 06:10:43,71] [info] Shutdown finished.

wdlの動作が確認できた

今回はここまで:smiley:

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0