Skip to content

Commit eb039c0

Browse files
committed
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.
1 parent 3839b80 commit eb039c0

File tree

8 files changed

+295
-55
lines changed

8 files changed

+295
-55
lines changed

planemo/docker.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Docker utilities for planemo.
2+
3+
Built on Galaxy abstractions in :module:`galaxy.tools.deps.dockerfiles` and
4+
:module:`galaxy.tools.deps.docker_util`.
5+
"""
6+
from __future__ import absolute_import
7+
8+
from galaxy.tools.deps.dockerfiles import docker_host_args
9+
10+
11+
__all__ = [
12+
'docker_host_args',
13+
]

planemo/engine/factory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import contextlib
44

55
from .galaxy import GalaxyEngine
6+
from .galaxy import DockerizedGalaxyEngine
67
from .cwltool import CwlToolEngine
78

89
UNKNOWN_ENGINE_TYPE_MESSAGE = "Unknown engine type specified [%s]."
@@ -17,9 +18,10 @@ def is_galaxy_engine(**kwds):
1718
def build_engine(ctx, **kwds):
1819
"""Build an engine from the supplied planemo configuration."""
1920
engine_type_str = kwds.get("engine", "galaxy")
20-
2121
if engine_type_str == "galaxy":
2222
engine_type = GalaxyEngine
23+
elif engine_type == "dockerize_galaxy":
24+
engine_type = DockerizedGalaxyEngine
2325
elif engine_type_str == "cwltool":
2426
engine_type = CwlToolEngine
2527
else:

planemo/engine/galaxy.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,23 @@ def _run(self, runnable, job_path):
3131

3232
@contextlib.contextmanager
3333
def _serve(self, runnables):
34-
with serve_daemon(self._ctx, runnables, **self._kwds) as config:
34+
with serve_daemon(self._ctx, runnables, **self._serve_kwds()) as config:
3535
yield config
3636

37+
def _serve_kwds(self):
38+
return self._kwds.copy()
3739

38-
__all__ = ["GalaxyEngine"]
40+
41+
class DockerizedGalaxyEngine(GalaxyEngine):
42+
"""An :class:`Engine` implementation backed by Galaxy running in Docker.
43+
44+
More information on Galaxy can be found at http://galaxyproject.org/.
45+
"""
46+
47+
def _serve_kwds(self):
48+
serve_kwds = self._kwds.copy()
49+
serve_kwds["dockerize"] = True
50+
return serve_kwds
51+
52+
53+
__all__ = ["GalaxyEngine", "DockerizedGalaxyEngine"]

0 commit comments

Comments
 (0)