HTTP imports - import behaviour unclear
See original GitHub issueExpected Behavior
I’m just trying to test out HTTP(S) imports as mentioned in https://www.commonwl.org/v1.0/SchemaSalad.html#Import
I’m expecting cwltool --validate
to say it’s valid
Here’s my process for trying it out:
FROM python:3.9.7
RUN pip3 install cwltool==3.1.20210816212154
RUN git clone https://github.com/rabix/sbpack.git
RUN cwltool --validate sbpack/tests/workflows/wf5.cwl
#RUN sed -i 's/$import: ..\/types\/recursive.yml/$import: https:\/\/raw.githubusercontent.com\/rabix\/sbpack\/master\/tests\/types\/recursive.yml/g' sbpack/tests/workflows/wf5.cwl
RUN sed -i 's/$import: ..\/types\/recursive.yml/$import: "https:\/\/raw.githubusercontent.com\/rabix\/sbpack\/master\/tests\/types\/recursive.yml"/g' sbpack/tests/workflows/wf5.cwl
RUN cwltool --validate sbpack/tests/workflows/wf5.cwl
Actual Behavior
$ docker build .
[+] Building 3.7s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 628B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.9.7 1.0s
=> [1/6] FROM docker.io/library/python:3.9.7@sha256:46a1f3fd3d713fc9151753a6a75da327d1c872152ace16e8b3225458f8754d07 0.0s
=> CACHED [2/6] RUN pip3 install cwltool==3.1.20210816212154 0.0s
=> CACHED [3/6] RUN git clone https://github.com/rabix/sbpack.git 0.0s
=> CACHED [4/6] RUN cwltool --validate sbpack/tests/workflows/wf5.cwl 0.0s
=> [5/6] RUN sed -i 's/$import: ..\/types\/recursive.yml/$import: "https:\/\/raw.githubusercontent.com\/rabix\/sbpack\/master\/tests\/types\/recursive.yml"/g' sbpack/tests/workflows/wf5.cwl 0.5s
=> ERROR [6/6] RUN cwltool --validate sbpack/tests/workflows/wf5.cwl 2.2s
------
> [6/6] RUN cwltool --validate sbpack/tests/workflows/wf5.cwl:
#9 0.999 INFO /usr/local/bin/cwltool 3.1.20210816212154
#9 1.001 INFO Resolved 'sbpack/tests/workflows/wf5.cwl' to 'file:///sbpack/tests/workflows/wf5.cwl'
#9 2.057 ERROR Tool definition failed validation:
#9 2.057 sbpack/tests/workflows/wf5.cwl:5:1: checking field `inputs`
#9 2.057 sbpack/tests/workflows/wf5.cwl:6:3: checking object `sbpack/tests/workflows/wf5.cwl#in1`
#9 2.057 sbpack/tests/workflows/wf5.cwl:7:5: Field `type` references unknown identifier
#9 2.057 `file:///sbpack/tests/types/recursive.yml#file_with_sample_meta`,
#9 2.057 tried
#9 2.057 file:///sbpack/tests/workflows/wf5.cwl#file:///sbpack/tests/types/recursive.yml#file_with_sample_meta
#9 2.057 sbpack/tests/workflows/wf5.cwl:12:3: checking object `sbpack/tests/workflows/wf5.cwl#in4`
#9 2.057 Field `type` references unknown identifier
#9 2.057 `file:///sbpack/tests/types/recursive.yml#sample_meta`, tried
#9 2.057 file:///sbpack/tests/workflows/wf5.cwl#file:///sbpack/tests/types/recursive.yml#sample_meta
------
executor failed running [/bin/sh -c cwltool --validate sbpack/tests/workflows/wf5.cwl]: exit code: 1
Workflow Code
https://github.com/rabix/sbpack/blob/master/tests/workflows/wf5.cwl
Full Traceback
> [6/6] RUN cwltool --validate sbpack/tests/workflows/wf5.cwl --debug:
#9 0.908 INFO /usr/local/bin/cwltool 3.1.20210816212154
#9 0.910 INFO Resolved 'sbpack/tests/workflows/wf5.cwl' to 'file:///sbpack/tests/workflows/wf5.cwl'
#9 2.090 ERROR Tool definition failed validation:
#9 2.090 sbpack/tests/workflows/wf5.cwl:5:1: checking field `inputs`
#9 2.090 sbpack/tests/workflows/wf5.cwl:6:3: checking object `sbpack/tests/workflows/wf5.cwl#in1`
#9 2.090 sbpack/tests/workflows/wf5.cwl:7:5: Field `type` references unknown identifier
#9 2.090 `file:///sbpack/tests/types/recursive.yml#file_with_sample_meta`,
#9 2.090 tried
#9 2.090 file:///sbpack/tests/workflows/wf5.cwl#file:///sbpack/tests/types/recursive.yml#file_with_sample_meta
#9 2.090 sbpack/tests/workflows/wf5.cwl:12:3: checking object `sbpack/tests/workflows/wf5.cwl#in4`
#9 2.090 Field `type` references unknown identifier
#9 2.090 `file:///sbpack/tests/types/recursive.yml#sample_meta`, tried
#9 2.090 file:///sbpack/tests/workflows/wf5.cwl#file:///sbpack/tests/types/recursive.yml#sample_meta
------
executor failed running [/bin/sh -c cwltool --validate sbpack/tests/workflows/wf5.cwl --debug]: exit code: 1
Your Environment
- cwltool version: 3.1.20210816212154
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
Including .css files with @import is non-standard behaviour ...
Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.
Read more >Unclear (for Python people) import behavior. And how to deal ...
Then I realize, that importing import ex fixes the error. But I was surprised by this. And only then I realize, that u.uuid...
Read more >Python 3.6 project structure leads to RuntimeWarning
Hence the vague this may cause unpredictable behaviour warning - if ... If you import the package from another script .proj is imported...
Read more >Traps for the Unwary in Python's Import System
It's specific to the situation where the main module is also imported as an ... while http://bugs.python.org/issu... is a behaviour change in Python...
Read more >Supporting transitive imports from private repositories?
I think it would also need to ignore explicit headers in the case where a remote import happens to contain a fully-qualified import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@garyluu FYI, confirmed the dependency issue. A simpler example using https://github.com/common-workflow-language/common-workflow-language/blob/main/v1.0/examples/1st-workflow.cwl works as expected
I did
cwltool --pack
on the1st-workflow.cwl
with therun: https://github.com/common-workflow-language/common-workflow-language/blob/main/v1.0/examples/1st-workflow.cwl
adjustment and it produces a single document with no external dependencies.Does this satisfy your needs? What could we add to the documentation to explain this to others?