question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cwltool uses both default and job_order paths

See original GitHub issue

Long story short:

It appears as though cwltool validates that both the default and job_order paths exist. Ideally, it would only validate the job_order paths if provided, the default paths if not provided.

Long story:

A toy command and file tree to demonstrate this follows Required files: https://gist.github.com/denis-yuen/a1d36345ecc4bdc1580a

.
β”œβ”€β”€ 8e888694-9c56-4529-a750-d6bfbd4a74e7.txt -> inputs/0bf6ab9f-83a8-4b72-ad67-460eb696bd64/ref_file_2
β”œβ”€β”€ b4cdad91-676a-446c-a635-57453f17617a.txt -> inputs/d2816fb8-7773-4b2a-bd31-ee4a7efa8e04/ref_file_1
β”œβ”€β”€ configs
β”œβ”€β”€ foo.json
β”œβ”€β”€ image-descriptor.cwl
β”œβ”€β”€ inputs
β”‚   β”œβ”€β”€ 0bf6ab9f-83a8-4b72-ad67-460eb696bd64
β”‚   β”‚   └── ref_file_2
β”‚   β”œβ”€β”€ 0e129840-fa77-4cec-a885-19b1e538507a
β”‚   β”‚   └── hello_input
β”‚   └── d2816fb8-7773-4b2a-bd31-ee4a7efa8e04
β”‚       └── ref_file_1
β”œβ”€β”€ logs
β”œβ”€β”€ node-engine.cwl
β”œβ”€β”€ outputs
β”‚   └── hello-output.txt
└── working

When I run the following command, it executes successfully. ( cwltool --outdir /home/dyuen/consonance/consonance-arch/./datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/outputs/ image-descriptor.cwl foo.json )

However, note the symbolic links in the root. These correspond to the default paths in image-descriptor.cwl which should be overridden by the entries in foo.json.

But when I delete those two links, cwltool dies with the following validation error.

/usr/local/bin/cwltool 1.0.20151013173827
Tool definition failed validation:
While checking field `inputs`
  While checking object `file:///home/dyuen/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/image-descriptor.cwl#ref_file_1`
    While checking field `default`
      Field `path` contains undefined reference to `file:///home/dyuen/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/8e888694-9c56-4529-a750-d6bfbd4a74e7.txt`
  While checking object `file:///home/dyuen/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/image-descriptor.cwl#ref_file_2`
    While checking field `default`
      Field `path` contains undefined reference to `file:///home/dyuen/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/b4cdad91-676a-446c-a635-57453f17617a.txt`

Note that its validating the default paths, not the paths provided in foo.json. However, if I move the files referenced in the foo.json to match the defaults.

.
β”œβ”€β”€ 8e888694-9c56-4529-a750-d6bfbd4a74e7.txt
β”œβ”€β”€ b4cdad91-676a-446c-a635-57453f17617a.txt
β”œβ”€β”€ configs
β”œβ”€β”€ foo.json
β”œβ”€β”€ hello-output.txt
β”œβ”€β”€ image-descriptor.cwl
β”œβ”€β”€ inputs
β”‚   └── 0e129840-fa77-4cec-a885-19b1e538507a
β”‚       └── hello_input
β”œβ”€β”€ logs
β”œβ”€β”€ node-engine.cwl
β”œβ”€β”€ outputs
└── working

Then it dies saying it can’t find the paths in the foo.json

dyuen@odl-dyuen:~/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995$ cwltool --outdir /home/dyuen/consonance/consonance-arch/./datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/outputs/ image-descriptor.cwl foo.json
/usr/local/bin/cwltool 1.0.20151013173827
Unknown hint file:///home/dyuen/consonance/consonance-arch/datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/ResourceRequirement
Got workflow error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cwltool/main.py", line 153, in single_job_executor
    for r in jobiter:
  File "/usr/local/lib/python2.7/dist-packages/cwltool/draft2tool.py", line 127, in job
    builder.pathmapper = self.makePathMapper(reffiles, input_basedir, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cwltool/draft2tool.py", line 62, in makePathMapper
    return DockerPathMapper(reffiles, input_basedir)
  File "/usr/local/lib/python2.7/dist-packages/cwltool/pathmapper.py", line 73, in __init__
    st = os.lstat(deref)
OSError: [Errno 2] No such file or directory: '/home/dyuen/consonance/consonance-arch/./datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/inputs/0bf6ab9f-83a8-4b72-ad67-460eb696bd64/ref_file_2'
Workflow error:
  [Errno 2] No such file or directory: '/home/dyuen/consonance/consonance-arch/./datastore/launcher-03ad4441-c074-4893-b5bd-6d14aabb4995/inputs/0bf6ab9f-83a8-4b72-ad67-460eb696bd64/ref_file_2'

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mr-ccommented, Jul 7, 2017

Fixed, thanks all!

0reactions
kapilkd13commented, Mar 5, 2017

Hi, Actually when i saw draft-2 I created my own code to replicate this problem, removing docker,requirements,hints to make it more simpler.πŸ˜ƒ here I made a PR to solve this issue. https://github.com/common-workflow-language/cwltool/pull/320

Read more comments on GitHub >

github_iconTop Results From Across the Web

cwltool/job.py at main Β· common-workflow-language ... - GitHub
Common Workflow Language reference implementation. Contribute to common-workflow-language/cwltool development by creating an account on GitHub.
Read more >
Common Workflow Language reference implementation
Path prefix for intermediate output directories. Defaults to the value of –tmpdir-prefix. 4. Chapter 1. cwltool Command Line OptionsΒ ...
Read more >
Common Workflow Language (CWL) Command Line Tool ...
PATH may be inherited from the parent process, except when run in a container that provides its own PATH . Variables defined by...
Read more >
cwltool - Refefence executor for Common Workflow Language
If the `inputs_object` has a `cwl:tool` field indicating the path or URL to ... Docker container used by jobs after they exit (default)...
Read more >
cwltool - PyPI
By default, cwltool searches https://dockstore.org/ . Use --add-tool-registry to add other registries to the search path. For example cwltool quay.io/Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found