rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
for channel in self.channel_names: if args[0].split('!', 1)[0] in self.channel_names[channel]:
for channel in self.factory.handlers: if (channel in self.channel_names and args[0].split('!', 1)[0] in self.channel_names[channel]):
def call_handlers(self, event, channel, args=[]): # If the channel is None, this is a server event not associated with a # specific channel, such as a successful sign-on or a quit. Send the # event to every registered handler. if channel is None: handlers = set() # If this is a quit or nick change, only invoke callba...
for channel in self.channel_names:
for channel in self.factory.handlers:
def call_handlers(self, event, channel, args=[]): # If the channel is None, this is a server event not associated with a # specific channel, such as a successful sign-on or a quit. Send the # event to every registered handler. if channel is None: handlers = set() # If this is a quit or nick change, only invoke callba...
try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode message from %s on channel %s.' % (user, channel)) return
def privmsg(self, user, channel, message): try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode message from %s on channel %s.' % (user, channel)) return
try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode notice from %s on channel %s.' % (user, channel)) return
def noticed(self, user, channel, message): try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode notice from %s on channel %s.' % (user, channel)) return if channel[0] not in irc.CHANNEL_PREFIXES: log.msg('Notice from %s for %s: %s' % (user, channel, message))
try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode kick message from %s on channel %s.' % (kicker, channel)) message = u''
def kickedFrom(self, channel, kicker, message): try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode kick message from %s on channel %s.' % (kicker, channel)) message = u'' self.call_handlers('kickedFrom', channel, [channel, kicker, message]) self.channel_name...
try: quitMessage = quitMessage.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode quit message from %s.' % user) quitMessage = u''
def userQuit(self, user, quitMessage): try: quitMessage = quitMessage.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode quit message from %s.' % user) quitMessage = u'' self.call_handlers('userQuit', None, [user, quitMessage]) for channel in self.channel_names: self.channel_names...
try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode kick message from %s on channel %s.' % (kicker, channel)) message = u''
def userKicked(self, kickee, channel, kicker, message): try: message = message.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode kick message from %s on channel %s.' % (kicker, channel)) message = u'' self.call_handlers('userKicked', channel, [kickee, channel, kicker, message]) s...
try: data = data.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode action from %s on channel %s.' % (user, channel)) return
def action(self, user, channel, data): try: data = data.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode action from %s on channel %s.' % (user, channel)) return self.call_handlers('action', channel, [user, channel, data])
try: newTopic = newTopic.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode topic from %s on channel %s.' % (user, channel)) return
def topicUpdated(self, user, channel, newTopic): try: newTopic = newTopic.decode(self.factory.encoding) except UnicodeDecodeError: log.err(None, 'Could not decode topic from %s on channel %s.' % (user, channel)) return self.call_handlers('topicUpdated', channel, [user, channel, newTopic])
if reason is not None: try: reason = reason.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode kick message to %s on channel ' '%s.' % (user, channel)) reason = None
def kick(self, channel, user, reason=None): self.call_handlers('kick', channel, [channel, user, reason]) if reason is not None: try: reason = reason.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode kick message to %s on channel ' '%s.' % (user, channel)) reason = None irc.IRCCl...
if topic is not None: try: topic = topic.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode topic on channel %s.' % channel) return
def topic(self, channel, topic=None): self.call_handlers('topic', channel, [channel, topic]) if topic is not None: try: topic = topic.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode topic on channel %s.' % channel) return irc.IRCClient.topic(self, channel, topic)
try: message = message.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode message to %s.' % user) return
def msg(self, user, message): self.call_handlers('msg', user, [user, message])
try: message = message.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode notice to %s.' % user) return
def notice(self, user, message): self.call_handlers('notice', user, [user, message])
user = user.split('!', 1)[0]
user = prefix.split('!', 1)[0]
def userQuit(self, bot, prefix, quitMessage): user = user.split('!', 1)[0] self._update_record(user, 'userQuit', data=quitMessage)
self.userRenamed(bot, self.nickname, nick)
self.userRenamed(bot, bot.nickname, nick)
def nickChanged(self, bot, nick): self.userRenamed(bot, self.nickname, nick)
print "cmd = ",cmd
def copyToRemote(self, localName, remoteName): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:copyToRemote") localNameURL = "%s%s" % ("file://",localName) remoteNameURL = "%s%s" % (self.transferProtocolPrefix, remoteName)
print "self.localStagingDir = ",self.localStagingDir
def createDirs(self, platformPolicy, pipelinePolicy): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:createDirs")
print "configPolicy:" print configPolicy print "++++"
def writeGlideinRequest(self, configPolicy): self.logger.log(Log.DEBUG, "VanillaPipelineWorkflowConfigurator:writeGlideinRequest") print "configPolicy:" print configPolicy print "++++" glideinRequest = configPolicy.get("glideinRequest") templateFileName = glideinRequest.get("templateFileName") templateFileName = EnvStr...
expandedPipelinePolicies = self.expandPolicies(pipelinePolicies)
expandedPipelinePolicies = self.expandPolicies(self.shortName, pipelinePolicies)
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:configure") self.shortName = wfPolicy.get("shortName") if wfPolicy.getValueType("platform") == pol.Policy.FILE: filename = wfPolicy.getFile("platform").getPath() platformPolicy = pol.Policy.createPolicy(f...
def expandPolicies(self, pipelinePolicies): expanded = []
def expandPolicies(self, wfShortName, pipelinePolicies): wfPolicies = self.prodPolicy.getArray("workflow")
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:configure") self.shortName = wfPolicy.get("shortName") if wfPolicy.getValueType("platform") == pol.Policy.FILE: filename = wfPolicy.getFile("platform").getPath() platformPolicy = pol.Policy.createPolicy(f...
for policy in pipelinePolicies: runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): expanded.append((policy,i+1, totalCount)) totalCount = totalCount + 1 return expanded
for wfPolicy in wfPolicies: if wfPolicy.get("shortName") == wfShortName: expanded = [] for policy in pipelinePolicies: runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): expanded.append((policy,i+1, totalCount)) totalCount = totalCount + 1 return expanded else: p...
def expandPolicies(self, pipelinePolicies): expanded = [] totalCount = 1 for policy in pipelinePolicies: # default to 1, if runCount doesn't exist runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): expanded.append((policy,i+1, totalCount)) totalCount = totalCount + ...
self.workflowConfigurator = None
self._workflowConfigurator = None
def __init__(self, name, runid, wfPolicy, prodPolicy, logger=None):
self.configure() self._monitor = self.workflowLauncher.launch()
self._workflowLauncher = self.configure() self._monitor = self._workflowLauncher.launch()
def runWorkflow(self): self.logger.log(Log.DEBUG, "WorkflowManager:runWorkflow")
if self.workflowConfigurator:
if self._workflowConfigurator:
def configure(self, provSetup=None, workflowVerbosity=None): self.logger.log(Log.DEBUG, "WorkflowManager:configure") if self.workflowConfigurator: self.logger.log(Log.INFO-1, "production has already been configured.") return # lock this branch of code try: self._locked.acquire()
self.workflowConfigurator = self.createConfigurator(self.runid, self.wfPolicy,
self._workflowConfigurator = self.createConfigurator(self.runid, self.wfPolicy,
def configure(self, provSetup=None, workflowVerbosity=None): self.logger.log(Log.DEBUG, "WorkflowManager:configure") if self.workflowConfigurator: self.logger.log(Log.INFO-1, "production has already been configured.") return # lock this branch of code try: self._locked.acquire()
self.workflowConfigurator.configure(provSetup, workflowVerbosity)
self._workflowLauncher = self._workflowConfigurator.configure(provSetup, workflowVerbosity)
def configure(self, provSetup=None, workflowVerbosity=None): self.logger.log(Log.DEBUG, "WorkflowManager:configure") if self.workflowConfigurator: self.logger.log(Log.INFO-1, "production has already been configured.") return # lock this branch of code try: self._locked.acquire()
return self.workflowConfigurator
return self._workflowLauncher
def configure(self, provSetup=None, workflowVerbosity=None): self.logger.log(Log.DEBUG, "WorkflowManager:configure") if self.workflowConfigurator: self.logger.log(Log.INFO-1, "production has already been configured.") return # lock this branch of code try: self._locked.acquire()
self.abeLoginName = "login-abe.ncsa.teragrid.org" self.abeFTPName = "gridftp-abe.ncsa.teragrid.org" self.abePrefix = "gsiftp://"+self.abeFTPName
def __init__(self, runid, logger, verbosity): # TODO: these should be in the .paf file self.abeLoginName = "login-abe.ncsa.teragrid.org" self.abeFTPName = "gridftp-abe.ncsa.teragrid.org" self.abePrefix = "gsiftp://"+self.abeFTPName self.runid = runid self.logger = logger self.logger.log(Log.DEBUG, "DagmanPipelineConfig...
self.tmpdir = os.path.join("/tmp",self.runid) if not os.path.exists(self.tmpdir): os.makedir(self.tmpdir)
def __init__(self, runid, logger, verbosity): # TODO: these should be in the .paf file self.abeLoginName = "login-abe.ncsa.teragrid.org" self.abeFTPName = "gridftp-abe.ncsa.teragrid.org" self.abePrefix = "gsiftp://"+self.abeFTPName self.runid = runid self.logger = logger self.logger.log(Log.DEBUG, "DagmanPipelineConfig...
self.policy = policy
def configure(self, policy, configurationDict, provenanceDict, repository): self.logger.log(Log.DEBUG, "DagmanPipelineConfigurator:configure")
newPolicyFile = os.path.join(self.tmpdir, configurationFileName+".tmp."+self.runid)
newPolicyFile = os.path.join(self.tmpdir, self.pipeline+".paf.tmp")
def deploySetup(self): self.logger.log(Log.DEBUG, "DagmanPipelineConfigurator:deploySetup")
self.logger.log(Log.WARN, "Working directory already contains %s")
self.logger.log(Log.WARN, "Working directory already contains %s" % newPolicyFile)
def deploySetup(self): self.logger.log(Log.DEBUG, "DagmanPipelineConfigurator:deploySetup")
self.copyToRemote(newPolicyFile,configurationFileName)
self.copyToRemote(newPolicyFile,self.pipeline+".paf")
def deploySetup(self): self.logger.log(Log.DEBUG, "DagmanPipelineConfigurator:deploySetup")
provenanceCmd = "
remoterepos = os.path.join(self.dirs.get("work"),self.pipeline) provenanceCmd = "
def createLaunchScript(self): # write out the script we use to kick things off user = self.provenanceDict["user"] runid = self.provenanceDict["runid"] dbrun = self.provenanceDict["dbrun"] dbglobal = self.provenanceDict["dbglobal"] repos = self.provenanceDict["repos"]
print input, "-", output
def rewrite(self, input, output, pairs): #pairs = [("$START_OWNER", "srp"), ("$ADMIN_EMAIL", "srp@ncsa.uiuc.edu"), ("$MACHINE_COUNT", "1"), ("$TIME_REQUESTED","15")]
for pair in pairs: line = line.replace(pair[0],pair[1]) print line,
for name in pairs.names(): key = "$"+name val = str(pairs.get(name)) line = line.replace(key, val) fpOutput.write(line)
def rewrite(self, input, output, pairs): #pairs = [("$START_OWNER", "srp"), ("$ADMIN_EMAIL", "srp@ncsa.uiuc.edu"), ("$MACHINE_COUNT", "1"), ("$TIME_REQUESTED","15")]
print "submitted job file %s. It is job
print "submitted job
def submitJob(self, condorFile): self.logger.log(Log.DEBUG, "CondorJobs:submitJob") clusterexp = re.compile("1 job\(s\) submitted to cluster (\d+).") submitRequest = "condor_submit %s" % condorFile pop = os.popen(submitRequest, "r") line = pop.readline() line = pop.readline() line = pop.readline() num = clusterexp.f...
def waitForJobToRun(self, num):
def waitForJobToRun(self, num, extramsg=None):
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
print "this might take a few minutes"
if extramsg != None: print extramsg
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
print "Waited %d minute%s so far. Still waiting for job %s to run." % ((secondsWaited / 60), ("" if (minutes == 1) else "s"), num)
print "waited %d minute%s so far. still waiting for job %s to run." % ((secondsWaited / 60), ("" if (minutes == 1) else "s"), num)
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
print values
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
return 'R'
return runstate
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
return 'H'
return runstate
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
return 'X'
return runstate if (values[0] == jobNum) and (runstate == 'C'): pop.close() print "Job %s is being cancelled." % num return runstate
def waitForJobToRun(self, num): self.logger.log(Log.DEBUG, "CondorJobs:waitForJobToRun") jobNum = "%s.0" % num queueExp = re.compile("\S+") cJobSeen = 0 print "waiting for job %s to run." % num print "this might take a few minutes" secondsWaited = 0 while 1: pop = os.popen("condor_q", "r") bJobSeenNow = False if (secon...
print "running cmd = "+cmd
def runPipelines(self):
print "would run: "+cmd
print "running cmd = "+cmd
def runPipelines(self):
shutdownData = self._evsys.receive(self._topic, self._timeout) while self._parent.isRunning() and shutdownData is None:
shutdownEvent = self._evsys.receiveEvent(self._topic, self._timeout) while self._parent.isRunning() and shutdownEvent is None:
def run(self): self._parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)
shutdownData = self._evsys.receive(self._topic, self._timeout)
shutdownEvent = self._evsys.receiveEvent(self._topic, self._timeout)
def run(self): self._parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)
if shutdownData:
if shutdownEvent: shutdownData = shutdownEvent.getPropertySet()
def run(self): self._parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)
launchName = "%s_%d" % (pipelineShortName, num) self.setDirs(launchName)
indexName = "%s_%d" % (pipelineShortName, num) self.directories = self.directoryList[indexName] self.dirs = self.directories.getDirs() indexedNamedDir = os.path.join(self.localWorkflowDir, indexName) self.localWorkDir = os.path.join(indexedNamedDir, "work")
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:configure")
self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator: launchName = %s" % launchName)
self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator: indexName = %s" % indexName)
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:configure")
condorFile = self.writeCondorFile(launchName, "launch_%s.sh" % launchName)
condorFile = self.writeCondorFile(indexName, "launch_%s.sh" % indexName)
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:configure")
firstGroup = True for pipelinePolicyGroup in expandedPipelinePolicies: pipelinePolicy = pipelinePolicyGroup[0] num = pipelinePolicyGroup[1] pipelineShortName = pipelinePolicy.get("shortName") launchName = "%s_%d" % (pipelineShortName, num) self.setDirs(launchName) if firstGroup == True: self.copyAndRunLinkScript(wf...
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "VanillaCondorWorkflowConfigurator:configure")
def setDirs(self, indexedDirName): self.directories = self.directoryList[indexedDirName] self.dirs = self.directories.getDirs() self.localStagingDir = os.path.join(self.localScratch, self.runid) self.localWorkflowDir = os.path.join(self.localStagingDir, self.shortName) self.indexedNamedDir = os.path.join(self.localWork...
def setDirs(self, indexedDirName): self.directories = self.directoryList[indexedDirName] self.dirs = self.directories.getDirs() self.localStagingDir = os.path.join(self.localScratch, self.runid) self.localWorkflowDir = os.path.join(self.localStagingDir, self.shortName) self.indexedNamedDir = os.path.join(self.localWork...
def copyAndRunLinkScript(self, wfPolicy): self.logger.log(Log.DEBUG, "VanillaPipelineWorkflowConfigurator:copyAndRunLinkScript") if wfPolicy.exists("configuration"): configuration = wfPolicy.get("configuration") if configuration.exists("deployData"): deployPolicy = configuration.get("deployData") dataRepository = depl...
def copyLinkScript(self, wfPolicy): self.logger.log(Log.DEBUG, "VanillaPipelineWorkflowConfigurator:copyLinkScript") if wfPolicy.exists("configuration") == False: return None configuration = wfPolicy.get("configuration") if configuration.exists("deployData") == False: return None deployPolicy = configuration.get("depl...
def copyAndRunLinkScript(self, wfPolicy): self.logger.log(Log.DEBUG, "VanillaPipelineWorkflowConfigurator:copyAndRunLinkScript")
errorText = "File permissions on "+checkFile+" should not be readable by 'group' or 'other'. Use chmod to fix this."
errorText = "File permissions on "+checkFile+" should not be readable, writable, or executable by 'group' or 'other'. Use chmod to fix this. (chmod 700 ~/.lsst)"
def checkUserOnlyPermissions(self, checkFile): mode = os.stat(checkFile)[stat.ST_MODE]
self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:__init__") self.runid = runid
self.cmds = cmds self.wfPolicy = wfPolicy
def __init__(self, runid, prodPolicy, wfPolicy, logger): self.logger = logger self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:__init__") self.runid = runid self.prodPolicy = prodPolicy self.wfPolicy = wfPolicy
self.wfPolicy = wfPolicy self.wfVerbosity = None self.nodes = None self.dirs = None
def __init__(self, runid, prodPolicy, wfPolicy, logger): self.logger = logger self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:__init__") self.runid = runid self.prodPolicy = prodPolicy self.wfPolicy = wfPolicy
def configure(self, provSetup, wfVerbosity): self.wfVerbosity = wfVerbosity self._configureDatabases(provSetup) return self._configureSpecialized(provSetup, self.wfPolicy) def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:configure") self.short...
def cleanUp(self): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowLauncher:cleanUp")
def configure(self, provSetup, wfVerbosity): self.wfVerbosity = wfVerbosity self._configureDatabases(provSetup) return self._configureSpecialized(provSetup, self.wfPolicy)
def expandPolicies(self, pipelinePolicies): expanded = [] totalCount = 1 for policy in pipelinePolicies: runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): print "policy name = %s dot %d" % (policy.get("shortName"), i+1) expanded.append((policy,i+1, totalCount)) to...
def launch(self, statusListener): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowLauncher:launch")
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:configure") self.shortName = wfPolicy.get("shortName") if wfPolicy.getValueType("platform") == pol.Policy.FILE: filename = wfPolicy.getFile("platform").getPath() platformPolicy = pol.Policy.createPolicy(f...
print "expanded = ",expanded return expanded
for key in self.cmds.keys(): cmd = self.cmds[key] pid = os.fork() if not pid: os.execvp(cmd[0], cmd) os.wait()[0]
def expandPolicies(self, pipelinePolicies): expanded = [] totalCount = 1 for policy in pipelinePolicies: # default to 1, if runCount doesn't exist runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): print "policy name = %s dot %d" % (policy.get("shortName"), i+1) exp...
def createNodeList(self, pipelinePolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:createNodeList") node = pipelinePolicy.getArray("deploy.processesOnNode")
eventBrokerHost = self.prodPolicy.get("eventBrokerHost") shutdownTopic = self.wfPolicy.get("shutdownTopic")
def expandPolicies(self, pipelinePolicies): expanded = [] totalCount = 1 for policy in pipelinePolicies: # default to 1, if runCount doesn't exist runCount = 1 if policy.exists("runCount"): runCount = policy.get("runCount") for i in range(0,runCount): print "policy name = %s dot %d" % (policy.get("shortName"), i+1) exp...
nodes = map(self.expandNodeHost, node) self.masterNode = nodes[0] colon = self.masterNode.find(':') if colon > 1: self.masterNode = self.masterNode[0:colon] return nodes def getWorkflowName(self): return self.workflow def getNodeCount(self): return len(self.nodes) def writeNodeList(self): nodelist = open(os.p...
self.workflowMonitor = SinglePipelineWorkflowMonitor(eventBrokerHost, shutdownTopic, self.logger) if statusListener != None: self.workflowMonitor.addStatusListener(statusListener) self.workflowMonitor.startMonitorThread() return self.workflowMonitor
def createNodeList(self, pipelinePolicy): self.logger.log(Log.DEBUG, "MultiPipelineWorkflowConfigurator:createNodeList") node = pipelinePolicy.getArray("deploy.processesOnNode")
(self.workflow+".paf", self.runid, self.wfVerbosity, remoteSetupScriptName)
(policyName+".paf", self.runid, self.wfVerbosity, remoteSetupScriptName)
def writeCondorFile(self, pipelinePolicy): self.logger.log(Log.DEBUG, "VanillaWorkflowConfigurator:writeCondorFile")
condorJobfile = os.path.join(self.localStagingDir, self.workflow+".condor")
condorJobfile = os.path.join(self.localStagingDir, shortName+".condor")
def writeCondorFile(self, pipelinePolicy): self.logger.log(Log.DEBUG, "VanillaWorkflowConfigurator:writeCondorFile")
provSetup = ProvenanceSetup()
self._provSetup = ProvenanceSetup()
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
provSetup.addProductionPolicyFile(name)
self._provSetup.addProductionPolicyFile(name)
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
cfg.setup()
cfg.setup(self._provSetup)
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
try:
if self.productionPolicy.exists("configuration"):
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
except pexEx.LsstCppException, e: pass
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
workflowManager.configure(provSetup, workflowVerbosity)
workflowManager.configure(self._provSetup, workflowVerbosity)
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
self.productionRunConfigurator = self.createConfigurator()
self.productionRunConfigurator = self.createConfigurator(self.policy)
def runProduction(self): self.logger.log(Log.DEBUG, "Running production: " + self.runid)
def createConfigurator(self):
def createConfigurator(self, policy):
def createConfigurator(self): # prodPolicy - the production run policy self.logger.log(Log.DEBUG, "ProductionRunManager:createConfigurator")
return configuratorClass(self.runid, self.policy, self.repository,
return configuratorClass(self.runid, policy, self.repository,
def createConfigurator(self): # prodPolicy - the production run policy self.logger.log(Log.DEBUG, "ProductionRunManager:createConfigurator")
running = self.workflowManagers[workflow]
running = self.workflowManagers[workflow].isRunning()
def stopProduction(self, urgency, timeout=1800): # urgency - an indicator of how urgently to carry out the shutdown. # # Recognized values are: # FINISH_PENDING_DATA - end after all currently available data has # been processed # END_ITERATION - end after the current data ooping iterat...
self.logger.log(Log.INFO, "Workflow %s is not running", self.name)
self.logger.log(Log.INFO, "Workflow %s is not running" % self.name)
def stopWorkflow(self, urgency): self.logger.log(Log.DEBUG, "WorkflowManager:stopWorkflow") if self._monitor: self._monitor.stopWorkflow(urgency) else: self.logger.log(Log.INFO, "Workflow %s is not running", self.name)
cmdArray = self.cmd.split()
def launch(self): self.logger.log(Log.DEBUG, "BasicPipelineLauncher:launch")
os.execvp(cmdArray[0],cmdArray)
os.execvp(self.cmd[0], self.cmd)
def launch(self): self.logger.log(Log.DEBUG, "BasicPipelineLauncher:launch")
def __init__(self, scratchDir, wfName, pipelineShortName, pipelineNumber):
def __init__(self, scratchDir, wfName, pipelineName, pipelineNumber):
def __init__(self, scratchDir, wfName, pipelineShortName, pipelineNumber): self.wfName = wfName self.pipelineShortName = pipelineShortName self.pipelineNumber = pipelineNumber
self.pipelineShortName = pipelineShortName
self.pipelineName = pipelineName
def __init__(self, scratchDir, wfName, pipelineShortName, pipelineNumber): self.wfName = wfName self.pipelineShortName = pipelineShortName self.pipelineNumber = pipelineNumber
self.pipelineName = "%s_%s" % (pipelineShortName, pipelineNumber)
self.pipelineIndexedName = "%s_%s" % (pipelineName, pipelineNumber)
def __init__(self, scratchDir, wfName, pipelineShortName, pipelineNumber): self.wfName = wfName self.pipelineShortName = pipelineShortName self.pipelineNumber = pipelineNumber
return self.pipelineNumber
return int(self.pipelineNumber)
def getPipelineNumber(self): return self.pipelineNumber
pipelineDir = os.path.join(self.wfScratchDir, self.pipelineName)
pipelineDir = os.path.join(self.wfScratchDir, self.pipelineIndexedName)
def getFileName(self): pipelineDir = os.path.join(self.wfScratchDir, self.pipelineName) pipelineWorkDir = os.path.join(pipelineDir, "work") pipelineJobDir = os.path.join(pipelineWorkDir, self.pipelineName) pipelineJobFile = os.path.join(pipelineJobDir, "%s.job" % self.pipelineName) return pipelineJobFile
pipelineJobDir = os.path.join(pipelineWorkDir, self.pipelineName) pipelineJobFile = os.path.join(pipelineJobDir, "%s.job" % self.pipelineName)
pipelineJobDir = os.path.join(pipelineWorkDir, self.pipelineIndexedName) pipelineJobFile = os.path.join(pipelineJobDir, "%s.job" % self.pipelineIndexedName)
def getFileName(self): pipelineDir = os.path.join(self.wfScratchDir, self.pipelineName) pipelineWorkDir = os.path.join(pipelineDir, "work") pipelineJobDir = os.path.join(pipelineWorkDir, self.pipelineName) pipelineJobFile = os.path.join(pipelineJobDir, "%s.job" % self.pipelineName) return pipelineJobFile
print "killing %s" % jobname
def killJob(self, filename): try : input = open(filename, 'r') except Exception, e: # couldn't find that file, so pass return line = input.readline() line = line.strip('\n') cmd = ["condor_rm", line] jobname = os.path.basename(filename).split('.')[0] print "killing %s" % jobname pid = os.fork() if not pid: os.execvp(cm...
print "jobFile = ",jobFile
def processPipelineJob(self, job): jobFile = job.getFileName()
elif self.pipelineName == group.getPipelineName():
elif self.pipelineName == job.getPipelineName():
def processPipelineJob(self, job): jobFile = job.getFileName()
elif self.pipelineNumber == group.getPipelineNumber():
elif self.pipelineNumber == job.getPipelineNumber():
def processPipelineJob(self, job): jobFile = job.getFileName()
pipelineNumArg = parser.opts.pipelineNumArg
pipelineNumArg = None if parser.opts.pipelineNumArg != None: pipelineNumArg = int(parser.opts.pipelineNumArg)
def processPipelineJob(self, job): jobFile = job.getFileName()
sleep(1)
time.sleep(1)
def waitForJobToRun(self, num): jobNum = "%s.0" % num queueExp = re.compile("\S+") while 1: pop = os.popen("condor_q", "r") while 1: line = pop.readline() if not line: break values = queueExp.findall(line) if len(values) == 0: continue runstate = values[5] if (values[0] == jobNum) and (runstate == 'R'): print values po...
platformPolicy = pol.Policy.createPolicy(filename)
fullpath = None if os.path.isabs(filename): fullpath = filename else: fullpath = os.path.join(self.repository, filename) platformPolicy = pol.Policy.createPolicy(fullpath)
def _configureSpecialized(self, provSetup, wfPolicy): self.logger.log(Log.DEBUG, "GenericPipelineWorkflowConfigurator:configure") self.shortName = wfPolicy.get("shortName") if wfPolicy.getValueType("platform") == pol.Policy.FILE: filename = wfPolicy.getFile("platform").getPath() platformPolicy = pol.Policy.createPolicy...
definitionPolicy = pol.Policy.createPolicy(filename, False)
fullpath = None if os.path.isabs(filename): fullpath = filename else: fullpath = os.path.join(self.repository, filename) definitionPolicy = pol.Policy.createPolicy(fullpath, False)
def deploySetup(self, provSetup, wfPolicy, platformPolicy, pipelinePolicyGroup): self.logger.log(Log.DEBUG, "GenericPipelineWorkflowConfigurator:deploySetup")
pipelinePolicy = pipelinePolicies.get(policyName) doLaunch = pipelinePolicy.get("launch") if doLaunch != 0: shortName = pipelinePolicy.get("shortname") if shortName == None: shortName = policyName configuration = pipelinePolicy.getFile("configuration").getPath() configuratorClassName = pipelinePolicy.get("configurato...
pipelinePolicyArray = pipelinePolicies.getArray(policyName) for pipelinePolicy in pipelinePolicyArray: doLaunch = pipelinePolicy.get("launch") if doLaunch != 0: shortName = pipelinePolicy.get("shortname") if shortName == None: shortName = policyName configuration = pipelinePolicy.getFile("configuration").getPath() co...
def createConfigurator(self): # prodPolicy - the production run policy self.logger.log(Log.DEBUG, "ProductionRunManager:createConfigurator")
mgr = self._workflowManagers[workflow]
mgr = self._workflowManagers[workflow.getName()]
def runProduction(self, skipConfigCheck=False, workflowVerbosity=None): self.logger.log(Log.DEBUG, "Running production: " + self.runid)
configurator = configuratorClass(self.runid, wfPolicy, prodPolicy, self.logger)
configurator = configuratorClass(self.runid, prodPolicy, wfPolicy, self.logger)
def createConfigurator(self, runid, wfPolicy, prodPolicy): self.logger.log(Log.DEBUG, "WorkflowManager:createConfigurator")
launcher.write("%s %s %s -L %s --logdir %s\n" % (execCmd, filename, self.runid, self.wfVerbosity, logDir))
launcher.write("nohup %s %s %s -L %s --logdir %s >%s/launch.log 2>&1 &\n" % (execCmd, filename, self.runid, self.wfVerbosity, logDir, logDir))
def deploySetup(self, provSetup, wfPolicy, pipelinePolicyGroup): self.logger.log(Log.DEBUG, "GenericPipelineWorkflowConfigurator:deploySetup")
self._evsys.createReceiver(brokerhost, topic)
self._evsys.createReceiver(brokerhost, self._topic)
def __init__(self, parent, pollingIntv=0.2, listenTimeout=10): self._parent = parent self._pollintv = pollingIntv self._timeout = listenTimeout brokerhost = parent.policy.get("eventBrokerHost") self._topic = parent.policy.get("shutdownTopic") self._evsys = events.EventSystem.getDefaultEventSystem() self._evsys.createRe...
self.parent.logger.log(Log.DEBUG,
self._parent.logger.log(Log.DEBUG,
def run(self): self.parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)
self.parent.logger.log(Log.DEBUG-10, "checking for shutdown event")
self._parent.logger.log(Log.DEBUG-10, "checking for shutdown event")
def run(self): self.parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)
while self.parent.isRunning() and shutdownData is None:
while self._parent.isRunning() and shutdownData is None:
def run(self): self.parent.logger.log(Log.DEBUG, "listening for shutdown event at %s s intervals" % self._pollintv)