Merge pull request #10 from jmchilton/htcondor_docker

Revise HTCondor Docker image resolution.
This commit is contained in:
Björn Grüning
2016-05-17 00:55:22 +02:00
3 changed files with 12 additions and 12 deletions
+6 -5
View File
@@ -446,13 +446,14 @@
<container type="docker">bgruening/galaxy-stable</container>
</requirements>
If not the container specified with id="docker_image" is used and as last resort
id="docker_default_container_id" is considered.
Unless the job destination specifies an override
with docker_container_id_override. If neither of
these is set a default container can be specified
with docker_default_container_id. The resolved
container ID will be passed along to condor as
the docker_image submission parameter.
-->
<!-- <param id="docker_image">busybox:ubuntu-14.04</param> -->
<!-- <param id="docker_default_container_id">busybox:ubuntu-14.04</param> -->
</destination>
<!-- Jobs that hit the walltime on one destination can be automatically
+1 -6
View File
@@ -60,12 +60,7 @@ class CondorJobRunner( AsynchronousJobRunner ):
container = None
universe = query_params.get('universe', False)
if universe.strip().lower() == 'docker':
if job_wrapper.tool.containers:
# Try to extract the container (1) from the Tool, (2) from 'docker_image'
# and (3) from 'docker_default_container_id'. The last two can be specified in job_conf.xml
container = job_wrapper.tool.containers[0].identifier or \
query_params.get('docker_image', False) or \
query_params.get('docker_default_container_id', False)
container = self.find_container( job_wrapper )
if container:
# HTCondor needs the image as 'docker_image'
query_params.update({'docker_image': container})
+5 -1
View File
@@ -107,7 +107,11 @@ class ContainerFinder(object):
def __default_container_id(self, container_type, destination_info):
if not self.__container_type_enabled(container_type, destination_info):
return None
return destination_info.get("%s_default_container_id" % container_type)
key = "%s_default_container_id" % container_type
# Also allow docker_image...
if key not in destination_info:
key = "%s_image" % container_type
return destination_info.get(key)
def __destination_container(self, container_id, container_type, tool_info, destination_info, job_info):
# TODO: ensure destination_info is dict-like