fix: surface third-party image builder failures as ImageBuildError (FLYTE-SDK-58) - #1369
Merged
Conversation
…LYTE-SDK-58)
Builders registered through the `flyte.plugins.image_builders` entry point (or
passed directly to `flyte.init(image_builder=...)`) are third-party code. When
one raised a bare exception, it travelled all the way out of
`ImageBuildEngine.build` unchanged and was recorded as an SDK crash.
FLYTE-SDK-58 is exactly that: a plugin builder raised
RuntimeError: Failed to get GitHub credentials from git askpass -
please reload your terminal or open a new session then try again.
which is a message about the user's own machine, not an SDK bug.
Wrap exceptions from non-builtin builders as `ImageBuildError` (a
`RuntimeUserError`, so `_is_user_error` filters it out of crash reporting)
while chaining the original as `__cause__`. Exceptions that already carry a
classification — `BaseRuntimeError` and the click control-flow exceptions — are
re-raised untouched, and the SDK's own Docker/remote builders are deliberately
left unwrapped so genuine SDK failures keep reaching Sentry.
Also convert the plugin *load* failure in `_load_custom_image_builders` from a
bare `RuntimeError` to `ImageBuildError` for the same reason.
fixes FLYTE-SDK-58
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.