NebraLtd / hm-config

Helium Miner Config Container
https://nebra.io/hnt
MIT License
12 stars 20 forks source link

radxa libmraa package not working on bullseye #227

Closed shawaj closed 1 year ago

shawaj commented 1 year ago

See https://github.com/NebraLtd/helium-miner-software/pull/581#issuecomment-1385464535

shawaj commented 1 year ago

I can confirm I tested with it rolled back and it works fine on this release https://github.com/NebraLtd/helium-miner-software/pull/583

shawaj commented 1 year ago

Python module not importing: https://github.com/radxa/apt/issues/51#issuecomment-1385616820

shawaj commented 1 year ago

@NebraLtd/developers could it be that the package is loading in the wrong place?

https://github.com/NebraLtd/hm-config/blob/f6e894fe91fdb6884cf086e6c5887a0c327d388a/Dockerfile#L84

shawaj commented 1 year ago

Bullseye standard python3 is 3.9

https://packages.debian.org/bullseye/python3

Buster was 3.7

https://packages.debian.org/buster/python3

shawaj commented 1 year ago

Hmm that still didn't seem to fix it @KevinWassermann94 so I'm out of ideas now

shawaj commented 1 year ago

Actually it looks like Balena are using 3.11.1 as standard here (line42)... https://hub.docker.com/layers/balenalib/raspberry-pi-debian-python/bullseye-run-20221215/images/sha256-ef1449f6388354cc9381d0a76941b6dcd43210cd4e5c19dabc0774fdd4047eb5?context=explore

shawaj commented 1 year ago

Possibly needs to just be python3 in path..

https://hub.docker.com/layers/balenalib/raspberry-pi-debian-python/bullseye-run-20221215/images/sha256-ef1449f6388354cc9381d0a76941b6dcd43210cd4e5c19dabc0774fdd4047eb5?context=explore

Line 47... ENV PYTHONPATH=/usr/lib/python3/dist-packages:

KevinWassermann94 commented 1 year ago

@MuratUrsavas @pritamghanghas Can you have a look at this and we'll discuss tomorrow?

shawaj commented 1 year ago

Looking at it - I think that the libmraa is not built for python3.11 only python 2.7 and 3.9. Might be wrong but we are missing files

https://github.com/radxa/apt/issues/51#issuecomment-1385801756

shawaj commented 1 year ago

I can confirm that if I pull the mraa.py and _mraa.so files out of the deb package in the repo and put them in /usr/local/lib/python3.9/dist-packages it works correctly.

So seems package is built incorrectly. Have reported on radxa repo https://github.com/radxa/apt/issues/51#issuecomment-1386325669

pritamghanghas commented 1 year ago

This problem is different but just for information.

I have faced problems in the past due to balena docker base image having too recent a python. It seems they go out of their way to install latest python3 in their base images. That is why we use venv and install upstream python and use venv even though newer python is already there in the base image.

If we use balena python version, some large pip packages resort to compiling from source taking a lot of time and sometimes even failing. If it doesn't break anything, moving away to non balena debian image will solve lot of that.

shawaj commented 1 year ago

@pritamghanghas yep that seems to be the case here too. Bullseye standard python is 3.9.2. Balena are using 3.11.1 in this image.

The venv makes it back to 3.9.2 but the dist-packages for mraa aren't getting installed properly.

If it doesn't break anything, moving away to non balena debian image will solve lot of that.

Potentially a good option although we should be careful. Actually we were originally using some non Balena ones. The reason we moved to the Balena ones was because of tools like install_packages and stuff that the have in them as well as some other stuff (they are well tested on balenaOS etc). I think it was Marvin or Viktor that suggested it... I'll see if I can find the discussion.

EDIT: