本文整理汇总了Python中ProdCommon.MCPayloads.WorkflowSpec.WorkflowSpec.setActivity方法的典型用法代码示例。如果您正苦于以下问题:Python WorkflowSpec.setActivity方法的具体用法?Python WorkflowSpec.setActivity怎么用?Python WorkflowSpec.setActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProdCommon.MCPayloads.WorkflowSpec.WorkflowSpec
的用法示例。
在下文中一共展示了WorkflowSpec.setActivity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createCleanupWorkflowSpec
# 需要导入模块: from ProdCommon.MCPayloads.WorkflowSpec import WorkflowSpec [as 别名]
# 或者: from ProdCommon.MCPayloads.WorkflowSpec.WorkflowSpec import setActivity [as 别名]
def createCleanupWorkflowSpec():
"""
_createCleanupWorkflowSpec_
Create a generic cleanup WorkflowSpec definition
that can be used to generate a sanbox for cleanup jobs
"""
timestamp = str(time.asctime(time.localtime(time.time())))
timestamp = timestamp.replace(" ", "-")
timestamp = timestamp.replace(":", "_")
workflow = WorkflowSpec()
workflow.setWorkflowName("CleanUp-%s" % timestamp)
workflow.setActivity("CleanUp")
workflow.setRequestCategory("mc-cleanup")
workflow.setRequestTimestamp(timestamp)
workflow.parameters['WorkflowType']="CleanUp"
cleanUp = workflow.payload
cleanUp.name = "cleanUp1"
cleanUp.type = "CleanUp"
cleanUp.application["Project"] = ""
cleanUp.application["Version"] = ""
cleanUp.application["Architecture"] = ""
cleanUp.application["Executable"] = "RuntimeCleanUp.py" # binary name
cleanUp.configuration = ""
cleanUp.cfgInterface = None
return workflow
示例2: createLogCollectorWorkflowSpec
# 需要导入模块: from ProdCommon.MCPayloads.WorkflowSpec import WorkflowSpec [as 别名]
# 或者: from ProdCommon.MCPayloads.WorkflowSpec.WorkflowSpec import setActivity [as 别名]
def createLogCollectorWorkflowSpec(wf):
"""
_createLogColectorWorkflowSpec_
Create a generic LogArchive WorkflowSpec definition
"""
timestamp = str(time.asctime(time.localtime(time.time())))
timestamp = timestamp.replace(" ", "-")
timestamp = timestamp.replace(":", "_")
workflow = WorkflowSpec()
workflow.setWorkflowName("LogCollect-%s" % timestamp)
workflow.setActivity("LogCollect")
workflow.setRequestCategory("logcollect")
workflow.setRequestTimestamp(timestamp)
workflow.parameters["WorkflowType"] = "LogCollect"
logArchive = workflow.payload
logArchive.name = "logCollect1"
logArchive.type = "LogCollect"
# TODO: remove this?
# logArchive.workflow = wf
logArchive.configuration
logArchive.application["Project"] = ""
logArchive.application["Version"] = ""
logArchive.application["Architecture"] = ""
logArchive.application["Executable"] = "RuntimeLogCollector.py" # binary name
logArchive.configuration = ""
logArchive.cfgInterface = None
# set stageOut override
# cfg = IMProvNode("config")
# stageOut = IMProvNode("StageOutParameters")
# cfg.addNode()
# WorkflowTools.addStageOutNode(logArchive, "StageOut1")
# WorkflowTools.addStageOutOverride(logArchive, stageOutParams['command'],
# stageOutParams['option'],
# stageOutParams['se-name'],
# stageOutParams['lfnPrefix'])
return workflow
示例3: __init__
# 需要导入模块: from ProdCommon.MCPayloads.WorkflowSpec import WorkflowSpec [as 别名]
# 或者: from ProdCommon.MCPayloads.WorkflowSpec.WorkflowSpec import setActivity [as 别名]
#.........这里部分代码省略.........
def setAcquisitionEra(self,era):
"""
_setAcquisitionEra_
Sets the AcquisitionEra in the workflow
"""
self.workflow.setAcquisitionEra(era)
self.acquisitionEra=era
return
def setNamingConventionParameters(self, era, procString, procVers):
"""
_setNamingConventionParameters_
Sets AcquisitionEra, ProcessingString and ProcessingVersion
"""
self.workflow.setAcquisitionEra(era)
self.workflow.parameters['ProcessingString'] = procString
self.workflow.parameters['ProcessingVersion'] = procVers
self.acquisitionEra=era
self.processingString = procString
self.processingVersion = procVers
self.useProperNamingConventions = True
return
def setActivity(self, activity):
"""
_changeWorkflowType_
Set the workflow type
i.e. Simulation, Reconstruction, Reprocessing, Skimming
"""
self.workflow.setActivity(activity)
return
def setCMSSWVersion(self, version):
"""
_setCMSSWVersion_
Set the version of CMSSW to be used
"""
self.cmsswVersions.append(version)
self.cmsRunNode.application['Version'] = version
self.cmsRunNode.application['Executable'] = "cmsRun"
self.cmsRunNode.application['Project'] = "CMSSW"
self.cmsRunNode.application['Architecture'] = ""
return
def setUserSandbox(self,sandboxloc):
"""
_setSandbox_
Sets the location of the user sandbox
"""
self.cmsRunNode.userSandbox=sandboxloc