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

DockerTask and Directory #715

Open
vferat opened this issue Oct 20, 2023 · 0 comments
Open

DockerTask and Directory #715

vferat opened this issue Oct 20, 2023 · 0 comments
Labels
question Further information is requested

Comments

@vferat
Copy link

vferat commented Oct 20, 2023

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 !

@vferat vferat added the question Further information is requested label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant