Skip to content

Commit

Permalink
Merge pull request #7044 from nsoranzo/release_18.09_fix/mulled_conta…
Browse files Browse the repository at this point in the history
…iner_default_channels

[18.09] Backport #7038
  • Loading branch information
bgruening committed Nov 24, 2018
2 parents 4ab4a19 + 5255a0b commit 9aaafd8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions lib/galaxy/tools/deps/container_resolvers/__init__.py
Expand Up @@ -23,15 +23,12 @@ def __init__(self, app_info=None, **kwds):
self.app_info = app_info
self.resolver_kwds = kwds

def _get_config_option(self, key, default=None, config_prefix=None, **kwds):
def _get_config_option(self, key, default=None):
"""Look in resolver-specific settings for option and then fallback to
global settings.
"""
global_key = "%s_%s" % (config_prefix, key)
if key in kwds:
return kwds.get(key)
elif self.app_info and hasattr(self.app_info, global_key):
return getattr(self.app_info, global_key)
if self.app_info and hasattr(self.app_info, key):
return getattr(self.app_info, key)
else:
return default

Expand Down
8 changes: 4 additions & 4 deletions lib/galaxy/tools/deps/container_resolvers/mulled.py
Expand Up @@ -351,11 +351,11 @@ def __init__(self, app_info=None, namespace="local", hash_func="v2", **kwds):
self.hash_func = hash_func
self._mulled_kwds = {
'namespace': namespace,
'channels': self._get_config_option("channels", DEFAULT_CHANNELS, prefix="mulled"),
'channels': self._get_config_option("mulled_channels", DEFAULT_CHANNELS),
'hash_func': self.hash_func,
'command': 'build-and-test',
}
self.auto_init = self._get_config_option("auto_init", DEFAULT_CHANNELS, prefix="involucro")
self.auto_init = self._get_config_option("involucro_auto_init", True)

def resolve(self, enabled_container_types, tool_info):
if tool_info.requires_galaxy_python_environment:
Expand Down Expand Up @@ -396,13 +396,13 @@ def __init__(self, app_info=None, hash_func="v2", **kwds):
self.cache_directory = kwds.get("cache_directory", os.path.join(app_info.container_image_cache_path, "singularity", "mulled"))
self.hash_func = hash_func
self._mulled_kwds = {
'channels': self._get_config_option("channels", DEFAULT_CHANNELS, prefix="mulled"),
'channels': self._get_config_option("mulled_channels", DEFAULT_CHANNELS),
'hash_func': self.hash_func,
'command': 'build-and-test',
'singularity': True,
'singularity_image_dir': self.cache_directory,
}
self.auto_init = self._get_config_option("auto_init", DEFAULT_CHANNELS, prefix="involucro")
self.auto_init = self._get_config_option("involucro_auto_init", True)

def resolve(self, enabled_container_types, tool_info):
if tool_info.requires_galaxy_python_environment:
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tools/deps/mulled/mulled_build.py
Expand Up @@ -39,7 +39,7 @@
from ..conda_compat import MetaData

DIRNAME = os.path.dirname(__file__)
DEFAULT_CHANNELS = "conda-forge,bioconda"
DEFAULT_CHANNELS = ["conda-forge", "bioconda"]
DEFAULT_REPOSITORY_TEMPLATE = "quay.io/${namespace}/${image}"
DEFAULT_BINDS = ["build/dist:/usr/local/"]
DEFAULT_WORKING_DIR = '/source/'
Expand Down Expand Up @@ -322,7 +322,7 @@ def add_build_arguments(parser):
help='quay.io namespace.')
parser.add_argument('-r', '--repository_template', dest='repository_template', default=DEFAULT_REPOSITORY_TEMPLATE,
help='Docker repository target for publication (only quay.io or compat. API is currently supported).')
parser.add_argument('-c', '--channels', dest='channels', default=DEFAULT_CHANNELS,
parser.add_argument('-c', '--channels', dest='channels', default=",".join(DEFAULT_CHANNELS),
help='Comma separated list of target conda channels.')
parser.add_argument('--conda-version', dest="conda_version", default=None,
help="Change to specified version of Conda before installing packages.")
Expand Down

0 comments on commit 9aaafd8

Please sign in to comment.