CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
o2o.O2ORunMgr Class Reference
Inheritance diagram for o2o.O2ORunMgr:
o2o.O2OMgr

Public Member Functions

def __init__
 
def connect
 
def endJob
 
def executeJob
 
def log
 
def startJob
 
- Public Member Functions inherited from o2o.O2OMgr
def __init__
 
def getSession
 
def logger
 

Public Attributes

 end
 
 job_name
 
 session
 
 start
 
- Public Attributes inherited from o2o.O2OMgr
 eng
 
 logger
 

Detailed Description

Definition at line 133 of file o2o.py.

Constructor & Destructor Documentation

def o2o.O2ORunMgr.__init__ (   self)

Definition at line 135 of file o2o.py.

136  def __init__( self ):
137  O2OMgr.__init__(self)
138  self.job_name = None
139  self.start = None
140  self.end = None
def __init__
Definition: o2o.py:135

Member Function Documentation

def o2o.O2ORunMgr.connect (   self,
  service,
  auth 
)

Definition at line 148 of file o2o.py.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.__init__(), Vispa.Views.PropertyView.BooleanProperty.__init__(), Vispa.Gui.FindDialog.FindDialog._addScript(), Vispa.Gui.FindDialog.FindDialog._addStringProperty(), Vispa.Main.Application.Application._connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView._createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog.addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer.addWidget(), Vispa.Views.PropertyView.PropertyView.append(), Vispa.Views.PropertyView.PropertyView.appendAddRow(), Vispa.Main.Application.Application.createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createButton(), Vispa.Views.LineDecayView.LineDecayView.createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer.createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.find(), Vispa.Gui.PortWidget.PortWidget.mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty.setChecked(), Vispa.Main.SplitterTab.SplitterTab.setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab.setController(), Vispa.Views.PropertyView.BooleanProperty.setReadOnly(), Vispa.Views.PropertyView.DropDownProperty.setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty.setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setTab(), Vispa.Views.PropertyView.IntegerProperty.setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateViewMenu().

149  def connect( self, service, auth ):
150  self.session = O2OMgr.getSession( self,service, auth )
151  if self.session is None:
152  return False
153  else:
154  return True
def connect
Definition: o2o.py:148
def o2o.O2ORunMgr.endJob (   self,
  status,
  log 
)

Definition at line 178 of file o2o.py.

References poly< T >::const_iterator.end, o2o.O2ORunMgr.end, svgfig.LineAxis.end, relativeConstraints.error, info(), o2o.O2ORun.job_name, o2o.O2ORunMgr.job_name, o2o.O2ORunMgr.start, and svgfig.LineAxis.start.

Referenced by o2o.O2ORunMgr.executeJob().

179  def endJob( self, status, log ):
180  self.end = datetime.now()
181  try:
182  run = O2ORun(job_name=self.job_name,start_time=self.start,end_time=self.end,status_code=status,log=log)
183  self.session.merge(run)
184  self.session.commit()
185  O2OMgr.logger( self ).info( 'Job %s ended.', self.job_name )
186  except sqlalchemy.exc.SQLAlchemyError as dberror:
187  O2OMgr.logger( self ).error( str(dberror) )
def endJob
Definition: o2o.py:178
static const TGPicture * info(bool iBackgroundIsBlack)
def o2o.O2ORunMgr.executeJob (   self,
  job_name,
  command 
)

Definition at line 188 of file o2o.py.

