processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.1k stars 1.51k forks source link

ARM builds #3762

Closed psjbeisler closed 2 years ago

psjbeisler commented 2 years ago

Is there a reason ARM builds are no longer provided? Last official builds were 19.08 and all the distro repos I find have stopped supporting their own package builds since 20.07 or so. Even the Docker images are only amd64 builds... (An aarch64 docker image at the very least would help.)

There seems to be no way to run a recent version of Ejabberd on ARM 32/64 without building it manually.

licaon-kter commented 2 years ago

Raspberry Pi Raspbian repo has 21.01 for armv6.

Debian itself has 21.01 in stable and 21.12 in stable backports for arm64.

All the "other" distros? Ask them to update.

badlop commented 2 years ago

Is there a reason ARM builds are no longer provided? Last official builds were 19.08

For the binary installers published in https://www.process-one.net/en/ejabberd/downloads/

I can imagine two reasons:

Even the Docker images are only amd64 builds...

Right. The Docker images at https://hub.docker.com/r/ejabberd/ecs are a one-man effort, it only targeted amd64 since the beginning, and I guess he found not enought motivation to investigate how to support other architectures.

BTW, check https://hub.docker.com/r/ballerburg9005/docker-ejabberd-ecs-official-arm

There seems to be no way to run a recent version of Ejabberd on ARM 32/64 without building it manually.

More or less.

If you find any problem compiling, please report it in an issue, and let's try to fix it. Or if it requires specific instructions, let's document them in the README and documentation site.

badlop commented 2 years ago

I was able to compile and start ejabberd in a Samsung Galaxy with aarch64 with no special instructions, just install Termux from F-Droid or from their website (not the old version from Google Play), and then:

pkg upgrade
pkg install elixir clang libyaml autoconf automake
git clone https://github.com/processone/ejabberd
cd ejabberd
./autogen.sh
./configure --with-rebar=mix
make
make dev
_build/dev/rel/ejabberd/bin/ejabberdctl live
psjbeisler commented 2 years ago

While I did miss Debian, the end point is to not depend on package maintainers or 3rd parties to redistribute.

So, is the root cause;

What needs done to provide them going forward?

badlop commented 2 years ago

Right, those two, and you forgot another: low download numbers back when ARM were available, which implies people with those architectures prefer to compile from sources, or there are few interested/need. Higher demand would put motivation into investing time and resources in investigating how to achieve ARM binary packages in some automated way, test, etc, and actually implement it, and do it for every release.

The real questions here are:

(An aarch64 docker image at the very least would help.)

Would help... what exactly? Would help you? In what way? Would help to spread XMPP usage? ejabberd usage?

There seems to be no way to run a recent version of Ejabberd on ARM 32/64 without building it manually.

Right. And? Are you having technical trouble compiling ejabberd from source code? Or is it a logistic trouble? Or laziness? Or is it some moral trouble?

the end point is to not depend on package maintainers or 3rd parties to redistribute.

That's your end point. Why do you want to avoid 3rd party packagers? When you want to use a program, do you only use binary packages from the original authors? What do you do when they don't provide it themselves? Don't you trust the Debian packagers?

psjbeisler commented 2 years ago

Its not about trusting packagers, its about official support and timing of releases. Shouldn't jabber usage be easier to install and more inclusive (Snikket got funding to do exactly this) to promote adoption, this is purposely exclusive at this point when the question is "how to move forward". Its unrealistic (and self harmful) to think;

psjbeisler commented 2 years ago

https://github.com/processone/docker-ejabberd/issues/71

licaon-kter commented 2 years ago

RaspberryPi is Debian (mostly) so that's covered already.

Snikket has ARM docker images.

psjbeisler commented 2 years ago

So use an out of band build or different software entirely instead of acknowledging the need for ARM builds in general... I can automate the build of the docker-ejabberd repo at this point... its just a shame it cant/wont be up-streamed

badlop commented 2 years ago

I can automate the build of the docker-ejabberd repo at this point

Using ballerburg9005's solution, or you developed an alternative?

psjbeisler commented 2 years ago

a direct unmodified 1:1 build. i don't need the captcha (ballerburg9005 added). plus, once the base image is built, it can always be rebuilt or extend back in from there

badlop commented 2 years ago

a direct unmodified 1:1 build.

That's interesting!

What needs done to provide them going forward?

If you can provide a complete, detailed, and precise guide to produce such docker image in a desktop computer, or server, or in github actions, I could try it, and try to get it adopted in the docker repository. And hopefully other people will test it.

badlop commented 2 years ago

BTW, Holger now publishes x64 and arm64 binary builds at https://ejabberd.messaging.one/

badlop commented 2 years ago

a direct unmodified 1:1 build.

That catched my attention, and now I was experimenting with buildx, following the documentation at https://docs.docker.com/buildx/working-with-buildx/

But I found big troubles at the very beginning: just doing the very first step: build the ejabberd/mix image complained about bash and ca-certificates:

``` $ sudo docker buildx build --push --platform linux/arm64 --progress plain -t badlop/ejtestmix:1707 . #2 [internal] load .dockerignore #2 transferring context: #2 ... #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 597B done #1 DONE 0.2s #2 [internal] load .dockerignore #2 transferring context: 2B done #2 DONE 0.2s #3 [internal] load metadata for docker.io/library/alpine:3.14 #3 ... #4 [auth] library/alpine:pull token for registry-1.docker.io #4 DONE 0.0s #3 [internal] load metadata for docker.io/library/alpine:3.14 #3 DONE 2.2s #5 [1/3] FROM docker.io/library/alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2 #5 resolve docker.io/library/alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2 0.1s done #5 DONE 0.1s #5 [1/3] FROM docker.io/library/alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2 #5 DONE 0.4s #5 [1/3] FROM docker.io/library/alpine:3.14@sha256:635f0aa53d99017b38d1a0aa5b2082f7812b03e3cdb299103fe77b5c8a07f1d2 #5 sha256:be307f383ecc62b27a29b599c3fc9d3129693a798e7fcce614f09174cfe2d354 0B / 2.72MB 0.2s #5 sha256:be307f383ecc62b27a29b599c3fc9d3129693a798e7fcce614f09174cfe2d354 2.72MB / 2.72MB 0.3s #5 sha256:be307f383ecc62b27a29b599c3fc9d3129693a798e7fcce614f09174cfe2d354 2.72MB / 2.72MB 0.4s done #5 extracting sha256:be307f383ecc62b27a29b599c3fc9d3129693a798e7fcce614f09174cfe2d354 #5 extracting sha256:be307f383ecc62b27a29b599c3fc9d3129693a798e7fcce614f09174cfe2d354 0.3s done #5 DONE 0.8s #6 [2/3] RUN apk upgrade --update musl && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev gd-dev jpeg-dev libpng-dev libwebp-dev autoconf automake bash elixir erlang-reltool erlang-odbc file curl && rm -rf /var/cache/apk/* #6 0.267 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz #6 1.115 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz #6 2.237 OK: 5 MiB in 14 packages #6 3.390 (1/68) Installing m4 (1.4.18-r2) #6 3.834 (2/68) Installing libbz2 (1.0.8-r1) #6 3.886 (3/68) Installing perl (5.32.1-r0) #6 5.474 (4/68) Installing autoconf (2.71-r0) #6 5.604 (5/68) Installing automake (1.16.3-r0) #6 5.723 (6/68) Installing ncurses-terminfo-base (6.2_p20210612-r0) #6 5.769 (7/68) Installing ncurses-libs (6.2_p20210612-r0) #6 5.834 (8/68) Installing readline (8.1.0-r0) #6 5.895 (9/68) Installing bash (5.1.4-r0) #6 5.999 Executing bash-5.1.4-r0.post-install #6 6.004 ERROR: bash-5.1.4-r0.post-install: script exited with error 1 #6 6.005 (10/68) Installing libgcc (10.3.1_git20210424-r2) #6 6.361 (11/68) Installing libstdc++ (10.3.1_git20210424-r2) ... #6 24.34 (68/68) Installing yaml-dev (0.2.5-r0) #6 24.53 Executing busybox-1.33.1-r6.trigger #6 24.58 Executing ca-certificates-20211220-r0.trigger #6 24.58 ERROR: ca-certificates-20211220-r0.trigger: script exited with error 1 #6 24.67 1 error; 338 MiB in 82 packages ------ Dockerfile:6 -------------------- 5 | # Install required dependencies 6 | >>> RUN apk upgrade --update musl \ 7 | >>> && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev \ 8 | >>> gd-dev jpeg-dev libpng-dev libwebp-dev autoconf automake bash \ 9 | >>> elixir erlang-reltool erlang-odbc file curl \ 10 | >>> && rm -rf /var/cache/apk/* 11 | -------------------- error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c apk upgrade --update musl && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev gd-dev jpeg-dev libpng-dev libwebp-dev autoconf automake bash elixir erlang-reltool erlang-odbc file curl && rm -rf /var/cache/apk/*" did not complete successfully: exit code: 1 ```

So I removed bash from the install step, then it advances further, but crashes when running "mix local.hex":

``` #5 23.58 (67/67) Installing yaml-dev (0.2.5-r0) #5 23.63 Executing busybox-1.33.1-r6.trigger #5 23.69 Executing ca-certificates-20211220-r0.trigger #5 23.70 ERROR: ca-certificates-20211220-r0.trigger: script exited with error 1 #5 23.72 OK: 337 MiB in 81 packages #5 DONE 30.7s #6 [3/3] RUN mix local.hex --force && mix local.rebar --force #6 ERROR: process "/dev/.buildkit_qemu_emulator /bin/sh -c mix local.hex --force && mix local.rebar --force" did not complete successfully: exit code: 1 ------ > [3/3] RUN mix local.hex --force && mix local.rebar --force: ------ Dockerfile:13 -------------------- 12 | # Setup runtime environment 13 | >>> RUN mix local.hex --force \ 14 | >>> && mix local.rebar --force 15 | -------------------- error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c mix local.hex --force && mix local.rebar --force" did not complete successfully: exit code: 1 ```