Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cwl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

cwl-inspector

Build Status

cwl-inspector provides a handy way to inspect properties of tools or workflows written in Common Workflow Language

Requirements

  • Ruby 2.4.1 or later

Running examples

Input: echo.cwl

class: CommandLineTool
cwlVersion: v1.0
id: echo_cwl
baseCommand:
  - cowsay
inputs:
  - id: input
    type: string?
    inputBinding:
      position: 0
    label: Input string
    doc: This is an input string
outputs:
  output:
    type: stdout
stdout: output
requirements:
  - class: DockerRequirement
    dockerPull: docker/whalesay

show a property named 'cwlVersion'

$ ./inspector.rb echo.cwl .cwlVersion
--- v1.0

show a nested property

$ ./inspector.rb echo.cwl .requirements.0.class
--- DockerRequirement

You can access an input parameter by using its index (specified by position field) or its id.

$ ./inspector.rb echo.cwl .inputs.0.label
--- Input string

or

$ ./cwl-inspector.rb echo.cwl .inputs.input.label
--- Input string

show keys in the specified property

$ ./inspector.rb echo.cwl 'keys(.)'
---
- inputs
- outputs
- class
- id
- requirements
- cwlVersion
- baseCommand
- stdout

show the command to run a given cwl file

$ ./inspector.rb echo.cwl commandline
docker run -i --read-only --rm --workdir=/private/var/spool/cwl --env=HOME=/private/var/spool/cwl --env=TMPDIR=/tmp --user=501:20 -v /Users/tom-tan/cwl-inspector/examples/echo:/private/var/spool/cwl -v /tmp:/tmp docker/whalesay cowsay > /Users/tom-tan/cwl-inspector/examples/echo/output

You can also specify the parameter to show the command with instantiated parameters.

$ cat inputs.yml
input: Hello!
$ ./inspector.rb echo.cwl commandline -i inputs.yml
docker run -i --read-only --rm --workdir=/private/var/spool/cwl --env=HOME=/private/var/spool/cwl --env=TMPDIR=/tmp --user=501:20 -v /Users/tom-tan/cwl-inspector/examples/echo:/private/var/spool/cwl -v /tmp:/tmp docker/whalesay cowsay 'Hello!' > /Users/tom-tan/cwl-inspector/examples/echo/output

Dockerized cwl-inspector

You can use ttanjo/cwl-inspector image. This image is built by Travis CI.

$ cat echo.cwl | docker run --rm -i ttanjo/cwl-inspector:v0.0.6 - .cwlVersion
--- v1.0

using job parameter file

$ cwltool --make-template echo.cwl > echo.yml
$ cat echo.yml
input: a_string  # type "string" (optional)
$ cat echo.cwl | docker run --rm -i -v $PWD/echo.yml:/workdir/echo.yml --workdir=/workdir ttanjo/cwl-inspector:v0.0.6 -i echo.yml - commandline
env HOME='/workdir' TMPDIR='/tmp' /bin/sh -c 'cd ~ && "cowsay" "a_string"' > /workdir/output

License

This software is released under the MIT License.

The following file in examples is copied from common-workflow-language/common-workflow-language and is released under Apache 2.0 License.

About

This tool provides a handy way to inspect properties of tools or workflows written in Common Workflow Language

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.