Ejemplo n.º 1
0
    def map_panda_ids(self, unregistered_job_ids, input_output_maps):
        self.logger.debug("map_panda_ids, unregistered_job_ids: %s" %
                          str(unregistered_job_ids))
        from pandatools import Client

        # updated_map_ids = []
        full_update_contents = []
        chunksize = 2000
        chunks = [
            unregistered_job_ids[i:i + chunksize]
            for i in range(0, len(unregistered_job_ids), chunksize)
        ]
        for chunk in chunks:
            jobs_list = Client.getJobStatus(chunk, verbose=0)[1]
            for job_info in jobs_list:
                if job_info and job_info.Files and len(job_info.Files) > 0:
                    for job_file in job_info.Files:
                        # if job_file.type in ['log']:
                        if job_file.type not in ['pseudo_input']:
                            continue
                        if ':' in job_file.lfn:
                            pos = job_file.lfn.find(":")
                            input_file = job_file.lfn[pos + 1:]
                            # input_file = job_file.lfn.split(':')[1]
                        else:
                            input_file = job_file.lfn
                        map_id = self.get_map_id_from_input(
                            input_output_maps, input_file)
                        if map_id:
                            update_contents = self.get_update_contents_from_map_id(
                                map_id, input_output_maps, job_info)
                            full_update_contents += update_contents
        return full_update_contents
Ejemplo n.º 2
0
    def get_status_changed_contents(self, unterminated_job_ids,
                                    input_output_maps, panda_id_to_map_ids):
        self.logger.debug(
            "get_status_changed_contents, unterminated_job_ids: %s" %
            str(unterminated_job_ids))
        from pandatools import Client

        full_update_contents = []
        chunksize = 2000
        chunks = [
            unterminated_job_ids[i:i + chunksize]
            for i in range(0, len(unterminated_job_ids), chunksize)
        ]
        for chunk in chunks:
            jobs_list = Client.getJobStatus(chunk, verbose=0)[1]
            for job_info in jobs_list:
                panda_id = job_info.PandaID
                map_id = panda_id_to_map_ids[panda_id]
                update_contents = self.get_update_contents_from_map_id(
                    map_id, input_output_maps, job_info)
                full_update_contents += update_contents
        return full_update_contents
Ejemplo n.º 3
0
import os  # noqa E402
import sys
import datetime

os.environ['PANDA_URL'] = 'http://ai-idds-01.cern.ch:25080/server/panda'
os.environ['PANDA_URL_SSL'] = 'https://ai-idds-01.cern.ch:25443/server/panda'

from pandatools import Client  # noqa E402

jobids = [1408118]
jobs_list_status = Client.getJobStatus(jobids, verbose=0)
print(jobs_list_status)
jobs_list = jobs_list_status[1]
print(jobs_list)
for job_info in jobs_list:
    if job_info is not None:
        # if job_info.Files and len(job_info.Files) > 0:
        print(job_info)
        print(job_info.attemptNr)
        print(job_info.maxAttempt)
        print(job_info.Files)
        print(job_info.Files[0])
        for f in job_info.Files:
            # print(dir(f))
            print(f._attributes)
            print(f.values())
            print(f.type)

jediTaskID = 3885
ret = Client.getJediTaskDetails({'jediTaskID': jediTaskID},
                                True,