コード例 #1
0
ファイル: injectStoreResults.py プロジェクト: tsarangi/WMCore
from WMCore.WMBS.Fileset import Fileset
from WMCore.WMBS.Subscription import Subscription
from WMCore.WMBS.Workflow import Workflow
from WMCore.WorkQueue.WMBSHelper import WMBSHelper
from WMComponent.DBSBuffer.Database.Interface.DBSBufferFile import DBSBufferFile

from WMCore.DataStructs.Run import Run

from WMCore.WMSpec.StdSpecs.StoreResults import storeResultsWorkload, getTestArguments
from DBSAPI.dbsApi import DbsApi

from WMCore.WMSpec.Makers.TaskMaker import TaskMaker

# The default arguments are set in:
#   WMCORE/src/python/WMCore/WMSpec/StdSpecs/StoreResults.py
arguments = getTestArguments()
arguments["UnmergedLFNBase"] = "/store/temp/WMAgent/unmerged"
arguments["MergedLFNBase"] = "/store/temp/results"
arguments["AcquisitionEra"] = 'Blennies'
arguments["CmsPath"] = "/uscmst1/prod/sw/cms"
#34      arguments.update({
#35              "CmsPath": "/uscmst1/prod/sw/cms",
#36              "AcquisitionEra": "Blennies",
arguments["Requestor"] = "*****@*****.**"
arguments["InputDataset"] = "/MinimumBias/Run2010A-Dec22ReReco_v1/RECO"
arguments["CMSSWVersion"] = "CMSSW_3_9_7"
arguments["ScramArch"] = "slc5_ia32_gcc434"
arguments["ProcessingVersion"] = "v2ewv"
#42              "CouchDBName": "gutsche_configcache",
arguments["MergedLFNBase"] = "/store/temp/results"
#44      })
コード例 #2
0
ファイル: StoreResults_t.py プロジェクト: cinquo/WMCore
    def testStoreResults(self):
        """
        _testStoreResults_

        Create a StoreResults workflow and verify it installs into WMBS
        correctly.
        """
        arguments = getTestArguments()
        arguments.update({'CmsPath' :"/uscmst1/prod/sw/cms"})
        testWorkload = storeResultsWorkload("TestWorkload", arguments)
        testWorkload.setSpecUrl("somespec")
        testWorkload.setOwnerDetails("*****@*****.**", "DMWM")

        testWMBSHelper = WMBSHelper(testWorkload, "StoreResults", "SomeBlock", cachepath = self.testDir)
        testWMBSHelper.createTopLevelFileset()
        testWMBSHelper._createSubscriptionsInWMBS(testWMBSHelper.topLevelTask, testWMBSHelper.topLevelFileset)

        testWorkflow = Workflow(name = "TestWorkload",
                                task = "/TestWorkload/StoreResults")
        testWorkflow.load()

        self.assertEqual(len(testWorkflow.outputMap.keys()), 2,
                         "Error: Wrong number of WF outputs.")

        goldenOutputMods = ["Merged"]
        for goldenOutputMod in goldenOutputMods:
            mergedOutput = testWorkflow.outputMap[goldenOutputMod][0]["merged_output_fileset"]
            unmergedOutput = testWorkflow.outputMap[goldenOutputMod][0]["output_fileset"]

            mergedOutput.loadData()
            unmergedOutput.loadData()

            self.assertEqual(mergedOutput.name, "/TestWorkload/StoreResults/merged-%s" % goldenOutputMod,
                             "Error: Merged output fileset is wrong: %s" % mergedOutput.name)
            self.assertEqual(unmergedOutput.name, "/TestWorkload/StoreResults/merged-%s" % goldenOutputMod,
                             "Error: Unmerged output fileset is wrong: %s."%unmergedOutput.name)

        logArchOutput = testWorkflow.outputMap["logArchive"][0]["merged_output_fileset"]
        unmergedLogArchOutput = testWorkflow.outputMap["logArchive"][0]["output_fileset"]
        logArchOutput.loadData()
        unmergedLogArchOutput.loadData()


        self.assertEqual(logArchOutput.name, "/TestWorkload/StoreResults/merged-logArchive",
                         "Error: LogArchive output fileset is wrong.")
        self.assertEqual(unmergedLogArchOutput.name, "/TestWorkload/StoreResults/merged-logArchive",
                         "Error: LogArchive output fileset is wrong.")


        topLevelFileset = Fileset(name = "TestWorkload-StoreResults-SomeBlock")
        topLevelFileset.loadData()

        procSubscription = Subscription(fileset = topLevelFileset, workflow = testWorkflow)
        procSubscription.loadData()

        self.assertEqual(procSubscription["type"], "Merge",
                         "Error: Wrong subscription type.")
        self.assertEqual(procSubscription["split_algo"], "ParentlessMergeBySize",
                         "Error: Wrong split algo.")


        return
