Skip to content

Commit

Permalink
Merge pull request #456 from niaid/feature/notify-cleanup-on-crash
Browse files Browse the repository at this point in the history
Notify and cleanup on workflow crash
  • Loading branch information
philipmac authored Feb 20, 2024
2 parents bc2eda6 + e9b1e77 commit b7ffb61
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions em_workflows/brt/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ def get_callback_result(callback_data: list) -> list:
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
on_crashed=[
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
)
def brt_flow(
# This block of params map are for adoc file specfication.
Expand Down
4 changes: 4 additions & 0 deletions em_workflows/czi/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ def update_file_metadata(file_path: FilePath, callback_with_zarr: Dict) -> Dict:
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
on_crashed=[
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
)
async def czi_flow(
file_share: str,
Expand Down
4 changes: 4 additions & 0 deletions em_workflows/dm_conversion/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def scale_jpegs(file_path: FilePath, size: str) -> Optional[dict]:
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
on_crashed=[
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
)
def dm_flow(
file_share: str,
Expand Down
4 changes: 4 additions & 0 deletions em_workflows/lrg_2d_rgb/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ def gen_thumb(file_path: FilePath):
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
on_crashed=[
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
)
# run_config=LocalRun(labels=[utils.get_environment()]),
def lrg_2d_flow(
Expand Down
4 changes: 4 additions & 0 deletions em_workflows/sem_tomo/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ def gen_ng_metadata(fp_in: FilePath) -> Dict:
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
on_crashed=[
utils.notify_api_completion,
utils.copy_workdirs_and_cleanup_hook,
],
)
def sem_tomo_flow(
file_share: str,
Expand Down

0 comments on commit b7ffb61

Please sign in to comment.