Skip to content

Commit

Permalink
Merge pull request #271 from HSF/dev
Browse files Browse the repository at this point in the history
fix to adapt new panda event status result
  • Loading branch information
wguanicedew authored Jan 16, 2024
2 parents 1fa08c4 + 49dd83a commit a96bd81
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
25 changes: 20 additions & 5 deletions doma/lib/idds/doma/workflowv2/domapandawork.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,22 +1235,38 @@ def get_event_job(self, sub_map_id, panda_jobs, job_set_events):
for event_id in events:
event_index = int(event_id.split('-')[3]) - 1
if event_index == sub_map_id:
event_status = events[event_id]
event_result = events[event_id]
if type(event_result) in [dict]:
# new version of panda result
event_status = event_result.get('status', None)
event_error = event_result.get('error', None)
event_diag = event_result.get('diag', None)
else:
event_status = event_result
event_error, event_diag = None, None
if event_status not in sub_map_id_jobs:
sub_map_id_jobs[event_status] = []
# todo: get the event error code and error diag
item = {'status': event_status, 'error_code': None, 'error_diag': None, 'job': panda_job}
item = {'status': event_status, 'error_code': event_error, 'error_diag': event_diag, 'job': panda_job}
sub_map_id_jobs[event_status].append(item)

if not ret_event:
for event_id in job_set_events:
event_index = int(event_id.split('-')[3]) - 1
if event_index == sub_map_id:
event_status = job_set_events[event_id]
event_result = job_set_events[event_id]
if type(event_result) in [dict]:
# new version of panda result
event_status = event_result.get('status', None)
event_error = event_result.get('error', None)
event_diag = event_result.get('diag', None)
else:
event_status = event_result
event_error, event_diag = None, None
if event_status not in sub_map_id_jobs:
sub_map_id_jobs[event_status] = []
# todo: get the event error code and error diag
item = {'status': event_status, 'error_code': None, 'error_diag': None}
item = {'status': event_status, 'error_code': event_error, 'error_diag': event_diag}
sub_map_id_jobs[event_status].append(item)

final_event_status = None
Expand Down Expand Up @@ -1478,7 +1494,6 @@ def get_update_contents(self, unterminated_jobs_status, input_output_maps, conte

for content in output_contents:
sub_map_id = content['sub_map_id']
self.logger.debug("wen")
# min_id = content['min_id'] # min_id should be the same as sub_map_id here
event, event_panda_job = self.get_event_job(sub_map_id, panda_jobs, job_set_events)
self.logger.debug("sub_map_id: %s, panda_jobs: %s, job_set_events: %s, event: %s, event_panda_job: %s" % (sub_map_id, panda_jobs, job_set_events, event, event_panda_job))
Expand Down
5 changes: 3 additions & 2 deletions main/lib/idds/tests/panda_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
os.environ['PANDA_URL_SSL'] = 'https://pandaserver-doma.cern.ch:25443/server/panda'

os.environ['PANDA_BEHIND_REAL_LB'] = "1"
# os.environ['PANDA_URL'] = 'http://rubin-panda-server-dev.slac.stanford.edu:80/server/panda'
# os.environ['PANDA_URL_SSL'] = 'https://rubin-panda-server-dev.slac.stanford.edu:8443/server/panda'
os.environ['PANDA_URL'] = 'http://rubin-panda-server-dev.slac.stanford.edu:80/server/panda'
os.environ['PANDA_URL_SSL'] = 'https://rubin-panda-server-dev.slac.stanford.edu:8443/server/panda'

# os.environ['PANDA_URL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'
# os.environ['PANDA_URL_SSL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'
Expand Down Expand Up @@ -48,6 +48,7 @@
task_ids = [i for i in range(167781, 167785)]
task_ids = [i for i in range(166799, 167877)]
task_ids = [i for i in range(167997, 168003)]
task_ids = [688, 8686, 8695, 8696]
for task_id in task_ids:
print("Killing %s" % task_id)
ret = Client.killTask(task_id, verbose=True)
Expand Down

0 comments on commit a96bd81

Please sign in to comment.