コード例 #3
0
from WMCore.WMBS.Fileset import Fileset
from WMCore.WMBS.Subscription import Subscription
from WMCore.WMBS.Workflow import Workflow
from WMCore.WorkQueue.WMBSHelper import WMBSHelper
from WMComponent.DBS3Buffer.DBSBufferFile import DBSBufferFile

from WMCore.DataStructs.Run import Run

from WMCore.WMSpec.StdSpecs.StoreResults import storeResultsWorkload, getTestArguments
from DBSAPI.dbsApi import DbsApi

from WMCore.WMSpec.Makers.TaskMaker import TaskMaker

# The default arguments are set in:
#   WMCORE/src/python/WMCore/WMSpec/StdSpecs/StoreResults.py
arguments = getTestArguments()
arguments["UnmergedLFNBase"] = "/store/temp/WMAgent/unmerged"
arguments["MergedLFNBase"] = "/store/temp/results"
arguments["AcquisitionEra"] = 'Blennies'
arguments["CmsPath"] = "/uscmst1/prod/sw/cms"
        #34      arguments.update({
        #35              "CmsPath": "/uscmst1/prod/sw/cms",
        #36              "AcquisitionEra": "Blennies",
arguments["Requestor"] =  "*****@*****.**"
arguments["InputDataset"] = "/MinimumBias/Run2010A-Dec22ReReco_v1/RECO"
arguments["CMSSWVersion"] =  "CMSSW_3_9_7"
arguments["ScramArch"] =  "slc5_ia32_gcc434"
arguments["ProcessingVersion"] =  "v2ewv"
        #42              "CouchDBName": "gutsche_configcache",
arguments["MergedLFNBase"] =  "/store/temp/results"
        #44      })
コード例 #4
0
    def testStoreResults(self):
        """
        _testStoreResults_

        Create a StoreResults workflow and verify it installs into WMBS
        correctly.
        """
        arguments = getTestArguments()
        arguments.update({'CmsPath': "/uscmst1/prod/sw/cms"})
        testWorkload = storeResultsWorkload("TestWorkload", arguments)
        testWorkload.setSpecUrl("somespec")
        testWorkload.setOwnerDetails("*****@*****.**", "DMWM")

        testWMBSHelper = WMBSHelper(testWorkload, "StoreResults", "SomeBlock")
        testWMBSHelper.createTopLevelFileset()
        testWMBSHelper.createSubscription(testWMBSHelper.topLevelTask,
                                          testWMBSHelper.topLevelFileset)

        testWorkflow = Workflow(name="TestWorkload",
                                task="/TestWorkload/StoreResults")
        testWorkflow.load()

        self.assertEqual(len(testWorkflow.outputMap.keys()), 2,
                         "Error: Wrong number of WF outputs.")

        goldenOutputMods = ["Merged"]
        for goldenOutputMod in goldenOutputMods:
            mergedOutput = testWorkflow.outputMap[goldenOutputMod][0][
                "merged_output_fileset"]
            unmergedOutput = testWorkflow.outputMap[goldenOutputMod][0][
                "output_fileset"]

            mergedOutput.loadData()
            unmergedOutput.loadData()

            self.assertEqual(
                mergedOutput.name,
                "/TestWorkload/StoreResults/merged-%s" % goldenOutputMod,
                "Error: Merged output fileset is wrong: %s" %
                mergedOutput.name)
            self.assertEqual(
                unmergedOutput.name,
                "/TestWorkload/StoreResults/merged-%s" % goldenOutputMod,
                "Error: Unmerged output fileset is wrong: %s." %
                unmergedOutput.name)

        logArchOutput = testWorkflow.outputMap["logArchive"][0][
            "merged_output_fileset"]
        unmergedLogArchOutput = testWorkflow.outputMap["logArchive"][0][
            "output_fileset"]
        logArchOutput.loadData()
        unmergedLogArchOutput.loadData()

        self.assertEqual(logArchOutput.name,
                         "/TestWorkload/StoreResults/merged-logArchive",
                         "Error: LogArchive output fileset is wrong.")
        self.assertEqual(unmergedLogArchOutput.name,
                         "/TestWorkload/StoreResults/merged-logArchive",
                         "Error: LogArchive output fileset is wrong.")

        topLevelFileset = Fileset(name="TestWorkload-StoreResults-SomeBlock")
        topLevelFileset.loadData()

        procSubscription = Subscription(fileset=topLevelFileset,
                                        workflow=testWorkflow)
        procSubscription.loadData()

        self.assertEqual(procSubscription["type"], "Merge",
                         "Error: Wrong subscription type.")
        self.assertEqual(procSubscription["split_algo"],
                         "ParentlessMergeBySize", "Error: Wrong split algo.")

        return