References HcalLutGenerator.endJob(), sistrip::EnsembleCalibrationLA.endJob(), HcalCableMapper.endJob(), SiStripDetVOffHandler.endJob(), EcalStatusAnalyzer.endJob(), PhiSymmetryCalibration_step2.endJob(), PhiSymmetryCalibration_step2_SM.endJob(), RawDataConverter.endJob(), CandPtrProjector.endJob(), EcalTPGParamReaderFromDB.endJob(), EcalMatacqAnalyzer.endJob(), EcalPerEvtMatacqAnalyzer.endJob(), AlcaBeamSpotHarvester.endJob(), SiStripDetVOffTkMapPlotter.endJob(), DTCalibMuonSelection.endJob(), DTTPAnalyzer.endJob(), AlignmentPrescaler.endJob(), EcalDigiDisplay.endJob(), LSNumberFilter.endJob(), SiStripQualityStatistics.endJob(), ObjectCounter< C >.endJob(), TkAlCaSkimTreeMerger.endJob(), DTVDriftSegmentCalibration.endJob(), EcalPnGraphs.endJob(), DTVDriftWriter.endJob(), SiStripDetVOffTrendPlotter.endJob(), CandidateTriggerObjectProducer.endJob(), popcon::PopConAnalyzer< S >.endJob(), AlcaBeamSpotFromDB.endJob(), SiPixelFedFillerWordEventNumber.endJob(), DTTTrigCorrectionFirst.endJob(), AlignmentStats.endJob(), WriteEcalMiscalibConstantsMC.endJob(), WriteEcalMiscalibConstants.endJob(), DTMapGenerator.endJob(), DTSurveyConvert.endJob(), DTT0Correction.endJob(), DTTTrigOffsetCalibration.endJob(), HcalCalibrator.endJob(), DTTTrigCorrection.endJob(), LaserDQM.endJob(), SubdetFEDSelector.endJob(), DTResidualCalibration.endJob(), ShallowTree.endJob(), SurveyDataConverter.endJob(), PuppiProducer.endJob(), SiStripRegFEDSelector.endJob(), FilterTrackerOn.endJob(), AlCaElectronsTest.endJob(), MuonAlignmentPreFilter.endJob(), SiStripLAProfileBooker.endJob(), DTTTrigWriter.endJob(), ValidationMisalignedTracker.endJob(), TkVoltageMapCreator.endJob(), DTTPDeadWriter.endJob(), EcalIsolatedParticleCandidateProducer.endJob(), DTNoiseCalibration.endJob(), DTT0Calibration.endJob(), EcalPedHists.endJob(), miscalibExample.endJob(), LaserAlignmentT0Producer.endJob(), DTT0CalibrationNew.endJob(), BooleanFlagFilter.endJob(), IsolatedParticlesGeneratedJets.endJob(), EcalABAnalyzer.endJob(), DTVDriftCalibration.endJob(), EcalPerEvtLaserAnalyzer.endJob(), SimAnalyzerMinbias.endJob(), SurveyDBUploader.endJob(), AlCaDiJetsProducer.endJob(), EcalTestPulseAnalyzer.endJob(), EcalPedOffset.endJob(), ECALRegFEDSelector.endJob(), SiPixelCalibDigiFilter.endJob(), DTTTrigCalibration.endJob(), AlCaGammaJetProducer.endJob(), StudyHLT.endJob(), CSCOverlapsBeamSplashCut.endJob(), HcalCorrPFCalculation.endJob(), RecAnalyzerMinbias.endJob(), Tracker_OldtoNewConverter.endJob(), cms::ProducerAnalyzer.endJob(), JetConstituentSelector< T, C >.endJob(), PhiSymmetryCalibration.endJob(), MuonAlignmentAnalyzer.endJob(), DTNoiseComputation.endJob(), ElectronCalibration.endJob(), PrescalerFHN.endJob(), WriteL1TriggerObjetsXml.endJob(), EcalPulseShapeGrapher.endJob(), ValueMapTraslator.endJob(), EcalRecHitsFilter.endJob(), EcalLaserAnalyzer2.endJob(), SiPixelDQMRocLevelAnalyzer.endJob(), HitEff.endJob(), cms::HcalConstantsASCIIWriter.endJob(), EcalLaserAnalyzer.endJob(), JetDeltaRTagInfoValueMapProducer< T, I >.endJob(), EcalBxOrbitNumberGrapher.endJob(), testChannel.endJob(), cms::Analyzer_minbias.endJob(), HcalLuttoDB.endJob(), TrackerGeometryCompare.endJob(), EcalURecHitHists.endJob(), LhcTrackAnalyzer.endJob(), EcalLaserAnalyzerYousi.endJob(), ElectronCalibrationUniv.endJob(), HcalRaddamMuon.endJob(), SiPixelErrorsDigisToCalibDigis.endJob(), EcalMipGraphs.endJob(), ApeEstimatorSummary.endJob(), CosmicSplitterValidation.endJob(), TrackerToMuonPropagator.endJob(), SiPixelErrorEstimation.endJob(), CSCOverlapsTrackPreparation.endJob(), EcalDisplaysByEvent.endJob(), HcalHBHEMuonAnalyzer.endJob(), AnalyzerMinbias.endJob(), AlignmentMonitorAsAnalyzer.endJob(), EopTreeWriter.endJob(), ValidIsoTrkCalib.endJob(), IsoTrig.endJob(), EcalCosmicsHists.endJob(), TrackerTreeGenerator.endJob(), PrimaryVertexValidation.endJob(), ValidationHcalIsoTrackAlCaReco.endJob(), DiJetAnalyzer.endJob(), SelectedElectronFEDListProducer< TEle, TCand >.endJob(), LaserAlignment.endJob(), IsoTrackCalib.endJob(), IsolatedGenParticles.endJob(), analyzer::SiPixelLorentzAngle.endJob(), PCLTrackerAlProducer.endJob(), TrackerOfflineValidationSummary.endJob(), IsolatedTracksCone.endJob(), IsolatedTracksHcalScale.endJob(), LaserSorter.endJob(), IsolatedTracksNxN.endJob(), GammaJetAnalysis.endJob(), ApeEstimator.endJob(), SiPixelOfflineCalibAnalysisBase.endJob(), GlobalTrackerMuonAlignment.endJob(), AlCaHOCalibProducer.endJob(), o2o.O2ORunMgr.endJob(), TrackerOfflineValidation.endJob(), HOCalibAnalyzer.endJob(), ConditionDBWriter< T >.endJob(), ResidualRefitting.endJob(), relativeConstraints.error, info(), and o2o.O2ORunMgr.startJob().

