After using HA in supervised mode for a few years, I am switching to HA OS. My home automation is mainly managed by NodeRed and uses a CAN bus.
For this, I have to install multiple linux and nodejs packages.
In a first attempt, I added the linux and nodered packages in the Nodered docker configuration (system_packages and npm_packages). The problem is that the docker startup fails many times (error 137) before it starts.
A second solution would be to install the packages in the docker container and then remake an image (so as not to lose everything if the docker restarts) but what about docker updates by HA ?
Moreover, is it possible to change the docker launch command line (idem, without losing the modifications during updates or backup) ?
Not certain what HW you are on, but could you not consider running things in a hypervisor? If you are mostly Node-RED a VM based installation should make many things easier to handle, including updates.
For your system packages, are you sure they are part of Alpine (for ARM)
Secondly, if I google on error 137 it points me to the OOM killer, killing processes taking up too much memory. Do you know how much memory ypur packages should be consuming and which Pi4 edition do you have?
Yes, the packages is part of Alpine, I tested the installation of the packages “by hand” before putting them in the configuration.
Indeed, the error corresponds to the lack of memory, that’s why I look for the docker command line because there can be a memory limitation for each docker.
I will try to monitor the memory consumption of the rpi (host) during the docker launch.
As I said, the docker ends up starting correctly after a lot of reboot (about 20mins)
I just did the test by looking at the memory consumption of the docker and that of the complete system, during the installation, there are 500Mb taken by the docker and I do not exceed 64% of the total memory consumption of the Rpi, so it is not a general limitation, perhaps a limitation specific to the docker but I do not know where it can be ?
A long time ago, I moved NR to its own pi3 because it was too slow running on the same pi3 as HA. My HA now runs on a pi4 (bought while price was reasonable), but NR is still on a separate pi3.
I use IOTstack to help install NR and HA (container version).
Obviously it would take some work to split off NR and run it by itself, but its something to think about.
IOTstack also helps with updating HA and other whatever other programs you use it to install.
I am making progress in my investigations. If I understand well the functioning of docker, we define a command that it will execute to know if the container is ok. In the NodeRed container, the command is (line 61 of the Dockerfile):
This command will look for the NodeRed home page and if there is a response, then everything is fine.
The problem in my case is that the initial installation takes time and NodeRed launches later than expected or Docker will check if everything is fine too early (with the command) and as it has a negative response, it shuts down the container while the launch is not finished.
So, the question is how to tell docker that everything is ok during the install ?
I understand that the speed can accelerate the launch of the docker a bit, however, I find that it is not a solution to hope to accelerate the launch enough before docker asks for the health of the docker and the kill if it is not finished.
Especially since the installation depends on the speed of the network or other parameters.