From 20f98df554f502bddff1f22879bf867f97ab7288 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 24 Oct 2016 15:58:30 +0000 Subject: [PATCH 1/4] Finish job for Torque SSH runner --- lib/galaxy/jobs/runners/cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/jobs/runners/cli.py b/lib/galaxy/jobs/runners/cli.py index 20bb6d821a0..3b247be7ea8 100644 --- a/lib/galaxy/jobs/runners/cli.py +++ b/lib/galaxy/jobs/runners/cli.py @@ -154,13 +154,16 @@ class ShellJobRunner( AsynchronousJobRunner ): ajs.job_wrapper.change_state( state ) else: if state != old_state: - log.debug("(%s/%s) state change: %s" % ( id_tag, external_job_id, state ) ) + log.debug("(%s/%s) state change: %s to %s" % ( id_tag, external_job_id, old_state, state ) ) ajs.job_wrapper.change_state( state ) if state == model.Job.states.RUNNING and not ajs.running: ajs.running = True ajs.job_wrapper.change_state( model.Job.states.RUNNING ) ajs.old_state = state - new_watched.append( ajs ) + if state == model.Job.states.OK: + self.work_queue.put( ( self.finish_job, ajs ) ) + else: + new_watched.append( ajs ) # Replace the watch list with the updated version self.watched = new_watched From 61d25720661cb120afc7b44c57f41a1b245e21e4 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Mon, 24 Oct 2016 19:51:59 +0200 Subject: [PATCH 2/4] More explcit logging of CLI runner state change (thx @nsoranzo) --- lib/galaxy/jobs/runners/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/jobs/runners/cli.py b/lib/galaxy/jobs/runners/cli.py index 3b247be7ea8..433550e0e2f 100644 --- a/lib/galaxy/jobs/runners/cli.py +++ b/lib/galaxy/jobs/runners/cli.py @@ -154,7 +154,7 @@ class ShellJobRunner( AsynchronousJobRunner ): ajs.job_wrapper.change_state( state ) else: if state != old_state: - log.debug("(%s/%s) state change: %s to %s" % ( id_tag, external_job_id, old_state, state ) ) + log.debug("(%s/%s) state change: from %s to %s" % ( id_tag, external_job_id, old_state, state ) ) ajs.job_wrapper.change_state( state ) if state == model.Job.states.RUNNING and not ajs.running: ajs.running = True From a3ac57dbc532320c98e0b4a72772663293ab3b06 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 4 Nov 2016 17:14:01 +0100 Subject: [PATCH 3/4] Remove verbose_install_check option This option was introduced with #2554 and #2538, in reponse to a false positive conda install. This would have been caught by simply checking the exit code, which we are doing by default now. The additional verification is too strigent and not in line with the conda resolver. Activating this option will report perfectly well installed conda environments as having failed and will cause them to be uninstalled. --- config/galaxy.ini.sample | 2 -- lib/galaxy/tools/deps/conda_util.py | 28 ++++++------------------ lib/galaxy/tools/deps/resolvers/conda.py | 8 +++---- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index 5e1b6cb50ab..cc3f972e04e 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -202,8 +202,6 @@ paste.app_factory = galaxy.web.buildapp:app_factory # Set to True to instruct Galaxy to look for and install missing tool # dependencies before each job runs. #conda_auto_install = False -# Set to True to perform additional checking of installed Conda environment -#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 = False diff --git a/lib/galaxy/tools/deps/conda_util.py b/lib/galaxy/tools/deps/conda_util.py index 7240754ca4f..e4a0cccda02 100644 --- a/lib/galaxy/tools/deps/conda_util.py +++ b/lib/galaxy/tools/deps/conda_util.py @@ -359,34 +359,20 @@ def is_target_available(conda_target, conda_context=None): return False -def is_conda_target_installed(conda_target, conda_context=None, verbose_install_check=False): +def is_conda_target_installed(conda_target, conda_context=None): conda_context = _ensure_conda_context(conda_context) # fail by default - success = False if conda_context.has_env(conda_target.install_environment): - if not verbose_install_check: - return True - # because export_list directs output to a file we - # need to make a temporary file, not use StringIO - f, package_list_file = tempfile.mkstemp(suffix='.env_packages') - os.close(f) - conda_context.export_list(conda_target.install_environment, package_list_file) - search_pattern = conda_target.package_specifier + '=' - with open(package_list_file) as input_file: - for line in input_file: - if line.startswith(search_pattern): - success = True - break - os.remove(package_list_file) - return success + return True + else: + return False -def filter_installed_targets(conda_targets, conda_context=None, verbose_install_check=False): +def filter_installed_targets(conda_targets, conda_context=None): conda_context = _ensure_conda_context(conda_context) installed = functools.partial(is_conda_target_installed, - conda_context=conda_context, - verbose_install_check=verbose_install_check) - return filter(installed, conda_targets) + conda_context=conda_context) + return list(filter(installed, conda_targets)) def build_isolated_environment( diff --git a/lib/galaxy/tools/deps/resolvers/conda.py b/lib/galaxy/tools/deps/resolvers/conda.py index f94cc015692..13477f77100 100644 --- a/lib/galaxy/tools/deps/resolvers/conda.py +++ b/lib/galaxy/tools/deps/resolvers/conda.py @@ -71,7 +71,6 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In conda_exec = get_option("exec") debug = _string_as_bool(get_option("debug")) - verbose_install_check = _string_as_bool(get_option("verbose_install_check")) ensure_channels = get_option("ensure_channels") use_path_exec = get_option("use_path_exec") if use_path_exec is None: @@ -99,7 +98,6 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In self.ensure_conda_installed() self.auto_install = auto_install self.copy_dependencies = copy_dependencies - self.verbose_install_check = verbose_install_check def ensure_conda_installed(self): """ @@ -149,7 +147,7 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In conda_target = CondaTarget(name, version=version) is_installed = is_conda_target_installed( - conda_target, conda_context=self.conda_context, verbose_install_check=self.verbose_install_check + conda_target, conda_context=self.conda_context ) job_directory = kwds.get("job_directory", None) @@ -220,7 +218,7 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In conda_target = CondaTarget(name, version=version) is_installed = is_conda_target_installed( - conda_target, conda_context=self.conda_context, verbose_install_check=self.verbose_install_check + conda_target, conda_context=self.conda_context ) if is_installed: @@ -232,7 +230,7 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In else: # Recheck if installed is_installed = is_conda_target_installed( - conda_target, conda_context=self.conda_context, verbose_install_check=self.verbose_install_check + conda_target, conda_context=self.conda_context ) if not is_installed: log.debug("Removing failed conda install of {}, version '{}'".format(name, version)) From d144f18e7a6eaa5276b2d63f51457eda1befd679 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Fri, 11 Nov 2016 10:55:46 -0700 Subject: [PATCH 4/4] Fix typo in GIE nginx proxy docs --- doc/source/admin/interactive_environments.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/admin/interactive_environments.rst b/doc/source/admin/interactive_environments.rst index ba2aeabb5bb..e115816c595 100644 --- a/doc/source/admin/interactive_environments.rst +++ b/doc/source/admin/interactive_environments.rst @@ -122,6 +122,7 @@ As you can see most of these variables map directly to the command line arguments to the NodeJS script. There are a few extra parameters which will be needed if you run Galaxy behind an upstream proxy like nginx or Apache: + .. code-block:: ini dynamic_proxy_external_proxy=True @@ -182,7 +183,7 @@ Please note you will need to be using apache2.4 with ``mod_proxy_wstunnel``. # Project Jupyter / IPython specific. Other IEs may require their own routes. location ~ ^/galaxy/gie_proxy/jupyter/(?[^/]+)/api/kernels(?.*?)$ { - proxy_pass http://localhost:8800/galaxy/gie_proxy/$nbtype/api/kernels$rest; + proxy_pass http://localhost:8800/galaxy/gie_proxy/jupyter/$nbtype/api/kernels$rest; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;