whole-tale / girder_wholetale

Girder plugin providing basic Whole Tale functionality
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Do not fail instance remove if volume doesn't exist #578

Closed Xarthisius closed 1 year ago

Xarthisius commented 1 year ago

If Instance fails during image build, containerInfo is not there yet on instance. As result it fails during remove Instance step with:

2023-05-23 17:50:24,591] ERROR: 500 Error    
Traceback (most recent call last):    
  File "/girder/girder/api/rest.py", line 630, in endpointDecorator    
    val = fun(self, path, params)    
  File "/girder/girder/api/rest.py", line 1212, in DELETE    
    return self.handleRoute('DELETE', path, params)    
  File "/girder/girder/api/rest.py", line 970, in handleRoute    
    val = handler(**kwargs)    
  File "/girder/girder/api/access.py", line 63, in wrapped    
    return fun(*args, **kwargs)    
  File "/girder/girder/api/describe.py", line 709, in wrapped    
    return fun(*args, **kwargs)    
  File "/girder/plugins/wholetale/server/rest/instance.py", line 173, in deleteInstance    
    self.model('instance', 'wholetale').deleteInstance(    
  File "/girder/plugins/wholetale/server/models/instance.py", line 150, in deleteInstance    
    queue=instance['containerInfo']['nodeId']    
KeyError: 'containerInfo'    
Additional info:    
  Request URL: DELETE https://girder.htmdec.org/api/v1/instance/645ce2bf36f2efb9918c20b3    
  Query string:     
  Remote IP: 10.0.0.2    

How to test?

  1. Create a Tale with an ill-defined requirements.txt (e.g. package arafglkalfkgh)
  2. Run the Tale

Expected output

Tale fails to build an Instance is cleanly removed

Actual output

You get stuck with an tale/instance in a stopping state.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.04 :warning:

Comparison is base (6fbd4c2) 92.97% compared to head (9f3b050) 92.94%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #578 +/- ## ========================================== - Coverage 92.97% 92.94% -0.04% ========================================== Files 61 61 Lines 4970 4973 +3 ========================================== + Hits 4621 4622 +1 - Misses 349 351 +2 ``` | [Impacted Files](https://app.codecov.io/gh/whole-tale/girder_wholetale/pull/578?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=whole-tale) | Coverage Δ | | |---|---|---| | [server/models/instance.py](https://app.codecov.io/gh/whole-tale/girder_wholetale/pull/578?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=whole-tale#diff-c2VydmVyL21vZGVscy9pbnN0YW5jZS5weQ==) | `87.29% <60.00%> (-0.91%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.