fix: wrap _ensure_buildx_builder CalledProcessError as ImageBuildError#1169
Closed
EngHabu wants to merge 1 commit into
Closed
fix: wrap _ensure_buildx_builder CalledProcessError as ImageBuildError#1169EngHabu wants to merge 1 commit into
EngHabu wants to merge 1 commit into
Conversation
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
Contributor
Author
|
Closing as a duplicate of #1167, which addresses the same Sentry issue (FLYTE-SDK-4R) and is a superset of this change: it wraps both |
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.
Problem
DockerImageBuilder._ensure_buildx_builder()runsdocker buildx lsanddocker buildx create --name flytex ...viasubprocess.run(..., check=True). When those commands fail (staleflytexbuilder, daemon hiccup, conflicting builder, ...), the rawsubprocess.CalledProcessErrorbubbles up to Sentry as if it were an SDK bug — but it is the user's local docker environment misbehaving and they have no actionable error.PR #1082 already wrapped
docker buildx buildfailures asImageBuildError. The same treatment now extends to the_ensure_buildx_buildersubprocess calls.Fix
In
src/flyte/_internal/imagebuild/docker_builder.py:docker buildx lssubprocess.CalledProcessErrorasImageBuildError(with docker stderr captured for context).docker buildx create --name flytex ...subprocess.CalledProcessErrorasImageBuildError, with a hint to rundocker buildx rm flytexor override viaFLYTE_DOCKER_BUILDKIT_BUILDER_NAME.ImageBuildErroris aRuntimeUserErroralready filtered byflyte/_sentry.py:_is_user_error, so these crashes stop polluting Sentry while the user gets an actionable message.Closes
CalledProcessError: Command '['docker', 'buildx', 'create', ...]' returned non-zero exit status 1.fixes FLYTE-SDK-4RTests
test_ensure_buildx_builder_wraps_create_called_process_error(create fails →ImageBuildError).test_ensure_buildx_builder_wraps_ls_called_process_error(ls fails →ImageBuildError).