ARM 32bit container
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 https://github.com/TomBursch/kitchenowl/discussions/2#discussioncomment-3819740
@StanDaMan0505 I guess you're using a 32bit OS on your pi? There is an ARM64 version
I'm also planning to install it on my Raspberry Pi 3B+. 32 bits OS, armv7l to be precise.
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.
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.
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
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)
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...
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
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.
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 :-)
[+] 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
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.
I had to add the following packages in addition to libxml2: libxslt-dev libopenblas-dev libgomp1.
Are there any news regarding this issue? I would be very interested in arm/v7 support and I noticed that a PR (https://github.com/TomBursch/kitchenowl-backend/pull/13) already exists :slightly_smiling_face: