CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
o2olib.O2OTool Class Reference

Public Member Functions

def create (self)
 
def disable (self)
 
def dumpConf (self)
 
def enable (self)
 
def execute (self)
 
def listConf (self)
 
def listJobs (self)
 
def migrate (self)
 
def run (self)
 
def setConfig (self)
 
def setInterval (self)
 
def setup (self, args)
 

Public Attributes

 args
 
 mgr
 

Detailed Description

Definition at line 434 of file o2olib.py.

Member Function Documentation

def o2olib.O2OTool.create (   self)

Definition at line 504 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

504  def create(self):
505  self.mgr.add( self.args.name, self.args.configFile, self.args.interval, True )
506 
def create(self)
Definition: o2olib.py:504
def o2olib.O2OTool.disable (   self)

Definition at line 516 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

516  def disable(self):
517  self.mgr.set( self.args.name, False )
518 
def disable(self)
Definition: o2olib.py:516
def o2olib.O2OTool.dumpConf (   self)

Definition at line 528 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

528  def dumpConf(self):
529  self.mgr.dumpConfig( self.args.name, self.args.versionIndex, self.args.configFile )
530 
def dumpConf(self)
Definition: o2olib.py:528
def o2olib.O2OTool.enable (   self)

Definition at line 513 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

513  def enable(self):
514  self.mgr.set( self.args.name, True )
515 
def enable(self)
Definition: o2olib.py:513
def o2olib.O2OTool.execute (   self)

Definition at line 436 of file o2olib.py.

References cond::persistency::ITagTable.create(), cond::persistency::GLOBAL_TAG::Table.create(), cond::CoralServiceFactory.create(), cond::persistency::TAG::Table.create(), CrabTask.CrabTask.create(), converter::helper::ConcreteCreator.create(), cond::persistency::IPayloadTable.create(), converter::helper::PolymorphicCreator.create(), cond::persistency::IIOVTable.create(), cond::persistency::RUN_INFO::Table.create(), cond::persistency::GLOBAL_TAG_MAP::Table.create(), cond::persistency::PAYLOAD::Table.create(), cond::persistency::ITagMigrationTable.create(), cond::persistency::GTSchema.create(), cond::persistency::RunInfoSchema.create(), cond::persistency::IPayloadMigrationTable.create(), cond::persistency::ITagLogTable.create(), cond::persistency::IIOVSchema.create(), mps_create_file_lists.FileListCreator.create(), cond::persistency::IGTTable.create(), cond::persistency::IGTMapTable.create(), cond::persistency::IOV::Table.create(), cond::persistency::IGTSchema.create(), cond::persistency::IRunInfoTable.create(), cond::persistency::IRunInfoSchema.create(), cond::persistency::TAG_LOG::Table.create(), cond::persistency::IOVSchema.create(), o2olib.O2OTool.create(), o2olib.O2OTool.disable(), o2olib.O2OTool.dumpConf(), core.PileUpAnalyzer.PileUpAnalyzer.enable, o2olib.O2OTool.enable(), o2olib.O2OTool.listConf(), o2olib.O2OJobMgr.listJobs(), o2olib.O2OTool.listJobs(), o2olib.O2OTool.migrate(), splitter.FileObj.run, uploader.FileObj.run, uploadPayloads.FileObj.run, RPCRunIOV::RunIOV_Item.run, beamspot::BeamSpotContainer.run, TB06Reco.run, TB06RecoH2.run, RPCDQMObject.run, CmsswTask.CmsswTask.run(), MultiEventFilter::Event.run, CrabWatch.CrabWatch.run(), DTCalibrationWorker.DTCalibrationWorker.run(), cond::Utilities.run(), DTValidSummary.DTValidSummary.run(), L1Analysis::L1AnalysisEventDataFormat.run, PFEGammaToCandidateRemapper.run(), TrackInfoProducerAlgorithm.run(), DTDqm.DTDqm.run(), generateEDF.LumiInfo.run, lumi::Lumi2DB::LumiSource.run, MuonMillepedeAlgorithm.run(), SurveyAlignmentAlgorithm.run(), DTDQMMerge.DTDQMMerge.run(), Type1PFMET.run(), SeedGeneratorForLaserBeams.run(), CrabTask.CrabTask.run(), EfficiencyPlotter.run, WZInterestingEventSelector::event.run, LaserHitPairGenerator.run(), crabWrapper.CrabWrapper.run(), MuonDTLocalMillepedeAlgorithm.run(), DTVDriftSegmentWriter.DTVDriftSegmentWriter.run(), DTVDriftMeanTimerWriter.DTVDriftMeanTimerWriter.run(), HIPAlignmentAlgorithm.run(), MuonRecoTest.run, DTTTrigCorrFirst.DTTTrigCorrFirst.run(), DTTTrigProd.DTTTrigProd.run(), options.ConnectionHLTMenu.run, DTResolutionAnalysisTest.run, DTNoiseCalibration.DTNoiseCalibration.run(), BeamSpotRcdReader::theBSfromDB.run, DTDQMHarvesting.DTDQMHarvesting.run(), DTBlockedROChannelsTest.run, MatacqProducer::MatacqEventId.run, CSCOverlapsAlignmentAlgorithm.run(), DTDataIntegrityTest.run, DTTTrigTimeBoxesWriter.DTTTrigTimeBoxesWriter.run(), DTT0DBValidation.DTT0DBValidation.run(), DTChamberEfficiencyTest.run, DTTTrigResidualCorr.DTTTrigResidualCorr.run(), DTResolutionTest.run, ApeSettingAlgorithm.run(), ME::Header.run, ConstantStepOdeSolver.run(), DTEfficiencyTest.run, MillePedeAlignmentAlgorithm.run(), DTTTrigValid.DTTTrigValid.run(), DTResidualCalibration.DTResidualCalibration.run(), DTDQMValidation.DTDQMValidation.run(), MuonAlignmentFromReference.run(), DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.run(), DTAnalysisResiduals.DTAnalysisResiduals.run(), DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.run(), personalPlayback.Playback.run, HitEff.run, DQMNet::CoreObject.run, MatrixUtil.InputInfo.run, DTLocalTriggerBaseTest.run, EcalDeadCellDeltaRFilter.run, QIE8Simulator.run(), AlignmentAlgorithmBase.run(), cond::RunInfo_t.run, SiPixelErrorEstimation.run, personalPlayback.FrameworkJob.run, SiPixelTrackingRecHitsValid.run, o2olib.O2OTool.run(), dqm_interfaces.DirWalkerFile.run, JsonOutputProducer::JsonEvent.run, SummaryOutputProducer.run, SummaryOutputProducer::Event.run, o2olib.O2OJobMgr.setConfig(), o2olib.O2OTool.setConfig(), o2olib.O2OJobMgr.setInterval(), o2olib.O2OTool.setInterval(), HBHERecalibration.setup(), event.Event.setup, EcalGeomPhiSymHelper.setup(), HcalTPGScale.setup(), EcalTPGScale.setup(), CaloTPGTranscoderULUT.setup(), HcalPedestalAnalysis.setup(), CastorPedestalAnalysis.setup(), mps_alisetup.SetupAlignment.setup(), CandCombinerBase< OutputCollection, CandPtr >.setup(), querying.connection.setup(), NamedCandCombinerBase.setup(), NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.setup(), looper.Looper.setup, CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup >.setup(), options.HLTProcessOptions.setup, o2olib.O2OTool.setup(), and HcalObjRepresent::ADataRepr.setup().

436  def execute(self):
437  parser = argparse.ArgumentParser(description='CMS o2o command-line tool. For general help (manual page), use the help subcommand.')
438  parser.add_argument('--db', type=str, help='The target database: pro ( for prod ) or dev ( for prep ). default=pro')
439  parser.add_argument("--auth","-a", type=str, help="The path of the authentication file")
440  parser.add_argument('--verbose', '-v', action='count', help='The verbosity level')
441  parser_subparsers = parser.add_subparsers(title='Available subcommands')
442  parser_create = parser_subparsers.add_parser('create', description='Create a new O2O job')
443  parser_create.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
444  parser_create.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path',required=True)
445  parser_create.add_argument('--interval', '-i', type=int, help='the chron job interval',default=0)
446  parser_create.set_defaults(func=self.create)
447  parser_setConfig = parser_subparsers.add_parser('setConfig', description='Set a new configuration for the specified job. The configuration is expected as a list of entries "param": "value" (dictionary). The "param" labels will be used to inject the values in the command to execute. The dictionary is stored in JSON format.')
448  parser_setConfig.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
449  parser_setConfig.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path',required=True)
450  parser_setConfig.set_defaults(func=self.setConfig)
451  parser_setInterval = parser_subparsers.add_parser('setInterval',description='Set a new execution interval for the specified job')
452  parser_setInterval.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
453  parser_setInterval.add_argument('--interval', '-i', type=int, help='the chron job interval',required=True)
454  parser_setInterval.set_defaults(func=self.setInterval)
455  parser_enable = parser_subparsers.add_parser('enable',description='enable the O2O job')
456  parser_enable.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
457  parser_enable.set_defaults(func=self.enable)
458  parser_disable = parser_subparsers.add_parser('disable',description='disable the O2O job')
459  parser_disable.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
460  parser_disable.set_defaults(func=self.disable)
461  parser_migrateConf = parser_subparsers.add_parser('migrateConfig',description='migrate the tag info for the jobs in configuration entries')
462  parser_migrateConf.set_defaults(func=self.migrate)
463  parser_listJobs = parser_subparsers.add_parser('listJobs', description='list the registered jobs')
464  parser_listJobs.set_defaults(func=self.listJobs)
465  parser_listConf = parser_subparsers.add_parser('listConfig', description='shows the configurations for the specified job')
466  parser_listConf.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
467  parser_listConf.add_argument('--dump', type=int, help='Dump the specified config.',default=0)
468  parser_listConf.set_defaults(func=self.listConf)
469  parser_dumpConf = parser_subparsers.add_parser('dumpConfig', description='dumps a specific job configuration version')
470  parser_dumpConf.add_argument('versionIndex', type=str,help='the version to dump')
471  parser_dumpConf.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
472  parser_dumpConf.add_argument('--configFile', '-c', type=str, help='the JSON configuration file name - default:[jobname]_[version].json')
473  parser_dumpConf.set_defaults(func=self.dumpConf)
474  parser_run = parser_subparsers.add_parser('run', description='Wrapper for O2O jobs execution. Supports input parameter injection from the configuration file associated to the job. The formatting syntax supported are the python ones: "command -paramName {paramLabel}" or "command -paramName %(paramLabel)s". where [paramName] is the name of the parameter required for the command, and [paramLabel] is the key of the parameter entry in the config dictionary (recommended to be equal for clarity!"')
475  parser_run.add_argument('executable', type=str,help='command to execute')
476  parser_run.add_argument('--name', '-n', type=str, help='The o2o job name',required=True)
477  parser_run.set_defaults(func=self.run)
478 
479  args = parser.parse_args()
480 
481  if args.verbose >=1:
482  self.setup(args)
483  return args.func()
484  else:
485  try:
486  self.setup(args)
487  sys.exit( args.func())
488  except Exception as e:
489  logging.error(e)
490  sys.exit(1)
491 
def disable(self)
Definition: o2olib.py:516
def listJobs(self)
Definition: o2olib.py:522
def setup(self, args)
Definition: o2olib.py:492
def dumpConf(self)
Definition: o2olib.py:528
def setInterval(self)
Definition: o2olib.py:510
def migrate(self)
Definition: o2olib.py:519
def run(self)
Definition: o2olib.py:531
def enable(self)
Definition: o2olib.py:513
def create(self)
Definition: o2olib.py:504
def setConfig(self)
Definition: o2olib.py:507
def listConf(self)
Definition: o2olib.py:525
def execute(self)
Definition: o2olib.py:436
def o2olib.O2OTool.listConf (   self)

