Skip to content

InitialWorkDir listing with expression returning a directory: TypeError #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mr-c opened this issue Nov 13, 2016 · 2 comments
Open

Comments

@mr-c
Copy link
Member

mr-c commented Nov 13, 2016

initial-empty-directory.cwl

class: CommandLineTool
cwlVersion: v1.0
requirements:
  - class: InlineJavascriptRequirement
  - class: ShellCommandRequirement
  - class: InitialWorkDirRequirement
    listing: |
      ${return {'type': 'array', 'items': [ inputs.empty ]};}

inputs:
  empty: Directory

outputs:
  outlist: stdout

arguments: ["find", ".",
  {shellQuote: false, valueFrom: "|"},
  "sort"]
/home/michael/cwltool/env/bin/cwltool 1.0.20161110155008
Resolved 'initial-empty-directory.cwl' to 'file:///home/michael/common-workflow-language/v1.0/v1.0/initial-empty-directory.cwl'
Parsed job order from command line: {
    "id": "initial-empty-directory.cwl", 
    "empty": {
        "class": "Directory", 
        "location": "file:///home/michael/common-workflow-language/v1.0/v1.0/empty"
    }, 
    "job_order": null
}
[job initial-empty-directory.cwl] initializing from file:///home/michael/common-workflow-language/v1.0/v1.0/initial-empty-directory.cwl
[job initial-empty-directory.cwl] {
    "empty": {
        "basename": "empty", 
        "listing": [], 
        "class": "Directory", 
        "location": "file:///home/michael/common-workflow-language/v1.0/v1.0/empty"
    }, 
    "job_order": null
}
[job initial-empty-directory.cwl] path mappings is {
    "file:///home/michael/common-workflow-language/v1.0/v1.0/empty": [
        "file:///home/michael/common-workflow-language/v1.0/v1.0/empty", 
        "/tmp/tmp61L6Oy/stga03dfc90-d052-48d8-8438-888bdbf30616/empty", 
        "Directory"
    ]
}
[job initial-empty-directory.cwl] command line bindings is [
    {
        "position": [
            0, 
            0
        ], 
        "datum": "find"
    }, 
    {
        "position": [
            0, 
            1
        ], 
        "datum": "."
    }, 
    {
        "shellQuote": false, 
        "position": [
            0, 
            2
        ], 
        "valueFrom": "|"
    }, 
    {
        "position": [
            0, 
            3
        ], 
        "datum": "sort"
    }
]
[job initial-empty-directory.cwl] /tmp/tmpQmQtpz$ /bin/sh \
    -c \
    'find' '.' | 'sort' > /tmp/tmpQmQtpz/62560fea-6a41-4d73-9b2d-9665b454f832
Exception while running job
Traceback (most recent call last):
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/job.py", line 232, in run
    self.outdir, separateDirs=False)
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 141, in __init__
    self.setup(dedup(referenced_files), basedir)
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 181, in setup
    self.visit(fob, stagedir, basedir)
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 157, in visit
    self.visitlisting(obj.get("listing", []), tgt, basedir)
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/pathmapper.py", line 146, in visitlisting
    tgt = os.path.join(stagedir, ld["basename"])
TypeError: string indices must be integers
[job initial-empty-directory.cwl] completed permanentFail
[job initial-empty-directory.cwl] {}
Final process status is permanentFail
[job initial-empty-directory.cwl] Removing input staging directory /tmp/tmp61L6Oy
[job initial-empty-directory.cwl] Removing temporary directory /tmp/tmpCX1r9v
[job initial-empty-directory.cwl] Removing empty output directory /tmp/tmpQmQtpz
Workflow error, try again with --debug for more information:
  Process status is ['permanentFail']
Traceback (most recent call last):
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/main.py", line 710, in main
    **vars(args))
  File "/home/michael/cwltool/env/local/lib/python2.7/site-packages/cwltool/main.py", line 238, in single_job_executor
    raise WorkflowException(u"Process status is %s" % (final_status))
WorkflowException: Process status is ['permanentFail']
qiukunlong pushed a commit to qiukunlong/cwltool that referenced this issue Mar 25, 2017
…language/stderr

