From 83d9ddd0b3e090829e70b95ac6bd26b63179e40f Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Tue, 20 Dec 2016 18:07:13 +0000 Subject: [PATCH 1/2] Expose job metrics --- config/galaxy.ini.sample | 7 +++++++ lib/galaxy/config.py | 2 ++ templates/show_params.mako | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index aefbbf7e8d0..2a0422eb790 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -1113,6 +1113,13 @@ use_interactive = True # Details" option in the history. Administrators can always see this. #expose_dataset_path = False +# This option allows users to see the job metrics (except for environment +# variables). +#expose_job_metrics = False + +# This option allows users to see the built command line. +#expose_job_command_line = False + # Data manager configuration options # Allow non-admin users to view available Data Manager options. #enable_data_manager_user_view = False diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 2e7d391f925..e98a64f573e 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -217,6 +217,8 @@ class Configuration( object ): self.track_jobs_in_database = string_as_bool( kwargs.get( 'track_jobs_in_database', 'True') ) self.start_job_runners = listify(kwargs.get( 'start_job_runners', '' )) self.expose_dataset_path = string_as_bool( kwargs.get( 'expose_dataset_path', 'False' ) ) + self.expose_job_metrics = string_as_bool( kwargs.get( 'expose_job_metrics', 'False' ) ) + self.expose_job_command_line = string_as_bool( kwargs.get( 'expose_job_command_line', 'False' ) ) self.enable_communication_server = string_as_bool( kwargs.get( 'enable_communication_server', 'False' ) ) self.communication_server_host = kwargs.get( 'communication_server_host', 'http://localhost' ) self.communication_server_port = int( kwargs.get( 'communication_server_port', '7070' ) ) diff --git a/templates/show_params.mako b/templates/show_params.mako index a18a73895c5..f3a84b0f199 100644 --- a/templates/show_params.mako +++ b/templates/show_params.mako @@ -230,17 +230,18 @@ -%if job and job.command_line and trans.user_is_admin(): +%if job and job.command_line and (trans.user_is_admin() or trans.app.config.expose_job_command_line):

Command Line

 ${ job.command_line | h }
%endif -%if job and trans.user_is_admin(): +%if job and (trans.user_is_admin() or trans.app.config.expose_job_metrics):

Job Metrics

<% job_metrics = trans.app.job_metrics %> <% plugins = set([metric.plugin for metric in job.metrics]) %> %for plugin in sorted(plugins): + %if trans.user_is_admin() or plugin != 'env':

${ plugin | h }

@@ -254,6 +255,7 @@ ${ job.command_line | h } %endfor
+ %endif %endfor %endif From ae87eb94131e2a0da8ebae4ca6137ba111072852 Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Wed, 21 Dec 2016 04:11:53 +0000 Subject: [PATCH 2/2] Address the review comments --- config/galaxy.ini.sample | 8 +++----- lib/galaxy/config.py | 3 +-- templates/show_params.mako | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index 2a0422eb790..9f79bcea02e 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -1110,15 +1110,13 @@ use_interactive = True #enable_quotas = False # This option allows users to see the full path of datasets via the "View -# Details" option in the history. Administrators can always see this. +# Details" option in the history. This option also exposes the command line to +# non-administrative users. Administrators can always see dataset paths. #expose_dataset_path = False # This option allows users to see the job metrics (except for environment # variables). -#expose_job_metrics = False - -# This option allows users to see the built command line. -#expose_job_command_line = False +#expose_potentially_sensitive_job_metrics = False # Data manager configuration options # Allow non-admin users to view available Data Manager options. diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index e98a64f573e..2e7caaf741f 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -217,8 +217,7 @@ class Configuration( object ): self.track_jobs_in_database = string_as_bool( kwargs.get( 'track_jobs_in_database', 'True') ) self.start_job_runners = listify(kwargs.get( 'start_job_runners', '' )) self.expose_dataset_path = string_as_bool( kwargs.get( 'expose_dataset_path', 'False' ) ) - self.expose_job_metrics = string_as_bool( kwargs.get( 'expose_job_metrics', 'False' ) ) - self.expose_job_command_line = string_as_bool( kwargs.get( 'expose_job_command_line', 'False' ) ) + self.expose_potentially_sensitive_job_metrics = string_as_bool( kwargs.get( 'expose_potentially_sensitive_job_metrics', 'False' ) ) self.enable_communication_server = string_as_bool( kwargs.get( 'enable_communication_server', 'False' ) ) self.communication_server_host = kwargs.get( 'communication_server_host', 'http://localhost' ) self.communication_server_port = int( kwargs.get( 'communication_server_port', '7070' ) ) diff --git a/templates/show_params.mako b/templates/show_params.mako index f3a84b0f199..dde5ea3cad9 100644 --- a/templates/show_params.mako +++ b/templates/show_params.mako @@ -230,13 +230,13 @@ -%if job and job.command_line and (trans.user_is_admin() or trans.app.config.expose_job_command_line): +%if job and job.command_line and (trans.user_is_admin() or trans.app.config.expose_dataset_path):

Command Line

 ${ job.command_line | h }
%endif -%if job and (trans.user_is_admin() or trans.app.config.expose_job_metrics): +%if job and (trans.user_is_admin() or trans.app.config.expose_potentially_sensitive_job_metrics):

Job Metrics

<% job_metrics = trans.app.job_metrics %> <% plugins = set([metric.plugin for metric in job.metrics]) %>