Skip to content

Staged files not accessible under Darwin #258

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

Closed
psaffrey-illumina opened this issue Dec 22, 2016 · 3 comments · Fixed by #670
Closed

Staged files not accessible under Darwin #258

psaffrey-illumina opened this issue Dec 22, 2016 · 3 comments · Fixed by #670
Labels

Comments

@psaffrey-illumina
Copy link
Contributor

psaffrey-illumina commented Dec 22, 2016

I have been creating files on-the-fly using the InitialWorkDirRequirement as described here:

http://www.commonwl.org/v1.0/UserGuide.html#Staging_input_files_in_the_output_directory

This works but I find that when I combine this with a DockerRequirement it stops working and I can no longer find the created file. Example:

cwlVersion: v1.0
baseCommand: ["cat"]

requirements:
  - class: DockerRequirement
    dockerImageId: alpine
    dockerPull: alpine
  - class: InlineJavascriptRequirement
  - class: InitialWorkDirRequirement
    listing:
      - entryname: example.conf
        entry: |
          ${
            return inputs.test
          }


inputs:
  - id: test
    type: string
    inputBinding:
      valueFrom: "example.conf"
outputs: []

Input:

test: "test string"

If I do the same thing without the DockerRequirement I get:

Resolved 'javascript_file2.cwl' to 'file:///Users/psaffrey/cwl_dev/cwl_examples/javascript_file2.cwl'
[job javascript_file2.cwl] /private/var/folders/dh/t5qjl_gx5tq3664vlgbgqplh0000gq/T/tmpYfWsl4$ cat \
    example.conf
test stringFinal process status is success
{}```

With the DockerRequirement I get this:

```/usr/local/bin/cwltool 1.0.20161216212910
Resolved 'javascript_file2.cwl' to 'file:///Users/psaffrey/cwl_dev/cwl_examples/javascript_file2.cwl'
[job javascript_file2.cwl] /var/folders/dh/t5qjl_gx5tq3664vlgbgqplh0000gq/T/tmpgx_NP_$ docker \
    run \
    -i \
    --volume=/private/var/folders/dh/t5qjl_gx5tq3664vlgbgqplh0000gq/T/tmpgx_NP_:/private/var/spool/cwl:rw \
    --volume=/private/var/folders/dh/t5qjl_gx5tq3664vlgbgqplh0000gq/T/tmpRpeEVS:/tmp:rw \
    --workdir=/private/var/spool/cwl \
    --read-only=true \
    --user=1000 \
    --rm \
    --env=TMPDIR=/tmp \
    --env=HOME=/private/var/spool/cwl \
    alpine \
    cat \
    example.conf
cat: can't open 'example.conf': No such file or directory
[job javascript_file2.cwl] completed permanentFail
Final process status is permanentFail
Workflow error, try again with --debug for more information:
Process status is ['permanentFail']```

Apparently this works on Linux, but not Darwin:

```$ docker --version
Docker version 1.10.1, build 9e83765
$ echo $OSTYPE 
darwin15
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G1212```
@psaffrey-illumina
Copy link
Contributor Author

This is not a CWL issue - it's to do with the way that Docker machine on mac uses its temp directories:

http://stackoverflow.com/questions/37673140/docker-volume-located-in-tmp-on-osx-empty

You can fix it by using the --tmpdir-prefix option.

@mr-c
Copy link
Member

mr-c commented Dec 22, 2016

@psaffrey-illumina Should we / can we do this automatically for Darwin?

@mr-c mr-c reopened this Dec 22, 2016
@psaffrey-illumina
Copy link
Contributor Author

I'm not sure - it's really a feature of the docker support on this platform. The problem is that you need to provide a --tmpdir-prefix (I think) in the user's home directory because this is the directory that is automatically mounted inside the VM that docker machine uses.

I'm pretty sure this problem will also be seen in Windows machines using docker machine, but I gather cwltool isn't fully supported there yet either.

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