Skip to content

Commit

Permalink
fix(sdk): print docker error messages (#9595)
Browse files Browse the repository at this point in the history
Without this commit, `kfp component build` doesn't print any error
messages that docker emits, e.g. if docker push fails.

Co-authored-by: Christian Geier <[email protected]>
  • Loading branch information
hsteude and geier authored Jun 13, 2023
1 parent 9eff7ff commit a9ac0b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/python/kfp/cli/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,12 @@ def build_image(self, platform: str, push_image: bool):
self._target_image, stream=True, decode=True)
for log in response:
status = log.get('status', '').rstrip('\n')
error = log.get('error', '').rstrip('\n')
layer = log.get('id', '')
if status:
logging.info(f'{docker_log_prefix}: {layer} {status}')
if error:
logging.error(f'{docker_log_prefix} ERROR: {error}')
except docker.errors.BuildError as e:
logging.error(f'{docker_log_prefix}: {e}')
raise e
Expand Down

0 comments on commit a9ac0b9

Please sign in to comment.