189  def executeJob( self, job_name, command ):
190  logFolder = os.getcwd()
191  if logFolderEnvVar in os.environ:
192  logFolder = os.environ[logFolderEnvVar]
193  datelabel = datetime.now().strftime("%y-%m-%d-%H-%M-%S")
194  logFileName = '%s-%s.log' %(job_name,datelabel)
195  logFile = os.path.join(logFolder,logFileName)
196  exists, enabled = self.startJob( job_name )
197  if exists is None:
198  return 3
199  if enabled is None:
200  O2OMgr.logger( self).error( 'The job %s is unknown.', job_name )
201  return 2
202  else:
203  if enabled == 0:
204  O2OMgr.logger( self).error( 'The job %s has been disabled.', job_name )
205  return 1
206  try:
207  O2OMgr.logger( self ).info('Executing job %s', job_name )
208  pipe = subprocess.Popen( command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
209  out = pipe.communicate()[0]
210  O2OMgr.logger( self ).info( 'Job %s returned code: %s' %(job_name,pipe.returncode) )
211  except Exception as e:
212  O2OMgr.logger( self ).error( str(e) )
213  return 4
214  self.endJob( pipe.returncode, out )
215  with open(logFile,'a') as logF:
216  logF.write(out)
217  return 0
218 
219 
def endJob
Definition: o2o.py:178
static const TGPicture * info(bool iBackgroundIsBlack)
def executeJob
Definition: o2o.py:188
def startJob
Definition: o2o.py:155
def o2o.O2ORunMgr.log (   self,
  level,
  message 
)

Definition at line 141 of file o2o.py.

References o2o.O2OMgr.logger.

Referenced by conditionUploadTest.UploadTest.upload().

142  def log( self, level, message ):
143  consoleLog = getattr(O2OMgr.logger( self ),level)
144  consoleLog( message )
145  if self.logger:
146  fileLog = getattr(self.logger, level )
147  fileLog( message )
logger
Definition: o2o.py:62
def log
Definition: o2o.py:141
def o2o.O2ORunMgr.startJob (   self,
  job_name 
)

Definition at line 155 of file o2o.py.

References relativeConstraints.error, info(), o2o.O2ORun.job_name, o2o.O2ORunMgr.job_name, o2o.O2ORunMgr.start, and svgfig.LineAxis.start.

Referenced by o2o.O2ORunMgr.executeJob().

156  def startJob( self, job_name ):
157  O2OMgr.logger( self ).info('Checking job %s', job_name)
158  exists = None
159  enabled = None
160  try:
161  res = self.session.query(O2OJob.enabled).filter_by(name=job_name)
162  for r in res:
163  exists = True
164  enabled = r
165  if exists is None:
166  exists = False
167  if enabled:
168  self.job_name = job_name
169  self.start = datetime.now()
170  run = O2ORun(job_name=self.job_name,start_time=self.start,status_code=startStatus)
171  self.session.add(run)
172  self.session.commit()
173  except sqlalchemy.exc.SQLAlchemyError as dberror:
174  print 'Error: [%s]' %str(dberror)
175  O2OMgr.logger( self ).error( str(dberror) )
176  return exists, enabled
177 
static const TGPicture * info(bool iBackgroundIsBlack)
def startJob
Definition: o2o.py:155

Member Data Documentation

o2o.O2ORunMgr.end

Definition at line 139 of file o2o.py.

Referenced by Types.LuminosityBlockRange.cppID(), Types.EventRange.cppID(), o2o.O2ORunMgr.endJob(), and cmsPerfSuite.PerfSuiteTimer.set_end().

o2o.O2ORunMgr.job_name

Definition at line 137 of file o2o.py.

Referenced by o2o.O2ORunMgr.endJob(), and o2o.O2ORunMgr.startJob().

o2o.O2ORunMgr.session

Definition at line 149 of file o2o.py.

o2o.O2ORunMgr.start

Definition at line 138 of file o2o.py.

Referenced by progressbar.ProgressBar.__next__(), Types.LuminosityBlockRange.cppID(), Types.EventRange.cppID(), o2o.O2ORunMgr.endJob(), cmsPerfSuite.PerfSuiteTimer.set_end(), cmsPerfSuite.PerfSuiteTimer.set_start(), and o2o.O2ORunMgr.startJob().