Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
16 stars 4 forks source link

Make Docker build errors more useful #399

Closed WillEngler closed 5 months ago

WillEngler commented 5 months ago

Closes #367

Overview

It was the case that errors during Docker builds were uncaught and surfaced as if they were exceptions thrown by the Garden app. This meant that the user got a big Typer stack trace that had nothing to do with their build issue.

We expect build errors to happen during normal usage, say if a user has a bug in their notebook or a bad requirements file. This PR makes it so that if there is a build error, we display the full build log so the user can diagnose the issue. We also display a helpful message at the end.

Discussion

For the case where there is a bug in the user's notebook code, we now put the relevant traceback right where they can see it and act on it.

Screenshot 2024-02-05 at 12 51 09 PM

Testing

I tested manually with the notebook publish command. I used a notebook where I divided by 0 to test the "build" segment and a known-bad requirements.txt to test the "prebuild" segment. I also added a new unit test.

Documentation

No docs changes.


📚 Documentation preview 📚: https://garden-ai--399.org.readthedocs.build/en/399/

codecov-commenter commented 5 months ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (6006881) 75.32% compared to head (8baf9d1) 75.63%.

Files Patch % Lines
garden_ai/app/notebook.py 74.19% 8 Missing :warning:
garden_ai/containers.py 87.50% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #399 +/- ## ========================================== + Coverage 75.32% 75.63% +0.30% ========================================== Files 45 45 Lines 2614 2643 +29 ========================================== + Hits 1969 1999 +30 + Misses 645 644 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.