Wednesday, November 11, 2020

Running a simple CWL workflow with Toil

 These few weeks I was evaluating several workflow composers. Toil turned out to be an impressive implementation of CWL. It is easy to install Toil and run CWL workflows in it.

$ pip install toil[all]

Then define your workflow in a cwl file and your job in a YAML file. Then run it with toil-cwl-runner.

$ toil-cwl-runner example.cwl example-job.yaml
[2020-11-11T10:47:04-0500] [MainThread] [I] [cwltool] Resolved 'example.cwl' to 'file:///Users/pradeeban/Desktop/example.cwl'
[2020-11-11T10:47:05-0500] [MainThread] [I] [toil] Running Toil version 4.2.0-3aa1da130141039cb357efe36d7df9b9f6ae9b5b on host Pradeebans-MBP.attlocal.net.
[2020-11-11T10:47:05-0500] [MainThread] [I] [toil.leader] Issued job 'file:///Users/pradeeban/Desktop/example.cwl' echo kind-file_Users_pradeeban_Desktop_example.cwl/instance-6u5hrmz7 with job batch system ID: 0 and cores: 1, disk: 3.0 G, and memory: 2.0 G
[2020-11-11T10:47:06-0500] [MainThread] [I] [toil.worker] Redirecting logging to /var/folders/vz/hv1vsbpx21322d4x12xytw9c0000gn/T/node-063409e9-4e1a-4c34-a274-73c1b4d50f05-154505284860679/tmp7wlroir7/worker_log.txt
[2020-11-11T10:47:06-0500] [MainThread] [I] [toil.leader] Job ended: 'file:///Users/pradeeban/Desktop/example.cwl' echo kind-file_Users_pradeeban_Desktop_example.cwl/instance-6u5hrmz7
[2020-11-11T10:47:06-0500] [MainThread] [I] [toil.leader] 0 jobs are running, 0 jobs are issued and waiting to run
[2020-11-11T10:47:13-0500] [MainThread] [I] [toil.leader] Finished toil run successfully.

Workflow Progress 100%|████████████| 1/1 (0 failures) [00:01<00:00, 0.95 jobs/s]
{
"output": {
"location": "file:///Users/pradeeban/Desktop/output.txt",
"basename": "output.txt",
"nameroot": "output",
"nameext": ".txt",
"class": "File",
"checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b",
"size": 13
}
}[2020-11-11T10:47:13-0500] [MainThread] [I] [toil.common] Successfully deleted the job store: FileJobStore(/var/folders/vz/hv1vsbpx21322d4x12xytw9c0000gn/T/tmp4mplbec4)

No comments:

Post a Comment

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.