mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_16.07'
This commit is contained in:
@@ -206,7 +206,7 @@ paste.app_factory = galaxy.web.buildapp:app_factory
|
||||
#conda_verbose_install_check=False
|
||||
# Set to True to instruct Galaxy to install Conda from the web automatically
|
||||
# if it cannot find a local copy and conda_exec is not configured.
|
||||
#conda_auto_init = True
|
||||
#conda_auto_init = False
|
||||
|
||||
# File containing the Galaxy Tool Sheds that should be made available to
|
||||
# install from in the admin interface (.sample used if default does not exist).
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
16.07
|
||||
-------------------------------
|
||||
|
||||
.. announce_start
|
||||
|
||||
Highlighted Enhancements
|
||||
-------------------------------
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ EXTRA_CONFIG_KWDS = {
|
||||
'conda_debug': None,
|
||||
'conda_ensure_channels': 'r,bioconda,iuc',
|
||||
'conda_auto_install': False,
|
||||
'conda_auto_init': True,
|
||||
'conda_auto_init': False,
|
||||
}
|
||||
|
||||
CONFIG_VAL_NOT_FOUND = object()
|
||||
|
||||
@@ -56,6 +56,8 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In
|
||||
dependency_manager.default_base_path, DEFAULT_BASE_PATH_DIRECTORY
|
||||
)
|
||||
|
||||
self.conda_prefix_parent = os.path.dirname(conda_prefix)
|
||||
|
||||
# warning is related to conda problem discussed in https://github.com/galaxyproject/galaxy/issues/2537, remove when that is resolved
|
||||
conda_prefix_warning_length = 50
|
||||
if len(conda_prefix) >= conda_prefix_warning_length:
|
||||
@@ -104,21 +106,31 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In
|
||||
Make sure that conda is installed, and if conda can't be installed, mark resolver as disabled.
|
||||
We acquire a lock, so that multiple handlers do not attempt to install conda simultaneously.
|
||||
"""
|
||||
if not os.path.exists(self.dependency_manager.default_base_path):
|
||||
os.mkdir(self.dependency_manager.default_base_path)
|
||||
try:
|
||||
with FileLock(os.path.join(self.dependency_manager.default_base_path, 'conda')):
|
||||
if not self.conda_context.is_conda_installed():
|
||||
if self.auto_init:
|
||||
if self.conda_context.can_install_conda():
|
||||
if install_conda(self.conda_context):
|
||||
self.disabled = True
|
||||
log.warning("Conda installation requested and failed.")
|
||||
else:
|
||||
target_path = self.conda_prefix_parent
|
||||
|
||||
def _check():
|
||||
if not self.conda_context.is_conda_installed():
|
||||
if self.auto_init:
|
||||
if self.conda_context.can_install_conda():
|
||||
if install_conda(self.conda_context):
|
||||
self.disabled = True
|
||||
log.warning("Conda installation requested and failed.")
|
||||
else:
|
||||
self.disabled = True
|
||||
log.warning("Conda not installed and auto-installation disabled.")
|
||||
else:
|
||||
self.disabled = True
|
||||
log.warning("Conda not installed and auto-installation disabled.")
|
||||
else:
|
||||
self.disabled = False
|
||||
|
||||
if not os.path.exists(target_path):
|
||||
os.mkdir(target_path)
|
||||
try:
|
||||
if self.auto_init and os.access(target_path, os.W_OK):
|
||||
with FileLock(os.path.join(target_path, 'conda')):
|
||||
_check()
|
||||
else:
|
||||
_check()
|
||||
except FileLockException:
|
||||
self.ensure_conda_installed()
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ from galaxy.util import listify
|
||||
from galaxy.util import parse_xml
|
||||
from galaxy.util import string_as_bool
|
||||
from galaxy.util.bunch import Bunch
|
||||
from galaxy.util.postfork import register_postfork_function
|
||||
|
||||
from .parser import get_toolbox_parser, ensure_tool_conf_item
|
||||
|
||||
@@ -104,7 +103,6 @@ class AbstractToolBox( Dictifiable, ManagesIntegratedToolPanelMixin, object ):
|
||||
self._init_tools_from_config( config_filename )
|
||||
except:
|
||||
log.exception( "Error loading tools defined in config %s", config_filename )
|
||||
register_postfork_function(self._tool_conf_watcher.start)
|
||||
|
||||
def _init_tools_from_config( self, config_filename ):
|
||||
"""
|
||||
|
||||
@@ -74,7 +74,7 @@ class ToolConfWatcher(object):
|
||||
def start(self):
|
||||
if not self._active:
|
||||
self._active = True
|
||||
self.thread.start()
|
||||
register_postfork_function(self.thread.start)
|
||||
|
||||
def shutdown(self):
|
||||
if self._active:
|
||||
@@ -109,6 +109,7 @@ class ToolConfWatcher(object):
|
||||
mod_time = time.ctime(os.path.getmtime(path))
|
||||
with self._lock:
|
||||
self.paths[path] = mod_time
|
||||
self.start()
|
||||
|
||||
def watch_file(self, tool_conf_file):
|
||||
self.monitor(tool_conf_file)
|
||||
|
||||
Reference in New Issue
Block a user