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 130 of file o2o.py.

Constructor & Destructor Documentation

def o2o.O2ORunMgr.__init__ (   self)

Definition at line 132 of file o2o.py.

133  def __init__( self ):
134  O2OMgr.__init__(self)
135  self.job_name = None
136  self.start = None
137  self.end = None
def __init__
Definition: o2o.py:132

Member Function Documentation

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

Definition at line 145 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().

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

Definition at line 175 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().

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

Definition at line 185 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().

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

Definition at line 138 of file o2o.py.

References o2o.O2OMgr.logger.

Referenced by conditionUploadTest.UploadTest.upload().

139  def log( self, level, message ):
140  consoleLog = getattr(O2OMgr.logger( self ),level)
141  consoleLog( message )
142  if self.logger:
143  fileLog = getattr(self.logger, level )
144  fileLog( message )
logger
Definition: o2o.py:60
def log
Definition: o2o.py:138
def o2o.O2ORunMgr.startJob (   self,
  job_name 
)

Definition at line 152 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().

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

Member Data Documentation

o2o.O2ORunMgr.end

Definition at line 136 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 134 of file o2o.py.

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

o2o.O2ORunMgr.session

Definition at line 146 of file o2o.py.

o2o.O2ORunMgr.start

Definition at line 135 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().