add stderr object to draft-4
qiukunlong pushed a commit to qiukunlong/cwltool that referenced this issue Mar 25, 2017
d1d53b3 Merge pull request common-workflow-language#227 from common-workflow-language/stderr
0b987d3 add test
71e9b3d add stderr object
347c28e Merge pull request common-workflow-language#212 from common-workflow-language/cwl-runner-interface
f36f52f Merge pull request common-workflow-language#219 from denis-yuen/patch-1
11b45b5 Merge pull request common-workflow-language#224 from common-workflow-language/jenkins-link
b4d790d Backport fixes to draft-3
1ea9a5c add jenkins link
180a21e Corrections and test data
28f64f0 clarify description
d791500 add output stanza, fix syntax
ee0bea3 add descriptions
04dfbf0 toolfile is optional
b1e740e bind and order the tool and jobfiles
81bd8de description
c7a2bf1 move to a better location
979453a initial description of cwl-runner interface
5316da0 Add missing files for site generation.
31fbb76 Fix site generation workflows to specify draft-3
cff09a0 Add link to latest User Guide on front page
53b2ad7 Merge pull request common-workflow-language#200 from common-workflow-language/draft-4
089fbd7 start documenting the draft-4 changes

git-subtree-dir: cwltool/schemas
git-subtree-split: d1d53b3
qiukunlong pushed a commit to qiukunlong/cwltool that referenced this issue Mar 25, 2017
a2263a9 Make path/listing optional (sort of).
de7cb76 Add listing to directory type
57a5bc8 Fix last test using "args"
3cc79d2 Port draft-3 changes to command line generation tests to draft-4.
f2a18c3 Add missing args.py used by draft-3 tests.
ac17f5d Port draft-2 changes to command line generation tests to draft-3.
ddf417b Command line generation tests now work by executing a small script that copies the command line to the output.  Allows cwl-runner implementations to drop the --conformance-test code path.
c4cecad Merge pull request common-workflow-language#228 from common-workflow-language/scoped-ref-and-typedsl
d1d53b3 Merge pull request common-workflow-language#227 from common-workflow-language/stderr
0b987d3 add test
71e9b3d add stderr object
347c28e Merge pull request common-workflow-language#212 from common-workflow-language/cwl-runner-interface
28f64f0 clarify description
d791500 add output stanza, fix syntax
ee0bea3 add descriptions
04dfbf0 toolfile is optional
b1e740e bind and order the tool and jobfiles
81bd8de description
c7a2bf1 move to a better location
979453a initial description of cwl-runner interface

git-subtree-dir: cwltool/schemas
git-subtree-split: a2263a9
qiukunlong pushed a commit to qiukunlong/cwltool that referenced this issue Mar 25, 2017
0c275b4 clarify that outputBinding must not be set
c30b79f finish restoring allowable types for parameters
06c9ba7 Merge pull request common-workflow-language#230 from common-workflow-language/stderr-out-types
cbd7bc2 only allow use of stderr/stdout shortcuts as types for the Outputs. Better place the docs
0ba703d jsonldPredicate did it!
a5a7516 nope, use an enum instead
24a611d use long ids?
52f6411 extend doc to stderr psuedotype
9d0fbe0 initial stdout & stderr shortcut support
392be2f fixing site build?
57a5bc8 Fix last test using "args"
3cc79d2 Port draft-3 changes to command line generation tests to draft-4.
f2a18c3 Add missing args.py used by draft-3 tests.
ac17f5d Port draft-2 changes to command line generation tests to draft-3.
ddf417b Command line generation tests now work by executing a small script that copies the command line to the output.  Allows cwl-runner implementations to drop the --conformance-test code path.
c4cecad Merge pull request common-workflow-language#228 from common-workflow-language/scoped-ref-and-typedsl
d1d53b3 Merge pull request common-workflow-language#227 from common-workflow-language/stderr
0b987d3 add test
71e9b3d add stderr object
347c28e Merge pull request common-workflow-language#212 from common-workflow-language/cwl-runner-interface
28f64f0 clarify description
d791500 add output stanza, fix syntax
ee0bea3 add descriptions
04dfbf0 toolfile is optional
b1e740e bind and order the tool and jobfiles
81bd8de description
c7a2bf1 move to a better location
979453a initial description of cwl-runner interface

git-subtree-dir: cwltool/schemas
git-subtree-split: 0c275b4
@r06942072
Copy link

Dear @mr-c mr-c
Could I ask what is the pipe | in listing section meaing?
Thank you :)

@mr-c
Copy link
Member Author

mr-c commented Oct 24, 2018

Hello @r06942072 , that is a YAML Block scalar indicator to do line wrapping. See http://yaml.org/refcard.html , https://learnxinyminutes.com/docs/yaml/ and http://yaml.org/spec/1.2/spec.html#Block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants