# Start run
elif re.match(u"start", msg):
words = msg.split()
- if len(words) == 2:
- self.sequencingFinished(words[1])
- reply = u"starting run for %s" % (words[1])
+ if len(words) == 3:
+ self.sequencingFinished(words[1],words[2])
+ reply = u"starting run for FCID: %s and RunFolder: %s" % (words[1],words[2])
else:
reply = u"need runfolder name"
else:
return 'StatusReport: Not implemented'
- def sequencingFinished(self, flowcell):
+ def sequencingFinished(self, run_dir, flowcell):
"""
Sequenceing (and copying) is finished, time to start pipeline
"""
logging.debug("received sequencing finished message")
- self.launchJob(flowcell)
+ self.launchJob(run_dir, flowcell)
return "started"
self.send(u, msg)
- def _runner(self, flowcell):
+ def _runner(self,run_dir,flowcell):
# retrieve config step
# example error message
ferr = open(stderr_filepath, 'w')
pipe = subprocess.Popen(['./MainPipelineScript',
- '%s' % (flowcell)],
+ '%s' % (flowcell),'%s' % (os.path.join(self.base_analysis_dir,run_dir))],
stdout=fout,
stderr=ferr)
- print "Attempting run at: %s" % (time.ctime())
+ self.reportMsg("Attempting run at: %s" % (time.ctime()))
error_code = pipe.wait()
self.reportMsg("Return code is: %s" % (error_code))
fout.close()
ferr.close()
-
- def launchJob(self, flowcell):
+ fout = open(stdout_filepath, 'r')
+ self.reportMsg(fout.read())
+ fout.close()
+
+ def launchJob(self, run_dir,flowcell):
"""
Starts up a thread for running the pipeline
"""
t = threading.Thread(target=self._runner,
- args=[flowcell])
+ args=[run_dir,flowcell])
t.setDaemon(True)
t.start()