Skip to content

Conversation

@lfoppiano
Copy link
Member

@lfoppiano lfoppiano commented Sep 14, 2024

Finally I nailed it!

This PR provide a multi-architecture build for amd64/arm64. I've switched to the eclipse-adoptium-17-jdk/jre but, for the moment, I'm using ubuntu 20.04 (focal) instead of ubuntu 22. For now Is limited to the manual build for the CRF only image.

This requires some tests, here here here the resulting image.

This PR should help to solve #1089, #928, #1014, #1119

Update: At the moment the ARM support for the Deep Learning image is not working natively because there is no linux/arm64 docker image of the base images (even of tensorflow/tensorflow:2.17.0)

@coveralls
Copy link

coveralls commented Sep 20, 2024

Coverage Status

coverage: 40.395% (-0.03%) from 40.421%
when pulling a3c814d on multi-arch-docker-image
into f7596b3 on master.

@lfoppiano lfoppiano marked this pull request as draft November 20, 2024 16:27
@heijligers
Copy link

I'm getting

rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2

when trying to run on macos m1

@lfoppiano
Copy link
Member Author

@heijligers which image did you try?

This one was correctly built with multi arch and arm support: lfoppiano/grobid:latest-crf-multi-arch but I did not manage to get it to work in a stable way.

My next step was to try to solve this issue with spawning process by looking on a way to have a conditional decision in the Dockerfile

Any help is welcome for this issue 🙂

@AaronNGray
Copy link

I am currently working on this for the default CRF Docker (Docker.crf) .

This needs work :-

  • ARM64 builds of a number of libraries
  • generalizing for different architectures
  • releases implementing for all the various sub project repos involved

There seems a number of libraries involved :-

tini

https://github.com/krallin/tini
There is a current release of tini for ARM64 :-
https://github.com/krallin/tini/releases/download/v0.19.0/tini-arm64
I have tried this and it works.

pdfalto

https://github.com/kermitt2/pdfalto
This builds fine on x64, and armhf, but has a compile overload call issue with ICU C++.
#1230 (comment)

libwapiti

https://github.com/kermitt2/wapiti

libcrfpp

https://github.com/taku910/crfpp/

libjep

https://github.com/ninia/jep
libjep is a library for Embed Python in Java it involved JNI. This potentially is more complex depending upon the ARM64 JNI support.

I will update this comment as a tracking comment as I make progress.

@AaronNGray
Copy link

@lfoppiano It seems the way to deal with multi platform and multi architecture OS/ARCH builds is with build and buildx :-

docker build --platform linux/amd64,linux/arm64 -t */*:* .
docker buildx build \
--push \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ --tag <username>/<repo>:<tag> .

https://github.com/docker/buildx?tab=readme-ov-file#building-multi-platform-images

This should work across multiple docker images :-

https://github.com/AaronNGray/docker-arch-test

@lfoppiano
Copy link
Member Author

@AaronNGray yes, this is what I believe I did to build the image with github actions, however I did not succeed in having a running docker image for Apple M1.

@lfoppiano lfoppiano self-assigned this Jan 28, 2025
@lfoppiano lfoppiano modified the milestones: 0.8.2, 0.9.0 Feb 16, 2025
@lfoppiano lfoppiano force-pushed the multi-arch-docker-image branch 2 times, most recently from a2d0283 to 49e9166 Compare May 22, 2025 10:07
@AaronNGray
Copy link

Good going. I posted some stuff to check regarding ABI's and compilers on Grobid-core Discord, it maybe obvious but may need checking.

@lfoppiano lfoppiano force-pushed the multi-arch-docker-image branch 2 times, most recently from 9cb10e5 to 9a60975 Compare May 26, 2025 19:34
@lfoppiano lfoppiano changed the title Docker build for multi-architecture amd/arm Support for ARM, updated PDFAlto, Docker multi-architecture build May 28, 2025
@lfoppiano lfoppiano force-pushed the multi-arch-docker-image branch from 6777a6a to 933f01c Compare August 8, 2025 14:49
AaronNGray and others added 4 commits August 25, 2025 01:38
…ky-openjdk-24-gradle-8.14.2

Update to Ubuntu Plucky, OpenJDK/JRE 24, and Gradle 8.14.2
# Conflicts:
#	.github/workflows/ci-build-manual-crf.yml
#	.github/workflows/ci-build-unstable.yml
#	Dockerfile.crf
#	Dockerfile.delft
#	build.gradle
#	gradle/wrapper/gradle-wrapper.properties
@coveralls
Copy link

coveralls commented Feb 5, 2026

Pull Request Test Coverage Report for Build 21920119213

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 22 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.06%) to 38.291%

Files with Coverage Reduction New Missed Lines %
org/grobid/core/engines/Segmentation.java 1 43.25%
org/grobid/core/document/Document.java 2 72.67%
org/grobid/core/layout/Block.java 4 68.18%
org/grobid/core/document/BasicStructureBuilder.java 15 29.98%
Totals Coverage Status
Change from base Build 21564556488: 0.06%
Covered Lines: 17274
Relevant Lines: 42503

💛 - Coveralls

@lfoppiano lfoppiano force-pushed the multi-arch-docker-image branch from 1b77d7d to 797d1e9 Compare February 6, 2026 14:45
@AaronNGray
Copy link

macos-13 is no longer supported by GitHub build system.

@lfoppiano
Copy link
Member Author

lfoppiano commented Feb 11, 2026

I know, I've fixed in both pdfalto and wapiti, and here! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants