Skip to main content

Possibility to create wrapper plugin to run docker container?

Comments

3 comments

  • Tom Edwards

    Hi Ida,

    Unfortunately we haven't used the wrapper plugin much with docker. One user has had success in the past by writing a small script to run docker and then using the wrapper plugin creator to run their script. The error you're getting is that geneious can't find the docker executable. You may be able to fix this by specifying the exact path of the docker executable instead of just using "docker" (For example: "C:\Program Files\Docker\docker.exe run --rm ..."). Another idea might be to tick the box saying "Run using Windows Linux Subsystem" inside the wrapper plugin creator. 

    Finally, if all those fail, then the only solution I can think of would be to use the plugin development kit to write a plugin in java doing what you want. The Plugin Development Kit supports any java library, and there are various libraries or integrations you can find online to use docker from java code. (Such as this one https://github.com/docker-java/docker-java).

    Hope that helps and let us know if you're still running into problems!

    Tom

    0
  • Ida Karlsson

    Hi Tom,

    Many thanks for the suggestions! I should have thought of specifying the full path – that solved the error.

    Now I am wondering about how to handle input/output. I get it to work if I can mount the right folder for example:
    /path/to/Geneious\ 2022.1\ Data/transient/1659433949158/x/7/

    However, it seems there is a new folder “1659433949158” with a new name every time Geneious is started, and the same for the folder “7” every time I run my plugin (or do other operations as well?). For now I have this solution:

    SESSION=$(ls -v /path/to/Geneious\ 2022.1\ Data/transient/ | sort -n | tail -n 1)
    FOLDER=$(ls -v /path/to/Geneious\ 2022.1\ Data/transient/$SESSION/x/ | sort -n | tail -n 1)

    /path/to/docker run --rm -v /path/to/Geneious\ 2022.1\ Data/transient/$SESSION/x/$FOLDER:/geneious \
        covlineages/pangolin \
        pangolin /geneious/$1 --outfile /geneious/$2

    I guess I can add some checks for the folder names, but in general can I expect these two folders to be named with the largest number in their respective folder?

    Kind regards,
    Ida

    0
  • Tom Edwards

    Hi Ida,

    Awesome, glad to here that solved your problem. For specifying input files or folders, the wrapper plugin has some special options you can use in the command. One such option is [inputFolderName], when you run the command, this gets replaced with the folder path storing your documents. This should mean instead of using /path/to/Geneious\ 2022.1\ Data/transient/1659433949158/x/7/, you should be able to simply use [inputFolderName]. Have a look at the small question mark help in step 2 of the wrapper plugin creator for more details.

    Cheers,
    Tom

    0

Please sign in to leave a comment.