commit/galaxy-central: jmchilton: Improved job logging.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f73317a85e5c/ Changeset: f73317a85e5c User: jmchilton Date: 2014-05-19 17:16:12 Summary: Improved job logging. Remove now less useful local runner command-line log statement (still contend it will be valuable for debugging purposes to be able to tweak and rerun the exact script - but point taken :)) . Remove stray statement added in ff4b5fe. Add new logging statement that logs just the base command-line produced by tools for all job runners. Add little note to runners/__init__.py about how to produce an extended command-line logging (with metadata handling, dependencies, and from_work_dir handling). Affected #: 4 files diff -r 42ced7ee518c0035dba9514b255ca1dbb8dd4c1a -r f73317a85e5cc38492e0338538ada18484701030 lib/galaxy/datatypes/metadata.py --- a/lib/galaxy/datatypes/metadata.py +++ b/lib/galaxy/datatypes/metadata.py @@ -658,7 +658,6 @@ __get_filename_override(), metadata_path_on_compute(metadata_files.filename_override_metadata), ) - log.info(line) return line if not isinstance( datasets, list ): datasets = [ datasets ] diff -r 42ced7ee518c0035dba9514b255ca1dbb8dd4c1a -r f73317a85e5cc38492e0338538ada18484701030 lib/galaxy/jobs/command_factory.py --- a/lib/galaxy/jobs/command_factory.py +++ b/lib/galaxy/jobs/command_factory.py @@ -4,6 +4,9 @@ CAPTURE_RETURN_CODE = "return_code=$?" YIELD_CAPTURED_CODE = 'sh -c "exit $return_code"' +from logging import getLogger +log = getLogger( __name__ ) + def build_command( runner, job_wrapper, include_metadata=False, include_work_dir_outputs=True, remote_command_params={} ): """ @@ -15,8 +18,10 @@ - command line taken from job wrapper - commands to set metadata (if include_metadata is True) """ - - commands_builder = CommandsBuilder(job_wrapper.get_command_line()) + base_command_line = job_wrapper.get_command_line() + job_id = job_wrapper.job_id + log.debug( 'Tool evaluation for job (%s) produced command-line: %s' % ( job_id, base_command_line ) ) + commands_builder = CommandsBuilder(base_command_line) # All job runners currently handle this case which should never occur if not commands_builder.commands: diff -r 42ced7ee518c0035dba9514b255ca1dbb8dd4c1a -r f73317a85e5cc38492e0338538ada18484701030 lib/galaxy/jobs/runners/__init__.py --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -151,7 +151,11 @@ # Prepare the job try: job_wrapper.prepare() - job_wrapper.runner_command_line = self.build_command_line( job_wrapper, include_metadata=include_metadata, include_work_dir_outputs=include_work_dir_outputs ) + job_wrapper.runner_command_line = self.build_command_line( + job_wrapper, + include_metadata=include_metadata, + include_work_dir_outputs=include_work_dir_outputs + ) except: log.exception("(%s) Failure preparing job" % job_id) job_wrapper.fail( "failure preparing job", exception=True ) @@ -254,13 +258,18 @@ envs = destination.get( "env", [] ) for env in envs: env_setup_commands.append( env_to_statement( env ) ) + command_line = job_wrapper.runner_command_line options = dict( job_instrumenter=job_instrumenter, galaxy_lib=job_wrapper.galaxy_lib_dir, env_setup_commands=env_setup_commands, working_directory=os.path.abspath( job_wrapper.working_directory ), - command=job_wrapper.runner_command_line, + command=command_line, ) + ## Additional logging to enable if debugging from_work_dir handling, metadata + ## commands, etc... (or just peak in the job script.) + # job_id = job_wrapper.job_id + # log.debug( 'Extended command-line for job (%s) is: %s' % ( job_id, command_line ) ) options.update(**kwds) return job_script(**options) diff -r 42ced7ee518c0035dba9514b255ca1dbb8dd4c1a -r f73317a85e5cc38492e0338538ada18484701030 lib/galaxy/jobs/runners/local.py --- a/lib/galaxy/jobs/runners/local.py +++ b/lib/galaxy/jobs/runners/local.py @@ -86,7 +86,6 @@ job_id = job_wrapper.get_id_tag() try: - log.debug( '(%s) executing: %s' % ( job_id, command_line ) ) stdout_file = tempfile.NamedTemporaryFile( suffix='_stdout', dir=job_wrapper.working_directory ) stderr_file = tempfile.NamedTemporaryFile( suffix='_stderr', dir=job_wrapper.working_directory ) proc = subprocess.Popen( args=command_line, Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org