Ejemplo n.º 1
0
    def testA(self):

        try:
            getWMBASE()
        except Exception as ex:
            self.fail("Failed to call getWMBASE")

        return
Ejemplo n.º 2
0
    def testA(self):

        try:
            getWMBASE()
        except Exception as ex:
            self.fail("Failed to call getWMBASE")

        return
Ejemplo n.º 3
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()

        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr",
                                   "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')

        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] = []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(
            self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"),
                          config.views.data.couch_reqmgr_aux_db, cmsswDoc)
        self.reqSvc = ReqMgr(self.jsonSender["host"])
        self.reqSvc._noStale = True
        self.reqSvc['requests'].additionalHeaders = self.create_header
Ejemplo n.º 4
0
def getTestFilename(partialPath):
    """
    Return a full filename for a path in the test directories
    """
        
    fullPath = os.path.normpath(os.path.join(getWMBASE(), 'test', partialPath))
    return fullPath
Ejemplo n.º 5
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        #print "%s" % self.test_authz_key.data
        self.default_status_header = getAuthHeader(self.test_authz_key.data, DEFAULT_STATUS_PERMISSION)

        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco_RunBlockWhite.json"), 'r')

        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoCreateArgs["PrepID"] = "test_prepid"
        self.rerecoCreateArgs["MCPileup"] = "/MCdata/pileup/RAW"
        self.rerecoCreateArgs["DataPileup"] = "/Data/pileup/RAW"
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        # overwrite rereco args
        self.rerecoAssignArgs["AcquisitionEra"] = "test_aqc"

        lheFile = open(os.path.join(requestPath, "TaskChain_Data.json"), 'r')
        lheArgs = json.load(lheFile)
        self.lheStep0CreateArgs = lheArgs["createRequest"]
        self.lheStep0AssignArgs = lheArgs["assignRequest"]
        self.lheStep0AssignArgs["AcquisitionEra"] = "test_aqc"

        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)
Ejemplo n.º 6
0
def getTestFilename(partialPath):
    """
    Return a full filename for a path in the test directories
    """

    fullPath = os.path.normpath(os.path.join(getWMBASE(), 'test', partialPath))
    return fullPath
Ejemplo n.º 7
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        
        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        #print "%s" % self.test_authz_key.data
        self.default_status_header = getAuthHeader(self.test_authz_key.data, DEFAULT_STATUS_PERMISSION)
        
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')
        
        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoCreateArgs["PrepID"] = "test_prepid"
        self.rerecoCreateArgs["MCPileup"] = "/MCdata/pileup/RAW"
        self.rerecoCreateArgs["DataPileup"] = "/Data/pileup/RAW" 
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        # overwrite rereco args
        self.rerecoAssignArgs["AcquisitionEra"] = "test_aqc"
        
        lheFile = open(os.path.join(requestPath, "TaskChain_Data.json"), 'r')
        lheArgs = json.load(lheFile)
        self.lheStep0CreateArgs = lheArgs["createRequest"]
        self.lheStep0AssignArgs = lheArgs["assignRequest"]
        self.lheStep0AssignArgs["AcquisitionEra"] = "test_aqc"
        
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)        
Ejemplo n.º 8
0
    def doWrapped(self, commandArgs):
        wrapperPath = os.path.join(getWMBASE(),'src','python','WMCore','Storage','Plugins','DCCPFNAL','wrapenv.sh')
        commandArgs.insert(0, wrapperPath)
        exitCode, output = runCommand(commandArgs)
        if exitCode != 0:
            logging.info("Non zero exit code: %s" % repr(exitCode))

        return (exitCode, output)
Ejemplo n.º 9
0
def couchAppRoot():
    """Return path to couchapp dir"""
    wmBase = getWMBASE()
    develPath = "%s/src/couchapps" % wmBase
    if not os.path.exists(develPath):
        basePath = "%s/couchapps" % os.environ['WMCORE_ROOT']
    else:
        basePath = develPath
    return basePath
Ejemplo n.º 10
0
def couchAppRoot():
    """Return path to couchapp dir"""
    wmBase = getWMBASE()
    develPath = "%s/src/couchapps" % wmBase
    if not os.path.exists(develPath):
        basePath = "%s/couchapps" % os.environ['WMCORE_ROOT']
    else:
        basePath = develPath
    return basePath
Ejemplo n.º 11
0
    def doWrapped(self, commandArgs):
        wrapperPath = os.path.join(getWMBASE(), 'src', 'python', 'WMCore',
                                   'Storage', 'Plugins', 'DCCPFNAL',
                                   'wrapenv.sh')
        commandArgs.insert(0, wrapperPath)
        exitCode, output = runCommand(commandArgs)
        if exitCode != 0:
            logging.info("Non zero exit code: %s" % repr(exitCode))

        return (exitCode, output)
