apetkau / galaxy-hackathon-2014

11 stars 1 forks source link

How to change setting of mount path in Docker container? #3

Open jianlianggao opened 4 years ago

jianlianggao commented 4 years ago

Hi Aaron,

I am revisiting a tool integration with Galaxy these days. I am trying to deploy Galaxy locally with your code run.sh. The default setting is to mount current work dir on host to the same path in the Docker. I want to change mount path in Docker to satisfy some path requirement by the tool. How can I do that?

Best wishes, Jianliang

apetkau commented 4 years ago

Hello @jianlianggao. You could try looking at the docker_volumes setting in the Galaxy job_conf.xml file (https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/config/sample/job_conf.xml.sample_advanced#L448).

I believe the syntax is similar to the --volume parameter to the command-line docker command (https://docs.docker.com/storage/volumes/#choose-the--v-or---mount-flag), which lets you change the path to the mounted volume in the Docker container like:

[host_path]:[docker_path]:ro

Here, ro is for mounting read-only. You can leave it out if you want read-write access.

jianlianggao commented 4 years ago

Hi Aaron,

Thank you very much for your instruction. I followed it and add a mount path to my job_conf.xml. My R code (docker) will run and leave output files in /tmp in the docker. The docker runs ok locally.

I feel that my local Galaxy instance didn't pull my docker image and run. My tool xml has docker run command in the tag. But the error messages suggest that my docker run parameters were not passed to the galaxy run script.

My job_conf.xml is like


    <plugins>
        <plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/>
    </plugins>
    <handlers>
        <handler id="main"/>
    </handlers>
    <destinations default="docker_local">
        <destination id="local" runner="local"/>
        <destination id="docker_local" runner="local">
          <param id="docker_enabled">true</param>
          <param id="docker_volume">$working_directory:/tmp:rw</param>
        </destination>
    </destinations>

</job_conf>```

Best wishes,
Jianliang