Skip to content

Commit

Permalink
Revise HTCondor Docker image resolution.
Browse files Browse the repository at this point in the history
Bring inline with the rest of the job runner's Docker image resolution stuff. Order of reosolution is:

 - Use destination specified override if found: docker_container_id_override
 - Use the tool specified container if not found and no override: see tool
 - Else - use docker_default_container_id.

This adjusts the documentation to reflect this and make the the parameters more consistent throughout. I've modified this so docker_image (the old name introduced by the Docker Condor PR) still works - but I have left it undocumented intentionally for consistency.
  • Loading branch information
jmchilton committed May 16, 2016
1 parent 7bd595b commit 917c882
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 6 additions & 5 deletions config/job_conf.xml.sample_advanced
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions lib/galaxy/jobs/runners/condor.py
Expand Up @@ -60,12 +60,7 @@ def queue_job( self, job_wrapper ):
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})
Expand Down
6 changes: 5 additions & 1 deletion lib/galaxy/tools/deps/containers.py
Expand Up @@ -107,7 +107,11 @@ def __overridden_container_id(self, container_type, destination_info):
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
Expand Down

0 comments on commit 917c882

Please sign in to comment.