Ejemplo n.º 12
0
    def setUp(self):
        self.commandPrepend = os.path.join(getWMBASE(),'src','python','WMCore','Storage','Plugins','DCCPFNAL','wrapenv.sh')
        self.runMocker  = mox.MockObject(RunCommandThing)
        self.copyMocker = mox.MockObject(ourFallbackPlugin)
        def runCommandStub(command):
            (num1, num2) =  self.runMocker.runCommand(command)
            return (num1, num2)
        def getImplStub(command, useNewVersion = None):
            return self.copyMocker

        pass
Ejemplo n.º 13
0
    def setUp(self):
        self.commandPrepend = os.path.join(getWMBASE(),'src','python','WMCore','Storage','Plugins','DCCPFNAL','wrapenv.sh')
        self.runMocker  = mox.MockObject(RunCommandThing)
        self.copyMocker = mox.MockObject(ourFallbackPlugin)
        def runCommandStub(command):
            (num1, num2) =  self.runMocker.runCommand(command)
            return (num1, num2)
        def getImplStub(command, useNewVersion = None):
            return self.copyMocker

        pass
Ejemplo n.º 14
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        RESTBaseUnitTestWithDBBackend.setUp(self)

        # put into ReqMgr auxiliary database under "software" document scram/cmsms
        # which we'll need a little for request injection                
        #Warning: this assumes the same structure in jenkins wmcore_root/test
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests")
        mcFile = open(os.path.join(requestPath, "MonteCarlo.json"), 'r')
        self.mcArgs = JsonWrapper.load(mcFile)["createRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.mcArgs["ScramArch"]] =  []
        cmsswDoc[self.mcArgs["ScramArch"]].append(self.mcArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)        
Ejemplo n.º 15
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        
        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')
        
        rerecoArgs = JsonWrapper.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc) 
        self.reqSvc = ReqMgr(self.jsonSender["host"]) 
        self.reqSvc._noStale = True      
        self.reqSvc['requests'].additionalHeaders = self.create_header
Ejemplo n.º 16
0
config.TaskArchiver.localCouchURL = "%s/%s" % (config.JobStateMachine.couchurl,  config.JobStateMachine.couchDBName)
config.TaskArchiver.localQueueURL = "%s/%s" % (config.WorkQueueManager.couchurl, config.WorkQueueManager.dbname)
config.TaskArchiver.localWMStatsURL = "%s/%s" % (config.JobStateMachine.couchurl, config.JobStateMachine.jobSummaryDBName)
config.TaskArchiver.DataKeepDays = 0.125 # couhch history keeping days.
config.TaskArchiver.cleanCouchInterval = 60 * 20 # 20 min
config.TaskArchiver.ReqMgrServiceURL = "ReqMgr rest service"
config.TaskArchiver.ReqMgr2ServiceURL = "ReqMgr2 rest service"
config.TaskArchiver.archiveDelayHours = 24 # delay the archiving so monitor can still show. default 24 hours

config.webapp_('WMBSService')
config.WMBSService.default_expires = 0
config.WMBSService.componentDir = os.path.join(config.General.workDir, "WMBSService")
config.WMBSService.Webtools.port = wmbsServicePort
config.WMBSService.Webtools.host = serverHostName
config.WMBSService.Webtools.environment = "devel"
config.WMBSService.templates = os.path.join(getWMBASE(), 'src/templates/WMCore/WebTools')
config.WMBSService.admin = config.Agent.contact
config.WMBSService.title = 'WMBS Data Service'
config.WMBSService.description = 'Provide WMBS related service call'

config.WMBSService.section_("security")
config.WMBSService.security.dangerously_insecure = True

config.WMBSService.section_('views')
active = config.WMBSService.views.section_('active')
wmbs = active.section_('wmbs')
wmbs.object = 'WMCore.WebTools.RESTApi'
wmbs.templates = os.path.join(getWMBASE(), 'src/templates/WMCore/WebTools/')
wmbs.section_('model')
wmbs.model.object = 'WMCore.HTTPFrontEnd.WMBS.WMBSRESTModel'
wmbs.section_('formatter')
Ejemplo n.º 17
0
 def doWrapped(self, commandArgs):
     wrapperPath = os.path.join(getWMBASE(), 'src', 'python', 'WMCore',
                                'Storage', 'Plugins', 'XRDCP', 'wrapenv.sh')
     commandArgs.insert(0, wrapperPath)
     return runCommand(commandArgs)
Ejemplo n.º 18
0
cherrypy.config.update({'environment': 'embedded'})
#cherrypy.config.update({'server.socket_host': 'vocms115'})
##########################################3
config = Configuration()
config.component_('SecurityModule')
config.SecurityModule.key_file = "%s/auth/wmcore-auth/header-auth-key" % __file__.rsplit('/', 3)[0]

config.component_('Webtools')
config.Webtools.port = 8304
config.Webtools.host = '0.0.0.0'
config.Webtools.application = 'tier0'
config.Webtools.expires=800
  # no caching as general policy, Mott0 has special rules defined in its service  source
config.component_('tier0')

config.tier0.templates = getWMBASE() + '/../../templates/WMCore/WebTools'
config.tier0.admin = '*****@*****.**'
config.tier0.title = 'T0DataSvc'
config.tier0.description = 'Tier-0 Data Service'
config.tier0.index = 'tier0'


config.tier0.section_('views')
# These are all the active pages that Root.py should instantiate
active = config.tier0.views.section_('active')
tier0 = active.section_('tier0')
# The class to load for this view/page
tier0.object = 'WMCore.WebTools.RESTApi'
tier0.templates = getWMBASE() + '/../../templates/WMCore/WebTools'
tier0.section_("database")
tier0.database.connectUrl = connectURL
Ejemplo n.º 19
0
# The above short-hand can be replaced with explicit namespaced configuration
# variables as described in http://www.cherrypy.org/wiki/ConfigAPI
# for example
config.Webtools.section_('server')
config.Webtools.server.socket_timeout = 30
# Shorthand configurations take precedence over explicit ones, e.g. if you have
#config.Webtools.server.socket_port = 8010
#config.Webtools.port = 8011
# your server will start on 8011
# This is the application
config.Webtools.application = 'WebtoolsDocs'

# This is the config for the application
config.component_('WebtoolsDocs')
# Define the default location for templates for the app
config.WebtoolsDocs.templates = os.path.join(getWMBASE(), 'src/templates/WMCore/WebTools')
config.WebtoolsDocs.admin = '*****@*****.**'
config.WebtoolsDocs.title = 'CMS WMCore/WebTools Documentation'
config.WebtoolsDocs.description = 'Documentation on the WMCORE/WebTools'

# If we want an application to run on multiple for multiple instances confiure
# it as follows
config.WebtoolsDocs.instances = ['foo', 'bar']
# We could define the class that is the applications index
#config.WebtoolsDocs.index = 'welcome'
# but instead we'll leave it blank and use the default (Welcome.py) which
# inspects the pages that are loaded and auto-generates a page based on the
# classes doc strings. You can hide a view from the welcome page by setting
# hidden=True in its configuration - useful for "admin" pages.

# Views are all pages
Ejemplo n.º 20
0
#cherrypy.config.update({'server.socket_host': 'vocms115'})
##########################################3
config = Configuration()
config.component_('SecurityModule')
config.SecurityModule.key_file = "%s/auth/wmcore-auth/header-auth-key" % __file__.rsplit(
    '/', 3)[0]

config.component_('Webtools')
config.Webtools.port = 8304
config.Webtools.host = '0.0.0.0'
config.Webtools.application = 'tier0'
config.Webtools.expires = 800
# no caching as general policy, Mott0 has special rules defined in its service  source
config.component_('tier0')

config.tier0.templates = getWMBASE() + '/../../templates/WMCore/WebTools'
config.tier0.admin = '*****@*****.**'
config.tier0.title = 'T0DataSvc'
config.tier0.description = 'Tier-0 Data Service'
config.tier0.index = 'tier0'

config.tier0.section_('views')
# These are all the active pages that Root.py should instantiate
active = config.tier0.views.section_('active')
tier0 = active.section_('tier0')
# The class to load for this view/page
tier0.object = 'WMCore.WebTools.RESTApi'
tier0.templates = getWMBASE() + '/../../templates/WMCore/WebTools'
tier0.section_("database")
tier0.database.connectUrl = connectURL
Ejemplo n.º 21
0
# The above short-hand can be replaced with explicit namespaced configuration
# variables as described in http://www.cherrypy.org/wiki/ConfigAPI
# for example
config.Webtools.section_('server')
config.Webtools.server.socket_timeout = 30
# Shorthand configurations take precedence over explicit ones, e.g. if you have
#config.Webtools.server.socket_port = 8010
#config.Webtools.port = 8011
# your server will start on 8011
# This is the application
config.Webtools.application = 'WebtoolsDocs'

