Permalink
Browse files

Implement ``docker_galaxy`` engine type.

Specifying ``--engine docker_galaxy`` causes serve, test, and run operations to be backed with a Dockerized Galaxy instance powered by @bgruening's docker-galaxy-stable (https://github.com/bgruening/docker-galaxy-stable).

Requires various docker_util and command quoting improvements in galaxy-lib in 16.7.7 (galaxyproject/galaxy-lib@38eca73).

Fixes #15.
  • Loading branch information...
jmchilton committed May 23, 2016
1 parent 3839b80 commit eb039c0438bfe3edba863812a533dc1dc1126142
Showing with 295 additions and 55 deletions.
  1. +13 −0 planemo/docker.py
  2. +3 −1 planemo/engine/factory.py
  3. +17 −2 planemo/engine/galaxy.py
  4. +223 −44 planemo/galaxy/config.py
  5. +4 −0 planemo/galaxy/serve.py
  6. +1 −1 planemo/io.py
  7. +33 −6 planemo/options.py
  8. +1 −1 requirements.txt
@@ -0,0 +1,13 @@
"""Docker utilities for planemo.
Built on Galaxy abstractions in :module:`galaxy.tools.deps.dockerfiles` and
:module:`galaxy.tools.deps.docker_util`.
"""
from __future__ import absolute_import

from galaxy.tools.deps.dockerfiles import docker_host_args


__all__ = [
'docker_host_args',
]
@@ -3,6 +3,7 @@
import contextlib

from .galaxy import GalaxyEngine
from .galaxy import DockerizedGalaxyEngine
from .cwltool import CwlToolEngine

UNKNOWN_ENGINE_TYPE_MESSAGE = "Unknown engine type specified [%s]."
@@ -17,9 +18,10 @@ def is_galaxy_engine(**kwds):
def build_engine(ctx, **kwds):
"""Build an engine from the supplied planemo configuration."""
engine_type_str = kwds.get("engine", "galaxy")

if engine_type_str == "galaxy":
engine_type = GalaxyEngine
elif engine_type == "dockerize_galaxy":
engine_type = DockerizedGalaxyEngine
elif engine_type_str == "cwltool":
engine_type = CwlToolEngine
else:
@@ -31,8 +31,23 @@ def _run(self, runnable, job_path):

@contextlib.contextmanager
def _serve(self, runnables):
with serve_daemon(self._ctx, runnables, **self._kwds) as config:
with serve_daemon(self._ctx, runnables, **self._serve_kwds()) as config:
yield config

def _serve_kwds(self):
return self._kwds.copy()

__all__ = ["GalaxyEngine"]

class DockerizedGalaxyEngine(GalaxyEngine):
"""An :class:`Engine` implementation backed by Galaxy running in Docker.
More information on Galaxy can be found at http://galaxyproject.org/.
"""

def _serve_kwds(self):
serve_kwds = self._kwds.copy()
serve_kwds["dockerize"] = True
return serve_kwds


__all__ = ["GalaxyEngine", "DockerizedGalaxyEngine"]
Oops, something went wrong.

0 comments on commit eb039c0

Please sign in to comment.