commit/galaxy-central: natefoo: Condor runner: Allow for per-destination ClassAd query params, don't delete the submit file if submission fails and cleanup_job != always.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/827ff13a7291/ Changeset: 827ff13a7291 User: natefoo Date: 2013-06-13 23:09:20 Summary: Condor runner: Allow for per-destination ClassAd query params, don't delete the submit file if submission fails and cleanup_job != always. Affected #: 2 files diff -r 6f9e73ec3e99d43f14e3d735ecfe7b66ea38472a -r 827ff13a72914ed3ddacace717cc07af66af718e job_conf.xml.sample_advanced --- a/job_conf.xml.sample_advanced +++ b/job_conf.xml.sample_advanced @@ -54,7 +54,15 @@ <param id="shell_hostname">foo.example.org</param><param id="Job_Execution_Time">24:00:00</param></destination> - <destination id="condor" runner="condor"/> + <destination id="condor" runner="condor"> + <!-- With no params, jobs are submitted to the 'vanilla' universe with: + notification = NEVER + getenv = true + Additional/override query ClassAd params can be specified with + <param> tags. + --> + <param id="request_cpus">8</param> + </destination></destinations><tools><!-- Tools can be configured to use specific destinations or handlers, diff -r 6f9e73ec3e99d43f14e3d735ecfe7b66ea38472a -r 827ff13a72914ed3ddacace717cc07af66af718e lib/galaxy/jobs/runners/condor.py --- a/lib/galaxy/jobs/runners/condor.py +++ b/lib/galaxy/jobs/runners/condor.py @@ -32,6 +32,12 @@ %s """ +default_query_classad = dict( + universe = 'vanilla', + getenv = 'true', + notification = 'NEVER', +) + class CondorJobState( AsynchronousJobState ): def __init__( self, **kwargs ): """ @@ -71,6 +77,10 @@ # wrapper.get_id_tag() instead of job_id for compatibility with TaskWrappers. galaxy_id_tag = job_wrapper.get_id_tag() + # get destination params + query_params = default_query_classad.copy() + query_params.update( job_destination.params ) + # define job attributes cjs = CondorJobState( files_dir=self.app.config.cluster_files_directory, job_wrapper=job_wrapper ) cjs.user_log = os.path.join( self.app.config.cluster_files_directory, 'galaxy_%s.condor.log' % galaxy_id_tag ) @@ -78,13 +88,12 @@ submit_file = os.path.join( self.app.config.cluster_files_directory, 'galaxy_%s.condor.desc' % galaxy_id_tag ) executable = cjs.job_file submit_desc = [ ] - submit_desc.append( 'universe = vanilla' ) - submit_desc.append( 'getenv = true' ) + for k, v in query_params.items(): + submit_desc.append( '%s = %s' % ( k, v ) ) submit_desc.append( 'executable = ' + executable ) submit_desc.append( 'output = ' + cjs.output_file ) submit_desc.append( 'error = ' + cjs.error_file ) submit_desc.append( 'log = ' + cjs.user_log ) - submit_desc.append( 'notification = NEVER' ) submit_desc.append( 'queue' ) script = drm_template % (job_wrapper.galaxy_lib_dir, os.path.abspath( job_wrapper.working_directory ), command_line) @@ -138,15 +147,16 @@ # TODO Add extra except for OSError? s_out = str(e) - os.unlink( submit_file ) - if external_job_id is None: log.debug( "condor_submit failed for job %s: %s" % (job_wrapper.get_id_tag(), s_out) ) if self.app.config.cleanup_job == "always": + os.unlink( submit_file ) cjs.cleanup() job_wrapper.fail( "condor_submit failed", exception=True ) return + os.unlink( submit_file ) + log.info( "(%s) queued as %s" % ( galaxy_id_tag, external_job_id ) ) # store runner information for tracking if Galaxy restarts 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