Definition at line 525 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

525  def listConf(self):
526  self.mgr.listConfig( self.args.name )
527 
def listConf(self)
Definition: o2olib.py:525
def o2olib.O2OTool.listJobs (   self)

Definition at line 522 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

522  def listJobs(self):
523  self.mgr.listJobs()
524 
def listJobs(self)
Definition: o2olib.py:522
def o2olib.O2OTool.migrate (   self)

Definition at line 519 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

519  def migrate(self):
520  self.mgr.migrateConfig()
521 
def migrate(self)
Definition: o2olib.py:519
def o2olib.O2OTool.run (   self)

Definition at line 531 of file o2olib.py.

References o2olib.O2OTool.args.

Referenced by Types.EventID.cppID(), Types.LuminosityBlockID.cppID(), and o2olib.O2OTool.execute().

531  def run(self):
532  rmgr = self.mgr.runManager()
533  return rmgr.executeJob( self.args )
534 
def run(self)
Definition: o2olib.py:531
def o2olib.O2OTool.setConfig (   self)

Definition at line 507 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

507  def setConfig(self):
508  self.mgr.setConfig( self.args.name, self.args.configFile )
509 
def setConfig(self)
Definition: o2olib.py:507
def o2olib.O2OTool.setInterval (   self)

Definition at line 510 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

510  def setInterval(self):
511  self.mgr.setInterval( self.args.name, self.args.interval )
512 
def setInterval(self)
Definition: o2olib.py:510
def o2olib.O2OTool.setup (   self,
  args 
)

Definition at line 492 of file o2olib.py.

Referenced by o2olib.O2OTool.execute().

492  def setup(self, args):
493  self.args = args
494  db_service = prod_db_service
495  if args.db is not None:
496  if args.db == 'dev' or args.db == 'oradev' :
497  db_service = dev_db_service
498  elif args.db != 'orapro' and args.db != 'onlineorapro' and args.db != 'pro':
499  raise Exception("Database '%s' is not known." %args.db )
500 
501  self.mgr = O2OJobMgr()
502  return self.mgr.connect( db_service, args )
503 
def setup(self, args)
Definition: o2olib.py:492

Member Data Documentation

o2olib.O2OTool.args
o2olib.O2OTool.mgr

Definition at line 501 of file o2olib.py.