Esempio n. 1
0
def main(pickleConfigFile, primaryConfigSection, workflowClassName):

    from configureUtil import getConfigWithPrimaryOptions

    runOptions = get_run_options(workflowClassName)
    flowOptions, configSections = getConfigWithPrimaryOptions(
        pickleConfigFile, primaryConfigSection)

    # new logs and marker files to assist automated workflow monitoring:
    warningpath = os.path.join(flowOptions.runDir, "workflow.warning.log.txt")
    errorpath = os.path.join(flowOptions.runDir, "workflow.error.log.txt")
    exitpath = os.path.join(flowOptions.runDir, "workflow.exitcode.txt")

    # the exit path should only exist once the workflow completes:
    if os.path.exists(exitpath):
        if not os.path.isfile(exitpath):
            raise Exception("Unexpected filesystem item: '%s'" % (exitpath))
        os.unlink(exitpath)

    wflow = workflowClassName(flowOptions)

    retval = 1
    try:
        retval = wflow.run(mode=runOptions.mode,
                           nCores=runOptions.jobs,
                           memMb=runOptions.memMb,
                           dataDirRoot=flowOptions.workDir,
                           mailTo=runOptions.mailTo,
                           isContinue="Auto",
                           isForceContinue=True,
                           isDryRun=runOptions.isDryRun,
                           isQuiet=runOptions.isQuiet,
                           schedulerArgList=runOptions.schedulerArgList,
                           resetTasks=runOptions.resetTasks,
                           successMsg=wflow.getSuccessMessage(),
                           retryWindow=0,
                           retryMode='all',
                           warningLogFile=warningpath,
                           errorLogFile=errorpath)
    finally:
        exitfp = open(exitpath, "w")
        exitfp.write("%i\n" % (retval))
        exitfp.close()

    sys.exit(retval)
Esempio n. 2
0
def main(pickleConfigFile, primaryConfigSection, workflowClassName) :

    from configureUtil import getConfigWithPrimaryOptions

    runOptions=get_run_options(workflowClassName)
    flowOptions,configSections=getConfigWithPrimaryOptions(pickleConfigFile,primaryConfigSection)

    # new logs and marker files to assist automated workflow monitoring:
    warningpath=os.path.join(flowOptions.runDir,"manta.warning.log.txt")
    errorpath=os.path.join(flowOptions.runDir,"manta.error.log.txt")
    exitpath=os.path.join(flowOptions.runDir,"manta.workflow.exitcode.txt")

    # the exit path should only exist once the workflow completes:
    if os.path.exists(exitpath) :
        if not os.path.isfile(exitpath) :
            raise Exception("Unexpected filesystem item: '%s'" % (exitpath))
        os.unlink(exitpath)

    wflow = workflowClassName(flowOptions,configSections)

    retval=1
    try:
        retval=wflow.run(mode=runOptions.mode,
                         nCores=runOptions.jobs,
                         memMb=runOptions.memMb,
                         dataDirRoot=flowOptions.workDir,
                         mailTo=runOptions.mailTo,
                         isContinue="Auto",
                         isForceContinue=True,
                         isDryRun=runOptions.isDryRun,
                         isQuiet=runOptions.isQuiet,
                         schedulerArgList=runOptions.schedulerArgList,
                         resetTasks=runOptions.resetTasks,
                         successMsg=wflow.getSuccessMessage(),
                         warningLogFile=warningpath,
                         errorLogFile=errorpath)
    finally:
        exitfp=open(exitpath,"w")
        exitfp.write("%i\n" % (retval))
        exitfp.close()

    sys.exit(retval)