Garden-AI / garden

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

359 error if `stage()` called during publish #370

Closed OwenPriceSkelly closed 8 months ago

OwenPriceSkelly commented 9 months ago

closes #359

Overview

This decorates the HFConnector.stage method so that we can raise an error if it's been called during an image build, but not anywhere else.

Discussion

Originally we wanted this to be just a warning, but that turned out to be pretty poor UX -- a warning wouldn't appear at all unless running notebook publish --verbose; even when verbose, the warning was hard to find in the output among the various safe-to-ignore WARNING: Running pip as the 'root' user can result ... messages.

I spent a while trying to come up with a clean way to provide an option for power users to do this anyway, but after hitting a couple dead-ends I think it makes more sense for those users to just not use .stage() than it does for me to spend much more time on this ticket.

tldr: turned out more opinionated than I'd like, but I think it's innocent until proven gripe

Testing

Published the tutorial notebook (with this branch installed) a few times with/-out problematic code and the --verbose flag

Documentation

no new docs


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

codecov-commenter commented 9 months ago

Codecov Report

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

Comparison is base (3308a3b) 76.38% compared to head (a1fc648) 76.26%.

Files Patch % Lines
garden_ai/scripts/save_session_and_metadata.py 0.00% 4 Missing :warning:
garden_ai/utils/misc.py 75.00% 2 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 #370 +/- ## ========================================== - Coverage 76.38% 76.26% -0.12% ========================================== Files 42 42 Lines 2291 2305 +14 ========================================== + Hits 1750 1758 +8 - Misses 541 547 +6 ```

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