cwltool icon indicating copy to clipboard operation
cwltool copied to clipboard

cwltool: Input of type Directory[] stays readonly if using writable: true in InitialWorkDirRequirement

Open adrabent opened this issue 3 years ago • 3 comments

Dear cwltool developers.

Expected Behavior

I created a CWL step that takes an input of type Directory[]. This step should be able to read-write on the input data.

class: CommandLineTool
cwlVersion: v1.2

baseCommand:
  - aoflagger

inputs:
  - id: msin
    type:
      - Directory[]
    inputBinding:
      position: 1
      shellQuote: false

outputs:
  - id: output_ms
    doc: Output MS
    type:
      - Directory[]
    outputBinding:
      outputEval: $(inputs.msin)

requirements:
  - class: ShellCommandRequirement
  - class: InitialWorkDirRequirement
    listing:
      - entry: $(inputs.msin)
        writable: true
hints:
  - class: DockerRequirement
    dockerPull: lofareosc/prefactor3-cwl

Actual Behavior

What happens is this:

docker \
    run \
    -i \
    --mount=type=bind,source=/home/alex/CI_test/tmp/erf4tmzv,target=/qdACiA \
    --mount=type=bind,source=/home/alex/CI_test/tmp/n8nqegdi,target=/tmp \
    --mount=type=bind,source=/home/alex/CI_test/tmp/ium2zv4a/out_L667520_121MHz_uv.dpppconcat,target=/qdACiA/out_L667520_121MHz_uv.dpppconcat,readonly \
    --mount=type=bind,source=/home/alex/CI_test/tmp/i057buav/out_L667520_123MHz_uv.dpppconcat,target=/qdACiA/out_L667520_123MHz_uv.dpppconcat,readonly \
    --workdir=/qdACiA \
    --net=none \
    --log-driver=none \
    --user=1067:200 \
    --rm \
    --cidfile=/home/alex/CI_test/tmp/9whm9aoz/20220303150355-992717.cid \
    --env=TMPDIR=/tmp \
    --env=HOME=/qdACiA \
    lofareosc/prefactor3-cwl \
    /bin/sh \
    -c \
    'aoflagger' '/qdACiA/out_L667520_121MHz_uv.dpppconcat' '/qdACiA/out_L667520_123MHz_uv.dpppconcat' 

Plus this error message:

  what():  RegularFileIO: error in open or create of file /qdACiA/out_L667520_123MHz_uv.dpppconcat/table.dat: Read-only file system
Aborted (core dumped)

I would expect that the data mounted to the working directory is not set readonly, but it is.

The cwltool version is: 3.1.20220224085855

-- Alex

adrabent avatar Mar 03 '22 14:03 adrabent

This was fun to track down; a fix is in https://github.com/common-workflow-language/cwltool/pull/1634/commits/85515923aa59a38b20221cf3e79dc62bc5b4ee32 "just" typo!

mr-c avatar Mar 03 '22 17:03 mr-c

Thanks for finding the issue. I have used pip to install cwltool. Is there a "pippy" way to test your branch/commit?

Alex

adrabent avatar Mar 03 '22 18:03 adrabent

I just manually corrected the typo. Issue looks fixed to me :)

adrabent avatar Mar 03 '22 18:03 adrabent