Example #1
0
def populateDashboardMonitorInfo(myad, params):
    params['MonitorID'] = myad['CRAB_ReqName']
    params['MonitorJobID'] = '%d_https://glidein.cern.ch/%d/%s_%d' % (myad['CRAB_Id'], myad['CRAB_Id'], myad['CRAB_ReqName'].replace("_", ":"), myad['CRAB_Retry'])
    if 'CRAB_UserWebDir' in myad:
        setDashboardLogs(params, myad['CRAB_UserWebDir'], myad['CRAB_Id'], myad['CRAB_Retry'])
    else:
        print "Not setting dashboard logfiles as I cannot find CRAB_UserWebDir in myad."
Example #2
0
    def update_dashboard(self, crab_retry):
        """
        Need a doc string here.
        """
        if not self.task_ad:
            return
        params = {'tool': 'crab3',
                  'SubmissionType': 'crab3',
                  'JSToolVersion': '3.3.0',
                  'tool_ui': os.environ.get('HOSTNAME', ''),
                  'scheduler': 'GLIDEIN',
                  'GridName': self.task_ad['CRAB_UserDN'],
                  'ApplicationVersion': self.task_ad['CRAB_JobSW'],
                  'taskType': self.task_ad.get("CRAB_DashboardTaskType", 'analysistest'),
                  'vo': 'cms',
                  'CMSUser': self.task_ad['CRAB_UserHN'],
                  'user': self.task_ad['CRAB_UserHN'],
                  'taskId': self.task_ad['CRAB_ReqName'],
                  'datasetFull': self.task_ad['DESIRED_CMSDataset'],
                  'resubmitter': self.task_ad['CRAB_UserHN'],
                  'exe': 'cmsRun',
                  'broker': self.backend,
                  'bossId': str(self.job_id),
                  'localId': '',
                  'SyncGridJobId': 'https://glidein.cern.ch/%s/%s' % (self.job_id, self.task_ad['CRAB_ReqName'].replace("_", ":")),
                 }

        storage_rules = htcondor.param['CRAB_StorageRules']
        userWebDir = getWebdirForDb(str(self.task_ad.get('CRAB_ReqName')), storage_rules)

        userWebDirPrx = ""
        try:
            with open('proxied_webdir') as fd:
                proxied_webdir = fd.read()
            userWebDirPrx = proxied_webdir
        except IOError as e:
            self.logger.error(("'I/O error(%s): %s', when looking for the proxied_webdir file. Might be normal"
                         " if the schedd does not have a proxiedurl in the REST external config." % (e.errno, e.strerror)))

        self.logger.info("User web dir proxy: " + userWebDirPrx)
        self.logger.info("web dir: " + userWebDir)

        if userWebDirPrx:
            setDashboardLogs(params, userWebDirPrx, self.job_id, crab_retry)
        elif userWebDir:
            setDashboardLogs(params, userWebDir, self.job_id, crab_retry)
        else:
            print("Not setting dashboard logfiles as I cannot find CRAB_UserWebDir nor CRAB_UserWebDirPrx.")

        insertJobIdSid(params, self.job_id, self.task_ad['CRAB_ReqName'], crab_retry)
        apmon = ApmonIf()
        self.logger.debug("Dashboard task info: %s" % str(params))
        apmon.sendToML(params)
        apmon.free()
Example #3
0
    def update_dashboard(self, crab_retry):
        """
        Need a doc string here.
        """
        if not self.task_ad:
            return
        params = {'tool': 'crab3',
                  'SubmissionType': 'crab3',
                  'JSToolVersion': '3.3.0',
                  'tool_ui': os.environ.get('HOSTNAME', ''),
                  'scheduler': 'GLIDEIN',
                  'GridName': self.task_ad['CRAB_UserDN'],
                  'ApplicationVersion': self.task_ad['CRAB_JobSW'],
                  'taskType': self.task_ad.get("CRAB_DashboardTaskType", 'analysistest'),
                  'vo': 'cms',
                  'CMSUser': self.task_ad['CRAB_UserHN'],
                  'user': self.task_ad['CRAB_UserHN'],
                  'taskId': self.task_ad['CRAB_ReqName'],
                  'datasetFull': self.task_ad['DESIRED_CMSDataset'],
                  'resubmitter': self.task_ad['CRAB_UserHN'],
                  'exe': 'cmsRun',
                  'broker': self.backend,
                  'bossId': str(self.job_id),
                  'localId': '',
                  'SyncGridJobId': 'https://glidein.cern.ch/%s/%s' % (self.job_id, self.task_ad['CRAB_ReqName'].replace("_", ":")),
                 }

        storage_rules = htcondor.param['CRAB_StorageRules']
        userWebDir = getWebdirForDb(str(self.task_ad.get('CRAB_ReqName')), storage_rules)

        userWebDirPrx = ""
        try:
            with open('proxied_webdir') as fd:
                proxied_webdir = fd.read()
            userWebDirPrx = proxied_webdir
        except IOError as e:
            self.logger.error(("'I/O error(%s): %s', when looking for the proxied_webdir file. Might be normal"
                         " if the schedd does not have a proxiedurl in the REST external config." % (e.errno, e.strerror)))

        self.logger.info("User web dir proxy: " + userWebDirPrx)
        self.logger.info("web dir: " + userWebDir)

        if userWebDirPrx:
            setDashboardLogs(params, userWebDirPrx, self.job_id, crab_retry)
        elif userWebDir:
            setDashboardLogs(params, userWebDir, self.job_id, crab_retry)
        else:
            print("Not setting dashboard logfiles as I cannot find CRAB_UserWebDir nor CRAB_UserWebDirPrx.")

        insertJobIdSid(params, self.job_id, self.task_ad['CRAB_ReqName'], crab_retry)
        apmon = ApmonIf()
        self.logger.debug("Dashboard task info: %s" % str(params))
        apmon.sendToML(params)
        apmon.free()
Example #4
0
    def update_dashboard(self, crab_retry):
        """
        Need a doc string here.
        """
        if not self.task_ad:
            return
        params = {
            'tool':
            'crab3',
            'SubmissionType':
            'crab3',
            'JSToolVersion':
            '3.3.0',
            'tool_ui':
            os.environ.get('HOSTNAME', ''),
            'scheduler':
            'GLIDEIN',
            'GridName':
            self.task_ad['CRAB_UserDN'],
            'ApplicationVersion':
            self.task_ad['CRAB_JobSW'],
            'taskType':
            self.task_ad.get("CRAB_DashboardTaskType", 'analysistest'),
            'vo':
            'cms',
            'CMSUser':
            self.task_ad['CRAB_UserHN'],
            'user':
            self.task_ad['CRAB_UserHN'],
            'taskId':
            self.task_ad['CRAB_ReqName'],
            'datasetFull':
            self.task_ad['DESIRED_CMSDataset'],
            'resubmitter':
            self.task_ad['CRAB_UserHN'],
            'exe':
            'cmsRun',
            'broker':
            self.backend,
            'bossId':
            str(self.job_id),
            'localId':
            '',
            'SyncGridJobId':
            'https://glidein.cern.ch/%s/%s' %
            (self.job_id, self.task_ad['CRAB_ReqName'].replace("_", ":")),
        }

        if not self.userWebDirPrx:
            storage_rules = htcondor.param['CRAB_StorageRules']
            self.userWebDirPrx = getWebdirForDb(
                str(self.task_ad.get('CRAB_ReqName')), storage_rules)

        self.logger.info("User web dir: %s", self.userWebDirPrx)
        if self.userWebDirPrx:
            setDashboardLogs(params, self.userWebDirPrx, self.job_id,
                             crab_retry)
        else:
            print("Not setting dashboard logfiles as I cannot find a web dir.")

        insertJobIdSid(params, self.job_id, self.task_ad['CRAB_ReqName'],
                       crab_retry)
        apmon = ApmonIf()
        self.logger.debug("Dashboard task info: %s", str(params))
        apmon.sendToML(params)
        apmon.free()