Closed kpine closed 4 years ago
You like a challenge - Building this without any instructions :)
yeah, the copyConfigDatabase() is a bit weird. Doesn't work under Docker, but works fine on a Native Install.
But because of the compile requirements (I think I added a 3Gb swap file for it to work on some environments - but it fails completely on Windows and I can't find any workaround) I plan to rework this portion of the code very soon.
If you have a rPI, you can try the "testing" tag on docker - That seems to work but consider this WIP right now (when I got it sorted out, I'll commit it to the mqtt branch). The plan is to have docker fully setup everything when starting as you mentioned.
You like a challenge - Building this without any instructions :)
😅 At first I was just trying to update the Dockerfile to copy the config files since I thought they were missing. Ended up going down a QT rabbit hole...
I'm trying this on a Debian VM, which I've purposefully kept slim (2G RAM) but I didn't realize it has zero swap. I'll go ahead and add a swapfile and see how that works.
I’m building on a NanoPI M4 with 4 GB ram and had to add 2G swap for the compile to work.
I plan to switch to binary resource files as these should be less on the build but not sure on the runtime impact yet.
A side goal of all this is to have statically compiled binaries more so for the admin GUI till distributions can ship updated QT versions. (The GUI’s can either connect over the network to Ozwdaemon or open the serial port directly)
Should be fixed with new images but still needs to migrate to QT binary Resource files.
Binary Resources are now used. Closing.
When starting the docker container with an empty config directory, the config database files are not copied over. Eventually the mfs.xml and config files are downloaded, but the string XML files (Localization.xml, NotificationCCTypes.xml) are not, and since they are missing things like notifications are missing their labels.
I noticed there is some code (
copyConfigDatabase()
) that is supposed to initialize the DB using a QT resource file? This function doesn't appear to actually do anything because I don't see any log messages related to the files ("Copying" or "Skipping"). What I see is:I would expect that when the DB files are copied I would see the Copying/Skipping messages in-between "Checking" and "DBPath".
The workaround of course is to download the files yourself, but I would expect that the Docker image at least would include everything to start with, and from the code it seems that is the intent.
I wasn't sure if this part of the code is a WIP still and expected not to work, so I've submitted this issue. I was attempting to build the project myself, but on my system the compiler crashes with an out of memory error when it tries to build the cpp file generated from the qrc file. Any idea how much memory is required to build this?