Garden-AI / garden

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

Handle Docker connection issues more gracefully #389

Closed WillEngler closed 7 months ago

WillEngler commented 7 months ago

Fixes #376

Overview

This PR adds error handling that catches the case when Garden can't invoke Docker at all. The common cases of this we've seen are when the daemon is off and when the user isn't in the right group to use Docker so they get a PermissionDenied.

This PR also adds a new garden-ai docker check command. This is a sanity check command that users can run to confirm they have Docker set up correctly. They can also run garden-ai docker check --verbose to get the big old stack trace if that helps.

Discussion

Here's what it looks like.

Trying to run a notebook command but can't connect to Docker.

Screenshot 2024-01-18 at 3 19 04 PM

Running docker check when you can't connect.

Screenshot 2024-01-18 at 3 18 32 PM

Running docker check when you can connect :)

Screenshot 2024-01-18 at 3 19 27 PM

Testing

I tested the scenarios on my MacOS machine and on a Linux machine to find the error messages that Docker propagates. I tested the logic on my machine by turning the Docker daemon on and off. I also added new unit tests for the error handling utilities.

Documentation

None yet, but next in line for me is #380. A lot of the use for garden-ai docker check will be telling users to run it to make sure they're good to start the tutorial.


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

codecov-commenter commented 7 months ago

Codecov Report

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

Comparison is base (7c4a36e) 75.69% compared to head (9bd2fe5) 76.04%.

Files Patch % Lines
garden_ai/app/notebook.py 26.92% 38 Missing :warning:
garden_ai/app/docker.py 35.00% 13 Missing :warning:
garden_ai/containers.py 96.66% 1 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 #389 +/- ## ========================================== + Coverage 75.69% 76.04% +0.34% ========================================== Files 42 44 +2 Lines 2432 2542 +110 ========================================== + Hits 1841 1933 +92 - Misses 591 609 +18 ```

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