Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hooks for failure scenarios: crash_hook, cancel_hook, fail_hook #4315

Merged
merged 34 commits into from
Aug 11, 2023

Conversation

XavierCS-dev
Copy link
Contributor

Implements 3 hooks for failure scenarios:

  • fail_hook: occurs when an EasybuildError is encountered.
  • cancel_hook: occurs when the user issues a keyboard interrupt.
  • crash_hook: occurs when a generic python Exception is encountered.

These hooks can provide external information on which errors occurred, so users taking advantage of hooks can take automated action based on which error occurred. These hooks can also be used to export the errors to external tools.

fixes #4302

@easybuilders easybuilders deleted a comment from boegelbot Aug 8, 2023
boegel
boegel previously approved these changes Aug 8, 2023
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel
Copy link
Member

boegel commented Aug 8, 2023

Some merge conflicts will pop up here if #4304 gets merged first...

easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/tools/hooks.py Show resolved Hide resolved
easybuild/tools/hooks.py Show resolved Hide resolved
@easybuilders easybuilders deleted a comment from boegelbot Aug 10, 2023
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
easybuild/main.py Outdated Show resolved Hide resolved
XavierCS-dev and others added 2 commits August 11, 2023 11:15
Co-authored-by: Simon Branford <4967+branfosj@users.noreply.github.com>
clean up passing of data produced by prepare_main into main
@boegel boegel merged commit 7f602b9 into easybuilders:develop Aug 11, 2023
@boegel boegel changed the title Implement hooks for failure scenarios Implement hooks for failure scenarios: crash_hook, cancel_hook, fail_hook Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement hooks for failure scenarios
3 participants