Skip to content
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

ARM 32bit container #46

Open
TomBursch opened this issue Oct 7, 2022 · 18 comments · Fixed by #62 · May be fixed by TomBursch/kitchenowl-backend#13
Open

ARM 32bit container #46

TomBursch opened this issue Oct 7, 2022 · 18 comments · Fixed by #62 · May be fixed by TomBursch/kitchenowl-backend#13
Labels
enhancement New feature or request

Comments

@TomBursch
Copy link
Owner

Hi, would love to test it on my Raspberry.. But there is no ARM Version so far. Any plans on adding it?

Originally posted by @StanDaMan0505 in #2 (comment)

@TomBursch TomBursch moved this to Next Up in KitchenOwl Project Oct 7, 2022
@TomBursch TomBursch added the enhancement New feature or request label Oct 7, 2022
@TomBursch TomBursch changed the title ARM container ARM 32bit container Oct 7, 2022
@TomBursch
Copy link
Owner Author

@StanDaMan0505 I guess you're using a 32bit OS on your pi? There is an ARM64 version

@Battleman
Copy link

I'm also planning to install it on my Raspberry Pi 3B+. 32 bits OS, armv7l to be precise.

@TomBursch TomBursch moved this from Next Up to In Progress in KitchenOwl Project Oct 13, 2022
@TomBursch TomBursch linked a pull request Oct 13, 2022 that will close this issue
@TomBursch TomBursch moved this from In Progress to Testing in KitchenOwl Project Oct 13, 2022
Repository owner moved this from Testing to Ready for Testing in KitchenOwl Project Oct 13, 2022
@TomBursch TomBursch reopened this Oct 20, 2022
@TomBursch
Copy link
Owner Author

The previous PR added a 32bit image for the front-end. I can't get the backend image to build on 32bit. I will need to do some further experimenting. Not sure if I'll be able to solve this for the next stable release.

@TomBursch TomBursch added the help wanted Extra attention is needed label Oct 28, 2022
@TomBursch
Copy link
Owner Author

I've put some hours into it but can't get it to work. Will leave this open for now. The backend does not build, as some python dependencies have to be build from source apparently. I cannot debug this effectively without waiting more than an hour for the buildx process to complete. The latest build log with arm/v7 enabled can be found here: https://github.com/TomBursch/kitchenowl-backend/actions/runs/3337869487/jobs/5524771229

Maybe someone else who has an arm/v7 device can debug the build process on the device.

@TomBursch TomBursch added the good first issue Good for newcomers label Oct 28, 2022
@titro
Copy link

titro commented Oct 28, 2022

Hey Tom,

tried to build on my RPI4 with:
docker buildx build --platform linux/arm/v7 --no-cache -t kitchenowl .

And it failed because of the missing 32 Bit Support of Flutter.

=> [builder  6/19] RUN git clone https://github.com/flutter/flutter.git -b stable /usr/local/src/flutter                                                                                                                              44.7s
 => ERROR [builder  7/19] RUN flutter config --enable-web                                                                                                                                                                              93.6s
------
 > [builder  7/19] RUN flutter config --enable-web:
#0 0.404    Woah! You appear to be trying to run flutter as root.
#0 0.404    We strongly recommend running the flutter tool without superuser privileges.
#0 0.404   /
#0 0.405 📎
#0 0.531 Downloading Linux arm64 Dart SDK from Flutter engine 3ad69d7be3a7231aab5525db322fc699f098315f...
#0 0.590   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#0 0.593                                  Dload  Upload   Total   Spent    Left  Speed
100  118M  100  118M    0     0  11.2M      0  0:00:10  0:00:10 --:--:-- 11.9M
#0 48.29 Building flutter tool...
#0 48.30 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 48.31 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
#0 53.33 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 53.33 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
#0 58.35 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 58.35 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
#0 63.38 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 63.39 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)
#0 68.41 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 68.41 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)
#0 73.44 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 73.45 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (4 tries left)
#0 78.47 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 78.47 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (3 tries left)
#0 83.51 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 83.51 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (2 tries left)
#0 88.55 /usr/local/src/flutter/bin/internal/shared.sh: line 24: /usr/local/src/flutter/bin/cache/dart-sdk/bin/dart: cannot execute binary file: Exec format error
#0 88.55 Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
#0 93.56 Command 'pub upgrade' still failed after 10 tries, giving up.

As far i know, there is no official 32 bit /armv7 support of flutter, I only found a community project: https://github.com/ardera/flutter-pi

@TomBursch
Copy link
Owner Author

TomBursch commented Oct 28, 2022

Thanks for trying to help! Sorry I think I wasn't clear enough, the front end is not the problem. That builds fine for all systems if the host system is amd64 (through some trickery).

The backend is the problem. Some dependencies are missing (I commented some of them out in the docker file)

@titro
Copy link

titro commented Oct 28, 2022

Oh sry. Understood. I tried the backend and get the same error like you in your pipeline. Luckily this only takes a few moments on the RPi4 until it happened. Will dig into it and see if i can find something out...

@titro
Copy link

titro commented Oct 29, 2022

Ok i could build it :-)
What I did:

  • I activated your uncommented dependencies again
  • I added "autoconf automake" to be able to build the python packages

After that the build process aborted after 2,5h with:

Failed to build bcrypt lxml Pillow

So i tried to put only these packages in the requirements.txt to avoid the long build process.
Pillow needs: zlib1g-dev and libjpeg62-turbo-dev
I added it in the initial apt-get and pip3 install was fine. lxml after that too so i guess lxml needs one or both of zlib1g-dev / libjpeg62-turbo-dev

bcrypt was/is the hardest one. With > 4.0.0 it needs rust >1.56.0 because it says:

Rust 1.48.0 does not match extension requirement >=1.56.0

The problem is:
There is only a 1.48.0 Debian Rust package. After some research i found:

https://www.madebymikal.com/debian-10-buster-bcrypt-pip-install-breakage/

His recommondation was to install it via pip with

# pip3 install -U pip
# apt-get remove python3-pip
# /usr/local/bin/pip3 install -v bcrypt==4.0.0

But that doesn't work for me.
Even adding the Rust installation command in the dockerfile (which is not a good style..) with:

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

does not work. Nothing happened...

So i changed bcrypt to the latest 3 version 3.2.2 version and et voila... Build sucessfull after 10918.1s

Here the complete apt-get block from the dockerfile:

RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        gcc g++ libffi-dev libpcre3-dev build-essential cargo \
         libxml2-dev libxslt-dev cmake gfortran libopenblas-dev liblapack-dev pkg-config ninja-build \
         autoconf automake \
         zlib1g-dev libjpeg62-turbo-dev

So we only need a good solution to update bcrypt to a version >=4

@TomBursch
Copy link
Owner Author

Thanks for all the work! Maybe we could switch to a different image for building the dependencies like ubuntu? That would solve the rust problem. Not sure of the implications when copying the virtual environment in that case though.

@titro
Copy link

titro commented Oct 31, 2022

I think I got it and could manually install rust with the rustup script, not with the debian package (which is the 1.48)

Building the bcrypt 4.0.1 started without the error :-)

So let's see what happened in ~ 3h for the whole build :-)

@titro
Copy link

titro commented Nov 1, 2022

[+] Building 11241.6s (17/17) FINISHED

:-)

Complete changes in the dockerfile:

  • we can remove the cargo when we manually install rust
  • we need curl for downloading rust
  • manual install of rust
RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        gcc g++ libffi-dev libpcre3-dev build-essential \
         libxml2-dev libxslt-dev cmake gfortran libopenblas-dev liblapack-dev pkg-config ninja-build \
         autoconf automake \
         zlib1g-dev libjpeg62-turbo-dev \
		 curl

And for the rust installation (right after the apt-get)

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH=/root/.cargo/bin:$PATH

@TomBursch TomBursch moved this from Ready for Testing to In Progress in KitchenOwl Project Nov 6, 2022
@TomBursch
Copy link
Owner Author

11241.6s

😨

Again, thanks for all the work! I still feel weird about downloading the dependency from the web, but don't really know an alternative.

@TomBursch TomBursch linked a pull request Nov 13, 2022 that will close this issue
@2ip1
Copy link

2ip1 commented Jan 7, 2023

I had to add the following packages in addition to libxml2: libxslt-dev libopenblas-dev libgomp1.

@devmotion
Copy link

Are there any news regarding this issue? I would be very interested in arm/v7 support and I noticed that a PR (TomBursch/kitchenowl-backend#13) already exists 🙂

@lazyw0lf
Copy link

@titro Do you have the built image by any chance? I have issues building it and it seems that the raspberry image is still not in the stable version, so not easy to run. Thanks in advance!

@titro
Copy link

titro commented Nov 15, 2024

Unfortunately not. Dont have any rpi running anymore 😒

@lazyw0lf
Copy link

@titro Ok thanks anyway!

@TomBursch are there any chances for you to compile an ARM32 image for running it on a Raspberry Pi? At the moment I'm having issues using docker buildx and the compilation fails, plus it seems from titro's comments that it takes ages to compile.
Thanks in advance!

@TomBursch
Copy link
Owner Author

Hey, sorry that I've not commented on this further, but I don't have any plans of adding this anytime soon. I don't want the CI to run for multiple hours. Sorry about that.

@TomBursch TomBursch moved this from In Progress to Backlog in KitchenOwl Project Nov 23, 2024
@TomBursch TomBursch removed help wanted Extra attention is needed good first issue Good for newcomers labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
6 participants