# This is the config for the application
config.component_('WebtoolsDocs')
# Define the default location for templates for the app
config.WebtoolsDocs.templates = os.path.join(getWMBASE(), 'src/templates/WMCore/WebTools')
config.WebtoolsDocs.admin = '*****@*****.**'
config.WebtoolsDocs.title = 'CMS WMCore/WebTools Documentation'
config.WebtoolsDocs.description = 'Documentation on the WMCORE/WebTools'

# If we want an application to run on multiple for multiple instances confiure 
# it as follows
config.WebtoolsDocs.instances = ['foo', 'bar']
# We could define the class that is the applications index
#config.WebtoolsDocs.index = 'welcome'
# but instead we'll leave it blank and use the default (Welcome.py) which
# inspects the pages that are loaded and auto-generates a page based on the
# classes doc strings. You can hide a view from the welcome page by setting
# hidden=True in its configuration - useful for "admin" pages.

# Views are all pages
Ejemplo n.º 22
0
# The above short-hand can be replaced with explicit namespaced configuration
# variables as described in http://www.cherrypy.org/wiki/ConfigAPI
# for example
config.Webtools.section_('server')
config.Webtools.server.socket_timeout = 30
# Shorthand configurations take precedence over explicit ones, e.g. if you have
#config.Webtools.server.socket_port = 8010
#config.Webtools.port = 8011
# your server will start on 8011
# This is the application
config.Webtools.application = 'WebtoolsDocs'

# This is the config for the application
config.component_('WebtoolsDocs')
# Define the default location for templates for the app
config.WebtoolsDocs.templates = os.path.join(getWMBASE(),
                                             'src/templates/WMCore/WebTools')
config.WebtoolsDocs.admin = '*****@*****.**'
config.WebtoolsDocs.title = 'CMS WMCore/WebTools Documentation'
config.WebtoolsDocs.description = 'Documentation on the WMCORE/WebTools'

# If we want an application to run on multiple for multiple instances confiure
# it as follows
config.WebtoolsDocs.instances = ['foo', 'bar']
# We could define the class that is the applications index
#config.WebtoolsDocs.index = 'welcome'
# but instead we'll leave it blank and use the default (Welcome.py) which
# inspects the pages that are loaded and auto-generates a page based on the
# classes doc strings. You can hide a view from the welcome page by setting
# hidden=True in its configuration - useful for "admin" pages.
Ejemplo n.º 23
0
 def getWMBASE(self):
     """ for those that don't want to use the static version"""
     return getWMBASE()
Ejemplo n.º 24
0
    config.WorkQueueManager.couchurl, config.WorkQueueManager.dbname)
config.TaskArchiver.localWMStatsURL = "%s/%s" % (
    config.JobStateMachine.couchurl, config.JobStateMachine.jobSummaryDBName)
config.TaskArchiver.centralWMStatsURL = "Central WMStats URL"
config.TaskArchiver.DataKeepDays = 0.125  # delete after 3 hours
config.TaskArchiver.cleanCouchInterval = 60 * 20  # 20 min
config.TaskArchiver.ReqMgrServiceURL = "ReqMgr rest service"

config.webapp_('WMBSService')
config.WMBSService.default_expires = 0
config.WMBSService.componentDir = os.path.join(config.General.workDir,
                                               "WMBSService")
config.WMBSService.Webtools.port = wmbsServicePort
config.WMBSService.Webtools.host = serverHostName
config.WMBSService.Webtools.environment = "devel"
config.WMBSService.templates = os.path.join(getWMBASE(),
                                            'src/templates/WMCore/WebTools')
config.WMBSService.admin = config.Agent.contact
config.WMBSService.title = 'WMBS Data Service'
config.WMBSService.description = 'Provide WMBS related service call'

config.WMBSService.section_("security")
config.WMBSService.security.dangerously_insecure = True

config.WMBSService.section_('views')
active = config.WMBSService.views.section_('active')
wmbs = active.section_('wmbs')
wmbs.object = 'WMCore.WebTools.RESTApi'
wmbs.templates = os.path.join(getWMBASE(), 'src/templates/WMCore/WebTools/')
wmbs.section_('model')
wmbs.model.object = 'WMCore.HTTPFrontEnd.WMBS.WMBSRESTModel'
Ejemplo n.º 25
0
 def getWMBASE(self):
     """ for those that don't want to use the static version"""
     return getWMBASE()
Ejemplo n.º 26
0
 def doWrapped(self, commandArgs):
     wrapperPath = os.path.join(getWMBASE(),'src','python','WMCore','Storage','Plugins','XRDCP','wrapenv.sh')
     commandArgs.insert(0,wrapperPath)
     return runCommand(commandArgs)