Skip to content

Commit

Permalink
Upgrade Supervisely SDK to v6.73.111. Added Exception Handler for con…
Browse files Browse the repository at this point in the history
…tainer crashes (#75)
  • Loading branch information
almazgimaev authored Jun 20, 2024
1 parent e54aa53 commit 8cb38f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions agent/worker/task_logged.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,25 @@ def end_log_stop(self):
return sly.EventType.TASK_STOPPED

def end_log_crash(self, e):
exc_str = traceback.format_exc()
from supervisely.io.exception_handlers import handle_exception

trace_str = traceback.format_exc()

handled_exc = handle_exception(e)
if handled_exc is not None:
exit_status = handled_exc.title
exc_str = handled_exc.get_message_for_exception()
else:
exit_status = str(e)
exc_str = repr(e)

self.logger.warn(
"TASK_END",
extra={
"event_type": sly.EventType.TASK_CRASHED,
"exit_status": str(e),
"exc_str": repr(e),
"trace": exc_str,
"exit_status": exit_status,
"exc_str": exc_str,
"trace": trace_str,
},
)
return sly.EventType.TASK_CRASHED
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ grpcio-tools==1.47.0
# py3exiv2==0.9.3
packaging==21.3
version-parser==1.0.1
supervisely==6.72.203
supervisely==6.73.111
docker==3.3.0
black
python-slugify==6.1.2
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ filelock==3.13.1
torch==1.7.1+cu110
torchvision==0.8.2+cu110
-f https://download.pytorch.org/whl/torch_stable.html
supervisely==6.73.24
supervisely==6.73.111
# for development
# supervisely @ git+https://github.com/supervisely/supervisely.git@dev-branch

0 comments on commit 8cb38f3

Please sign in to comment.