Esempio n. 1
0
    def update_dashboard(self, retry, id, reqname, backend):

        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['CRAB_InputData'],
                  'resubmitter': self.task_ad['CRAB_UserHN'],
                  'exe': 'cmsRun',
                  'jobId': ("%d_https://glidein.cern.ch/%d/%s_%d" % (id, id, self.task_ad['CRAB_ReqName'].replace("_", ":"), retry)),
                  'sid': "https://glidein.cern.ch/%d/%s" % (id, self.task_ad['CRAB_ReqName'].replace("_", ":")),
                  'broker': backend,
                  'bossId': str(id),
                  'localId' : '',
                 }

        apmon = ApmonIf()
        print("Dashboard task info: %s" % str(params))
        apmon.sendToML(params)
        apmon.free()
Esempio n. 2
0
 def sendDashboardJobs(self, params, info):
     apmon = ApmonIf()
     for job in info:
         job.update(params)
         self.logger.debug("Dashboard job info: %s" % str(job))
         apmon.sendToML(job)
     apmon.free()
Esempio n. 3
0
 def sendDashboardJobs(self, params, info):
     apmon = ApmonIf()
     for job in info:
         job.update(params)
         self.logger.debug("Dashboard job info: %s" % str(job))
         apmon.sendToML(job)
     apmon.free()
 def sendDashboardJobs(self, params, info):
     """Send dashboard information about jobs of task"""
     apmon = ApmonIf()
     for job in info:
         job.update(params)
         apmon.sendToML(job)
     self.logger.debug("Dashboard job info submitted. Last job for example is: %s", job)
     apmon.free()
Esempio n. 5
0
 def sendDashboardJobs(self, params, info):
     """Send dashboard information about jobs of task"""
     apmon = ApmonIf()
     for job in info:
         job.update(params)
         apmon.sendToML(job)
     self.logger.debug("Dashboard job info submitted. Last job for example is: %s", job)
     apmon.free()
Esempio n. 6
0
 def sendDashboardTask(self):
     apmon = ApmonIf()
     params = self.buildDashboardInfo()
     params_copy = dict(params)
     params_copy['jobId'] = 'TaskMeta'
     self.logger.debug("Dashboard task info: %s" % str(params_copy))
     apmon.sendToML(params_copy)
     apmon.free()
     return params
Esempio n. 7
0
 def sendDashboardTask(self):
     apmon = ApmonIf()
     params = self.buildDashboardInfo()
     params_copy = dict(params)
     params_copy['jobId'] = 'TaskMeta'
     self.logger.debug("Dashboard task info: %s" % str(params_copy))
     apmon.sendToML(params_copy)
     apmon.free()
     return params
Esempio n. 8
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()
Esempio n. 9
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()
Esempio n. 10
0
    def update_dashboard(self, retry, id, reqname, backend):

        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['CRAB_InputData'],
            'resubmitter':
            self.task_ad['CRAB_UserHN'],
            'exe':
            'cmsRun',
            'jobId':
            ("%d_https://glidein.cern.ch/%d/%s_%d" %
             (id, id, self.task_ad['CRAB_ReqName'].replace("_", ":"), retry)),
            'sid':
            "https://glidein.cern.ch/%d/%s" %
            (id, self.task_ad['CRAB_ReqName'].replace("_", ":")),
            'broker':
            backend,
            'bossId':
            str(id),
            'localId':
            '',
        }

        apmon = ApmonIf()
        print("Dashboard task info: %s" % str(params))
        apmon.sendToML(params)
        apmon.free()
Esempio n. 11
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()