Re-add support for ARM images
williamboman opened this issue · 10 comments
As for very long build times - I'm not particularly concerned about this as releases happen so infrequently. We might want to tweak when that particular GitHub action is executed though (they run on every branch & PR atm). I also don't know if we risk eating up some action runner quota by having such a long running action?
I also don't know if we risk eating up some action runner quota by having such a long running action?
GitHub Free accounts include 2,000 minutes/month for GitHub Actions on private repositories. Since this repository is public these usage limits apply:
Job execution time - Each job in a workflow can run for up to 6 hours of execution time. If a job reaches this limit, the job is terminated and fails to complete.
Workflow run time - Each workflow run is limited to 72 hours. If a workflow run reaches this limit, the workflow run is cancelled.
Ah wow that's very generous
When you add back arm versions, please also consider adding arm/v6 for devices like the raspberry pi zero.
In the meanwhile, i built and published an arm/v6 image from your alpine Dockerfile for 4.2.0 to phisch/thelounge. I'll delete it once this is added to the official thelounge/thelounge
.
Oh and arm/v6 builds for the pre-releases fail:
phisch@tower ~/code/thelounge-docker/alpine master ❯ docker buildx build --platform linux/arm/v6 -t phisch/thelounge:4.3.0-pre.4 . --push
[+] Building 1225.3s (7/7) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 602B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/node:lts-alpine 0.5s
=> [internal] load build context 0.0s
=> => transferring context: 42B 0.0s
=> [1/3] FROM docker.io/library/node:lts-alpine@sha256:21b87afa5f267e50b806f696f754b15b37b4118bb0ef722192f27ddff78d8 0.0s
=> => resolve docker.io/library/node:lts-alpine@sha256:21b87afa5f267e50b806f696f754b15b37b4118bb0ef722192f27ddff78d8 0.0s
=> CACHED [2/3] COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh 0.0s
=> ERROR [3/3] RUN apk --update --no-cache add python build-base && yarn --non-interactive --frozen-lockfile 1224.5s
------
> [3/3] RUN apk --update --no-cache add python build-base && yarn --non-interactive --frozen-lockfile global add thelounge@4.3.0-pre.4 && yarn --non-interactive cache clean && apk del python build-base:
#7 0.165 fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/armhf/APKINDEX.tar.gz
#7 1.140 fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/armhf/APKINDEX.tar.gz
#7 1.964 (1/25) Installing binutils (2.33.1-r1)
#7 2.970 (2/25) Installing libmagic (5.37-r1)
#7 3.096 (3/25) Installing file (5.37-r1)
#7 3.121 (4/25) Installing gmp (6.1.2-r1)
#7 3.198 (5/25) Installing isl (0.18-r0)
#7 3.425 (6/25) Installing libgomp (9.3.0-r0)
#7 3.467 (7/25) Installing libatomic (9.3.0-r0)
#7 3.490 (8/25) Installing mpfr4 (4.0.2-r1)
#7 3.570 (9/25) Installing mpc1 (1.1.0-r1)
#7 3.603 (10/25) Installing gcc (9.3.0-r0)
#7 10.10 (11/25) Installing musl-dev (1.1.24-r3)
#7 10.77 (12/25) Installing libc-dev (0.7.2-r0)
#7 10.79 (13/25) Installing g++ (9.3.0-r0)
#7 15.44 (14/25) Installing make (4.2.1-r2)
#7 15.49 (15/25) Installing fortify-headers (1.1-r0)
#7 15.52 (16/25) Installing build-base (0.5-r1)
#7 15.57 (17/25) Installing libbz2 (1.0.8-r1)
#7 15.60 (18/25) Installing expat (2.2.9-r1)
#7 15.64 (19/25) Installing libffi (3.2.1-r6)
#7 15.67 (20/25) Installing gdbm (1.13-r1)
#7 15.71 (21/25) Installing ncurses-terminfo-base (6.1_p20200118-r4)
#7 15.75 (22/25) Installing ncurses-libs (6.1_p20200118-r4)
#7 15.82 (23/25) Installing readline (8.0.1-r0)
#7 15.87 (24/25) Installing sqlite-libs (3.30.1-r2)
#7 16.02 (25/25) Installing python2 (2.7.18-r0)
#7 19.48 Executing busybox-1.31.1-r10.trigger
#7 19.54 OK: 179 MiB in 41 packages
#7 21.43 yarn global v1.22.5
#7 22.03 [1/4] Resolving packages...
#7 28.57 warning thelounge > sqlite3 > node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
#7 30.72 warning thelounge > sqlite3 > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#7 30.87 warning thelounge > sqlite3 > node-gyp > request > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
#7 31.64 warning thelounge > sqlite3 > node-gyp > request > har-validator@5.1.5: this library is no longer supported
#7 33.43 [2/4] Fetching packages...
#7 93.90 [3/4] Linking dependencies...
#7 107.5 [4/4] Building fresh packages...
#7 130.9 error /usr/local/share/.config/yarn/global/node_modules/sharp: Command failed.
#7 130.9 Exit code: 1
#7 130.9 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
#7 130.9 Arguments:
#7 130.9 Directory: /usr/local/share/.config/yarn/global/node_modules/sharp
#7 130.9 Output:
#7 130.9 sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linuxmusl-armv6.tar.br
#7 130.9 sharp: Prebuilt libvips 8.10.6 binaries are not yet available for linuxmusl-armv6
#7 130.9 sharp: Attempting to build from source via node-gyp but this may fail due to the above error
#7 130.9 sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
#7 130.9 gyp info it worked if it ends with ok
#7 130.9 gyp info using node-gyp@5.1.0
#7 130.9 gyp info using node@14.17.1 | linux | arm
#7 130.9 gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
#7 130.9 gyp http GET https://nodejs.org/download/release/v14.17.1/node-v14.17.1-headers.tar.gz
#7 130.9 gyp http 200 https://nodejs.org/download/release/v14.17.1/node-v14.17.1-headers.tar.gz
#7 130.9 gyp http GET https://nodejs.org/download/release/v14.17.1/SHASUMS256.txt
#7 130.9 gyp http 200 https://nodejs.org/download/release/v14.17.1/SHASUMS256.txt
#7 130.9 gyp info spawn /usr/bin/python
#7 130.9 gyp info spawn args [
#7 130.9 gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
#7 130.9 gyp info spawn args 'binding.gyp',
#7 130.9 gyp info spawn args '-f',
#7 130.9 gyp info spawn args 'make',
#7 130.9 gyp info spawn args '-I',
#7 130.9 gyp info spawn args '/usr/local/share/.config/yarn/global/node_modules/sharp/build/config.gypi',
#7 130.9 gyp info spawn args '-I',
#7 130.9 gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
#7 130.9 gyp info spawn args '-I',
#7 130.9 gyp info spawn args '/root/.cache/node-gyp/14.17.1/include/node/common.gypi',
#7 130.9 gyp info spawn args '-Dlibrary=shared_library',
#7 130.9 gyp info spawn args '-Dvisibility=default',
#7 130.9 gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/14.17.1',
#7 130.9 gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
#7 130.9 gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/14.17.1/<(target_arch)/node.lib',
#7 130.9 gyp info spawn args '-Dmodule_root_dir=/usr/local/share/.config/yarn/global/node_modules/sharp',
#7 130.9 gyp info spawn args '-Dnode_engine=v8',
#7 130.9 gyp info spawn args '--depth=.',
#7 130.9 gyp info spawn args '--no-parallel',
#7 130.9 gyp info spawn args '--generator-output',
#7 130.9 gyp info spawn args 'build',
#7 130.9 gyp info spawn args '-Goutput_dir=.'
#7 130.9 gyp info spawn args ]
#7 130.9 gyp info spawn make
#7 130.9 gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#7 130.9 make: Entering directory '/usr/local/share/.config/yarn/global/node_modules/sharp/build'
#7 130.9 CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
#7 130.9 AR(target) Release/obj.target/../node-addon-api/nothing.a
#7 130.9 COPY Release/nothing.a
#7 130.9 TOUCH Release/obj.target/libvips-cpp.stamp
#7 130.9 CXX(target) Release/obj.target/sharp/src/common.o
#7 130.9 ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
#7 130.9 24 | #include <vips/vips8>
#7 130.9 | ^~~~~~~~~~~~
#7 130.9 compilation terminated.
#7 130.9 make: *** [sharp.target.mk:138: Release/obj.target/sharp/src/common.o] Error 1
#7 130.9 make: Leaving directory '/usr/local/share/.config/yarn/global/node_modules/sharp/build'
#7 130.9 gyp ERR! build error
#7 130.9 gyp ERR! stack Error: `make` failed with exit code: 2
#7 130.9 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
#7 130.9 gyp ERR! stack at ChildProcess.emit (events.js:375:28)
#7 130.9 gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
#7 130.9 gyp ERR! System Linux 5.12.14-arch1-1
#7 130.9 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#7 130.9 gyp ERR! cwd /usr/local/share/.config/yarn/global/node_modules/sharp
#7 130.9 gyp ERR! node -v v14.17.1
#7 130.9 gyp ERR! node-gyp -v v5.1.0
#7 130.9 gyp ERR! not ok
#7 130.9 info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
------
Dockerfile:19
--------------------
18 | ARG THELOUNGE_VERSION=4.3.0-pre.4
19 | >>> RUN apk --update --no-cache add python build-base && \
20 | >>> yarn --non-interactive --frozen-lockfile global add thelounge@${THELOUNGE_VERSION} && \
21 | >>> yarn --non-interactive cache clean && \
22 | >>> apk del python build-base
23 |
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk --update --no-cache add python build-base && yarn --non-interactive --frozen-lockfile global add thelounge@${THELOUNGE_VERSION} && yarn --non-interactive cache clean && apk del python build-base]: exit code: 1
Oh and arm/v6 builds for the pre-releases fail
That's the same issue faced when building for armv7 musllibc due to the added dependency of sharp
in thelounge/thelounge@3a6ac4e. lovell/sharp-libvips does not provide precompiled binaries for these architecture/libc combinations.
If a solution for the armv7 builds is found a similar or the same solution might be applied for armv6.
@williamboman looks like libvips also supports arm/v6 now, would you mind also adding arm/v6 to this image as well?
@williamboman looks like libvips also supports arm/v6 now, would you mind also adding arm/v6 to this image as well?
The dependency on sharp and libvips was reverted in thelounge/thelounge#4287. It's not needed anymore. :)
There'll need to be some changes to the build workflow to only do armv6 for the alpine image, happy to receive a PR! I made a low effort attempt at adding it in #125 by building armv6 for all images, but that didn't turn out very successful haha
I don't know enough about docker buildx to do this without a significant amount of reading into it and setting this up locally.
But my approach would probably be something like splitting up PLATFORMS
into two separate ones (https://github.com/thelounge/thelounge-docker/blob/master/.github/workflows/docker-image-push.yml#L33)
PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7
PLATFORMS_ALPINE: linux/arm/v6
And run docker buildx
twice, once for default, once for alpine.
But i am not sure what the current build task refers to when it uses matrix.dockerfile
, I would expect this to be the list of dockerfiles that is defined at the beginning of the workflow, but that would not make any sense in the script. Does it only pass in one of them?