OasisLMF / OasisPlatform

Loss modelling platform.
BSD 3-Clause "New" or "Revised" License
40 stars 17 forks source link

Lot3 - worker monitor compatibility fix needed #1052

Closed sambles closed 4 months ago

sambles commented 4 months ago

Issue Description

From https://github.com/OasisLMF/OasisPlatform/pull/958

Traceback (most recent call last):
  File "/home/server/.local/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/server/.local/lib/python3.10/site-packages/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*args, **kwargs)
  File "/var/www/oasis/src/server/oasisapi/analyses/v2_api/tasks.py", line 556, in record_losses_files
    for name, put_location in result['raw_output_locations'].items():
KeyError: 'raw_output_locations'

Happens because worker-monitor is expecting every V2 worker to return raw_output_locations in its result, which is not true for older 2.3.x images.

https://github.com/OasisLMF/OasisPlatform/blob/20b0aa391335a420bf4dcdd70caa8e02b771fb60/src/server/oasisapi/analyses/v2_api/tasks.py#L554-L560