-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homeassistant: update to v2022.10.5 #5478
Conversation
@th0ma7 homeassistant depends now on orjson wheel. The build of orjson wheel needs manturin instead of setuptools-rust to build with rust. In this context I found, that spk/homeassistant/Makefile did not add the path to native/python310 bin folder to the environment (and could not find maturin...). I suppose that all packages creating wheels must set the path for native/python to be found first, otherwise it uses python3 (and wheel, pip, ...) of the dev environment that is still on python 3.9. |
That is really really odd. A few things:
So I wonder how did you ended-up calling python3.9, how was that even possible? |
Does Homeassistant really need |
@Safihre I didn't try to start it without orjson, as this is listed in the dependencies in homeassistants pyproject.toml |
fwiw I looked at it. It's part of their helpers/utils and there is no logic to fallback to the default. Their utils use specific options when dumping such as
Which makes me believe they rely on it later in their code base. Finally, the |
So I will drop ARMv5 support of homeassistant, as maturin wheel cannot be built for it. Affected models with DSM 6 are
EDIT: |
Ancient models. So just put it in release notes if anyone is wondering later. |
🎉 can't wait for this release. Thanks for the work 👍 |
af12ffd
to
1f6d670
Compare
@ixje the default configurations are working now. If you wanna try, wait for the github action to complete (successfully I hope). To manually install missing python modules (wheels):
you find the spk packages to download after gh action completes under "checks - build - summary - artifacts" Thanks. |
I won’t be home until monday, but will check then and let you know. Thanks!
… On 17 Nov 2022, at 18:47, hgy59 ***@***.***> wrote:
@ixje the default configurations are working now.
If you wanna try, wait for the github action to complete (successfully I hope).
But be aware, that intergrations might need a manual installation
To manually install missing python modules (wheels):
ssh into your diskstation
navigate (cd) to folder /var/packages/homeassistant/target/env/bin
call ./pip install --no-deps "python-package==version"
report working integrations and/or missing python modules here
you find the spk packages to download after gh action completes under "checks - build - summary - artifacts"
to find the matching package see our wiki under Package Archs
Thanks.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Working hard @hgy59! 👍 👍 |
Hi homeassistant users! When I released the last ha package (2021.9.7-15) I started to bundle only the cross compiled wheels into the package and load all the pure python dependencies at installation time (this takes up to 60 minutes to install HA on an old weak model like DS-115j). One reason to do so, was to keep the spk files as small as possible. But it is a time consuming task to find all the dependencies (I created a test client that tries to add all integrations and added the modules until respective error logs where gone). But I actually do not want to include a list of all the (pure) python modules anymore and install all those packages at installation time. This can be done for the basic requirements to run homeassistant at its own. But not for the huge (constantly growing) number of integrations.
So far a manuall installation of missing python modules is the only solution but on spk package updates, all those manual installations are lost. some early ideas:
...probably I am too far away from the python mystery and there exists a simple solution? |
I am (as a non python programmer) wondering, why some python modules in homeassistant (or any other python program?) are installed on the fly and others fail with No module named ...
Do they really install on the fly? I’m without computer atm so can’t look at the code how it might work. It seems logical to have a base set of requirements you install upon first installation and then some optional ones depending on what hw support you need. The normal way (not homeassistant specific) to handle this would be to add the optionals to “extras” of the installation config (setup.py,setup.cfg or pyproject.toml, whatever flavour a project chooses) which you would then install via e.g “pip install homeassistant[<optional_package>]”. I’m a HA novice user but I imagine they have a friendlier solution than redirecting users to the console. It’s not something I’ve encountered before so can’t really add much there. Tbh the core project seems messy with the duplication of requirements in both pyproject.toml and the various requirements.txt files.
Isn't there an automatic dependency resolver in Python available, that installs missing dependencies on the fly (without adjusting the code of homeassistant)? (I found pipimport, but AFAICT you have to use it inside python code
As a Python programmer I’ve never seen this. As said above the standard approach is making “extras” available or just installing every possible dependency. Runtime resolving is also not straight forward todo as the import name in the code does not have to be the same as the name required to install through pip.
What kind of application/tool could provide a solution for automatic python module installation?
Exists this dependency problem only in Home Assistent Core? (don't know the other distributions [supervisor?], but those do not run on Synology DSM anyway).
I’d be interested to learn how they handle the dependencies of optional integrations. I suspect they’ll just do a “pip install” via shell execution using Subprocess, but then again if you say you’re getting “Module not found”, then it doesn’t sound like they have a great solution for it.
So far a manuall installation of missing python modules is the only solution but on spk package updates, all those manual installations are lost.
some early ideas:
create an additional requirements file that can be manually updated by users and that is used to install additional dependencies at service start (and that will survive package updates)
create a tool that watches the homeassistant log files and calls pip to install missing modules on the fly
ask homeassistant developers to improve the code to automatically (or interactivly) install missing dependencies when adding integrations
I don’t know anything about how spk package updates work so what I’m about to say might not work;
you can call “pip freeze” from a shell to get the list of currently installed dependencies + versions. If you can execute this prior to update installation you can fetch the list of all requirements they installed and reinstall those after the update.
|
Got delayed a bit, just finished trying to install. |
I had to install python module "natsort" by my own to get work one of the "helpers" - I guess it was the "utility meter" or "Riemann sum integral" helper. |
Do we know when this could be merged? |
Is there an updated build container for this? I would normally use the latest container in GHCR but that lacks the rust toolchain. My usual go-to looks like this:
I'm a python guy, but not a rust guy outside of limited cmake-based rust builds I wrapped the build container with a quick rust-equivalent of
(that's a Failed as:
... so there's something else missing in the rust toolchain. @hgy59 if you had to update the build container, can you document it, or have I made a silly error in my repro of building this SPK ? |
I think it is as you say: there is a basic set of dependencies installed, and dependencies of integration are installed as needed. For example, take a look at https://github.com/home-assistant/core/blob/dev/pyproject.toml#L26 ... this might fail on case-by-case with integrations that don't describe dependencies, assuming all servers have certain modules at certain versions. I think it may be important to see which fail specifically. (@hgy59 Your list should probably be an automatic The idea of an extra list of dependencies, or archives to lay into the |
Testing out your latest build. Main errors are: I can resolve that issue manually, but it makes almost every integration receive an HTTP/500 error in the UI. Another issue is - Cannot reload configuration.yaml using Developer Tools - YAML - Restart |
Ok - I think I have resolved my python / installation issues. Issue: Error messages: Then in the HA log: I noticed that Home Assistant user is "sc-homeassistant" Resolution: I was then able to add integrations from the GUI and they would resolve/install their dependencies as required. Two packages I was having issues adding:
Both integrations would return a "config flow" error when attempting to add via the HA GUI, then looking in the logs would give the error around the python user-site |
@davesc63 thank you for looking into this and finding a solution. I will fix the installer. |
@davesc63 installation issue is fixed now (was for DSM < 7) |
@hgy59 Great work! I still cannot restart homeassistant from It hangs, DSM shows homeassistant as stopped and I need to start it from DSM. Haven't got much more info yet |
HA Core has changed. It does not have an option to create a pid-file anymore and you can only start and stop it within the DSM Package Center. |
After trying to add all integrations, Now almost all integrations that can be configured in the Web UI are working (see the updated wiki page The follwing integrationes do not work
IKEA TRÅDFRI runs with the current SynoCommunity Package (v2021.9.7-15) |
8c67209
to
96b5dfd
Compare
Ship it! :) |
- update dependencies - adjust service-setup for command line parameters that are not supported anymore (--pid-file, --daemon) - avoid use of install_python_wheels function, as we want to install whl files from wheelhouse - abort installation when default_config installation failed (fail fast) - increase expected installation time up to 60 minutes (it took 55 min. on a DS115j)
- update requirements (crossenv and pure, remove abi3) - move requirements of default_configuration to requirements-pure.txt - homeassistant core, web and default_config are working without errors - some integrations work already (synology dsm/srm, hue, brother, ipp) - update package icon with higher resolution
- add hacs integration (from archive file) - add pycryptodomex (requirements-abi3.txt) - save/restore pip-cache on package update - fix dependencies
- fix psutil for qoriq (again) - remove duplicate requirements
- multidict<6.0.0,>=5.1.0 required
- package user needs access to created virtual environment
- package user needs access to installed site-packages
- Add requirements-custom.txt for custom requirements that will be reinstalled on package update - add websockets to crossenv reqirements - add pycryptodome
96b5dfd
to
15f9ead
Compare
@th0ma7 the github action fails to build, but my local builds succeed.
Probably related to #5508 ? EDIT:
|
was rustc added to the standard build image? When I tried a while back it wasn’t. |
In #5508 the rust toolchains where removed from the image and should be installed on the fly. I have the same image and it works locally, but probably rustc is installed already in the distrib folder. |
The rust toolchain is now downloaded per arch based on spksrc.tc.mk. I just tested it 2 weeks ago for py310-311 upgrade pr and all was working all right. Perhaps this is only a temporary github networking issue or due to a new commit since then? |
Error from github build log (vim, x64-6.1) when building the maturin wheel with cross/python310:
EDIT: |
@hgy59 Thanks for all the hard work on the update! So far, it's working great, but I have 1 small issue. Every time I restart Home Assistant, it stops the package and I have to log into the Synology and run the Home Assistant Core package manually. |
As I described in https://github.com/SynoCommunity/spksrc/wiki/FAQ-HomeAssistant/ under Trouble shooting, it is not possible to restart Home Assistant in the HA UI anymore. You have to restart it in the DSM Package Center (or on the command line). |
Is IKEA Tradfri broken for good now then? |
In the current package, IKEA Tradfri does not run out of the box. You have to update aiocoap manually (see #5578) In the next package (#5579) I try to fix this. But there is an unresolvable conflict. Actual HA does not support concurrently installation of the |
Ah OK thanks, as long as it's still on the radar ;-) |
HI! Sorry, i have a couple problems after update on my Synology. Some integrations does not work anymore. How can i rollback? |
@hgy59 I'm running into a |
@marcofranssen, I would suggest you open a new issue for this. The template will guide you though what logs and other information should be provided. |
Description
Since we can now build Cryptography wheel with rust, it is time to update homeassistant.
Fixes #4977, fixes #4189, fixes #5469, fixes #5362
Closes #4969, closes #3638, closes #4183, closes #5064
Checklist
all-supported
completed successfullyType of change