Closed chatziko closed 1 year ago
I'm all for adding a way to get it running without internet, but I'm not a fan of this approach. It is way too hacky and funky for me to consider adding.
You mean the general approach of caching packages? What would be a better approach, given the constraints of the addon system?
What would be a better approach
I dunno, but the current offered solution in this PR is not something I'm consider to add.
In case you want to reconsider:
I removed the option, now caching is always enabled (still clearing the cache in case of changes, for robustness).
I re-tried the pip cache approach, it does not fully prevent network access. It's actually explicitely mentioned in pip's documentation, and the proposed solution is exactly pip download
.
If you want other changes I'd be happy to implement them. If nothing can make you reconsider, well... one more fork to maintain :smile:
PS. In any case, many thanks for your amazing work on HA!
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.
Proposed Changes
The AppDaemon addon re-installs user-configured system and python packages on every restart. Apart from being slow, this has the serious drawback of completely breaking the setup if no internet connection is available (going completely against the HA philosophy).
With this PR package installation happens in two phases:
/data/package-cache/{apk,pip}
usingapk fetch
andpip download
.The first step is skipped if the cache already exists, so future restarts are fast and require no internet connection.
To increase robustness:
/data/package-cache/{apk,pip}/tag
). So if the addon is upgraded, or the package list changes, the full cache is rebuilt, avoiding issues with old cached packages.Related Issues
235 #216