nipype / pydra

Pydra Dataflow Engine
https://nipype.github.io/pydra/
Other
119 stars 57 forks source link

DockerTask and Directory #715

Open vferat opened 8 months ago

vferat commented 8 months ago

Hey all,

After several tries, I can't managed to perform this use case:

What are you trying to accomplish?

I try to create a DockerTask with a Directory input. For this example, I would like to run ls command from inside a container to list a local folder, without having to manage any bind / path translation myself.

What have you tried?

input_spec = pydra.specs.SpecInfo(
    name="Input",
    fields=[
    ( "folder", pydra.engine.specs.Directory,
      { "help_string": "input Directory ...",
        "position": 1,
        "mandatory": True } ),],
    bases=(pydra.specs.DockerSpec,) )

task = DockerTask(executable="ls", image="alpine",  input_spec=input_spec, folder="/home/vferat/test")
task.cmdline
'docker run --rm -v /home/vferat:/pydra_inp_folder:ro -v /tmp/tmpurppojpa/DockerTask_444dd7d5c1107437e003a69cb01c0927:/output_pydra:rw -w /output_pydra alpine ls'

I expect Pydra to edit the folder input value to match the path in the container and then add its value to the ls command: ls /pydra_inp_folder/test

'docker run --rm -v /home/vferat:/pydra_inp_folder:ro -v /tmp/tmpurppojpa/DockerTask_444dd7d5c1107437e003a69cb01c0927:/output_pydra:rw -w /output_pydra alpine ls /pydra_inp_folder/test'

Am I missing something ? I didn't find a similar case in the tutorial

Thanks for your help and all the jod done on this library !