Skip to content
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

A scatter workflow that should make several empty directories makes only one directory #4210

Closed
tom-tan opened this issue Sep 7, 2022 · 3 comments
Assignees
Labels

Comments

@tom-tan
Copy link

tom-tan commented Sep 7, 2022

It does not happen when a scattered step makes non-empty directories.

Version

$ toil-cwl-runner --version
5.7.1

How to reproduce

scatter.cwl:

cwlVersion: v1.0
class: Workflow

requirements:
  ScatterFeatureRequirement: {}
inputs:
  - id: strs
    type: string[]
outputs:
  - id: dirs
    type: Directory[]
    outputSource: mkdir/dir

steps:
  - id: mkdir
    run:
      class: CommandLineTool
      baseCommand: mkdir
      inputs:
        - id: str
          type: string
          inputBinding: {}
      outputs:
        - id: dir
          type: Directory
          outputBinding:
            glob: "$(inputs.str)"
    scatter: str
    in:
        str: strs
    out: [dir]

job.yml:

strs: [a, b, c]

and run the following:

$ toil-cwl-runner scatter.cwl job.yml

Expected behavior

It makes directories named a, b and c.

$ toil-cwl-runner scatter-workflow.cwl job.yml
...
{
    "dirs": [
        {
            "location": "file:///workspaces/a",
            "basename": "a",
            "nameroot": "a",
            "nameext": "",
            "class": "Directory",
            "listing": []
        },
        {
            "location": "file:///workspaces/b",
            "basename": "b",
            "nameroot": "b",
            "nameext": "",
            "class": "Directory",
            "listing": []
        },
        {
            "location": "file:///workspaces/c",
            "basename": "c",
            "nameroot": "c",
            "nameext": "",
            "class": "Directory",
            "listing": []
        }
    ]
}
$ ls
a  b  c  job.yml  scatter.cwl

Actual behavior

It only makes a.
It also returns output object that consists of directories with basename a, b and c but they have the same location value.

$ toil-cwl-runner scatter-workflow.cwl job.yml
...
{
    "dirs": [
        {
            "location": "file:///workspaces/a",
            "basename": "a",
            "nameroot": "a",
            "nameext": "",
            "class": "Directory",
            "listing": []
        },
        {
            "location": "file:///workspaces/a",
            "basename": "b",
            "nameroot": "b",
            "nameext": "",
            "class": "Directory",
            "listing": []
        },
        {
            "location": "file:///workspaces/a",
            "basename": "c",
            "nameroot": "c",
            "nameext": "",
            "class": "Directory",
            "listing": []
        }
    ]
}
$ ls
a   job.yml  scatter.cwl

┆Issue is synchronized with this Jira Story
┆epic: AGC
┆friendlyId: TOIL-1216

@tom-tan tom-tan changed the title A scatter workflow that makes empty directories makes only one directory A scatter workflow that should make several empty directories makes only one directory Sep 7, 2022
@DailyDreaming
Copy link
Member

@tom-tan Thanks for the detailed report and how to reproduce the problem. Will look into a fix.

@adamnovak
Copy link
Member

We need to update cwltest to at least the version in common-workflow-language/cwltest#146 (comment) so that we can see this bug, and then fix it.

@DailyDreaming
Copy link
Member

This should be done and included in current CWL tests.

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

No branches or pull requests

4 participants