Skip to content

Commit

Permalink
Merge pull request #10 from jmchilton/htcondor_docker
Browse files Browse the repository at this point in the history
Revise HTCondor Docker image resolution.
  • Loading branch information
bgruening committed May 16, 2016
2 parents 7bd595b + 917c882 commit 8e6211a
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 8e6211a

Please sign in to comment.