Skip to content

Commit

Permalink
container backend pluggability (#405)
Browse files Browse the repository at this point in the history
Makes it possible (in principle; reality TBD) for a plugin to override the default Docker Swarm container backend
  • Loading branch information
mlin committed Jul 7, 2020
1 parent ec9663e commit 5a2f97b
Show file tree
Hide file tree
Showing 10 changed files with 775 additions and 765 deletions.
6 changes: 0 additions & 6 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,6 @@ def file_found(fn):

rerun_sh = f"pushd {shellquote(os.getcwd())} && miniwdl {' '.join(shellquote(t) for t in sys.argv[1:])}; popd"

# initialize local Docker Swarm
runtime.task.SwarmContainer.global_init(cfg, logger)

# run & log any errors
cleanup.enter_context(runtime._statusbar.enable(set_status))
cache = cleanup.enter_context(runtime.cache.CallCache(cfg, logger))
Expand Down Expand Up @@ -1214,9 +1211,6 @@ def scan(x):
sys.exit(0)
logger.notice(_("starting downloads", uri=uri))

# initialize Docker Swarm
runtime.task.SwarmContainer.global_init(cfg, logger)

# cheesy trick: provide the list of URIs as File inputs to a dummy workflow, causing the
# runtime to download & cache them
localizer_wdl = """
Expand Down
7 changes: 7 additions & 0 deletions WDL/runtime/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ def _parse_list(v: str) -> List[Any]:
],
"task": [],
"workflow": [],
"container_backend": [
importlib_metadata.EntryPoint(
group="miniwdl.plugin.container_backend",
name="docker_swarm",
value="WDL.runtime.task_container:SwarmContainer",
)
],
}


Expand Down
2 changes: 2 additions & 0 deletions WDL/runtime/config_templates/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# 0 = default to host `nproc`.
# -@
call_concurrency = 0
# container backend (pluggable)
container_backend = docker_swarm


[docker_swarm]
Expand Down

0 comments on commit 5a2f97b

Please sign in to comment.