From 3e9356228129ba2b5d72239bf192b2844e244570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20=C5=9Awi=C4=99to=C5=84?= Date: Thu, 13 Jul 2023 12:44:38 +0200 Subject: [PATCH] ACS-5039 Transformers multi-arch support (#837) --- .github/workflows/ci.yml | 4 ++ engines/aio/Dockerfile | 28 +++++++----- engines/aio/pom.xml | 37 ++++++++++++++- engines/example/pom.xml | 82 +++++++++++++++++++++++++++++++++- engines/imagemagick/Dockerfile | 12 ++--- engines/imagemagick/pom.xml | 37 ++++++++++++++- engines/libreoffice/Dockerfile | 20 ++++++--- engines/libreoffice/pom.xml | 37 ++++++++++++++- engines/misc/pom.xml | 41 +++++++++++++++-- engines/pdfrenderer/pom.xml | 37 ++++++++++++++- engines/tika/pom.xml | 37 ++++++++++++++- pom.xml | 1 + 12 files changed, 342 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d83d8cc..149cfe42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,6 +158,10 @@ jobs: persist-credentials: false - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.34.0 - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.34.0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: linux/amd64,linux/arm64 - name: "Login to Docker Hub" uses: docker/login-action@v2.1.0 with: diff --git a/engines/aio/Dockerfile b/engines/aio/Dockerfile index 69be9b47..4ecab03e 100644 --- a/engines/aio/Dockerfile +++ b/engines/aio/Dockerfile @@ -12,12 +12,12 @@ ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION} ARG EXIFTOOL_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/exiftool/image-exiftool/${EXIFTOOL_VERSION}/image-exiftool-${EXIFTOOL_VERSION}.tgz ARG IMAGEMAGICK_VERSION=7.1.0-16 -ENV IMAGEMAGICK_RPM_URL=https://github.com/Alfresco/imagemagick-build/releases/download/v${IMAGEMAGICK_VERSION}/ImageMagick-${IMAGEMAGICK_VERSION}.x86_64.rpm -ENV IMAGEMAGICK_LIB_RPM_URL=https://github.com/Alfresco/imagemagick-build/releases/download/v${IMAGEMAGICK_VERSION}/ImageMagick-libs-${IMAGEMAGICK_VERSION}.x86_64.rpm +ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}-ci-3/imagemagick-distribution-${IMAGEMAGICK_VERSION}-ci-3 ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ARG LIBREOFFICE_VERSION=7.2.5 ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/${LIBREOFFICE_VERSION}/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz +ENV LIBREOFFICE_ARM64_RPM_URL=https://dl.rockylinux.org/pub/rocky/8.8/devel/aarch64/os/Packages/l/libreoffice-core-6.4.7.2-13.el8.aarch64.rpm ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz @@ -34,15 +34,23 @@ COPY target/${env.project_artifactId}-${env.project_version}.jar /usr/bin #removing perl-ExtUtils-MakeMaker cascades to remove exiftools RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \ yum install -y $IMAGEMAGICK_DEP_RPM_URL && \ - yum install -y $IMAGEMAGICK_LIB_RPM_URL $IMAGEMAGICK_RPM_URL && \ - rpm -e --nodeps libgs && \ + if [ "$(uname -m)" = "x86_64" ]; then \ + yum install -y ${IMAGEMAGICK_RPM_URL}-el8.rpm ${IMAGEMAGICK_RPM_URL}-el8-libs.rpm; \ + else \ + yum install -y ${IMAGEMAGICK_RPM_URL}-arm64.rpm ${IMAGEMAGICK_RPM_URL}-arm64-libs.rpm; \ + fi && \ yum install -y cairo cups-libs libSM libGLU && \ - test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ - ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ - curl -s -S $LIBREOFFICE_RPM_URL -o libreoffice-dist-linux.gz && \ - tar xzf libreoffice-dist-linux.gz && \ - yum localinstall -y LibreOffice*/RPMS/*.rpm && \ - rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm && \ + if [ "$(uname -m)" = "x86_64" ]; then \ + test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ + ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ + curl -s -S $LIBREOFFICE_RPM_URL -o libreoffice-dist-linux.gz && \ + tar xzf libreoffice-dist-linux.gz && \ + yum localinstall -y LibreOffice*/RPMS/*.rpm && \ + rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm; \ + else \ + yum install -y $LIBREOFFICE_ARM64_RPM_URL && \ + update-alternatives --set java java-17-openjdk.aarch64; \ + fi && \ curl -s -S $ALFRESCO_PDF_RENDERER_LIB_RPM_URL -o alfresco-pdf-renderer-linux.tgz && \ tar xf alfresco-pdf-renderer-linux.tgz -C /usr/bin && \ rm -f alfresco-pdf-renderer-linux.tgz && \ diff --git a/engines/aio/pom.xml b/engines/aio/pom.xml index 41d3a86c..f68f748d 100644 --- a/engines/aio/pom.xml +++ b/engines/aio/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-transform-core-aio - quay.io ${project.artifactId} @@ -339,6 +338,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -349,6 +357,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -392,6 +409,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -402,6 +428,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/example/pom.xml b/engines/example/pom.xml index 7d0de3f5..aaa4cea8 100644 --- a/engines/example/pom.xml +++ b/engines/example/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-transform-example - quay.io ${project.artifactId} @@ -199,6 +198,51 @@ + + push-docker-images + + + + + io.fabric8 + docker-maven-plugin + + true + + + + ${image.name}:${image.tag} + ${image.registry} + + + + linux/amd64 + linux/arm64 + + + false + + + ${project.basedir} + + + + + + + build-push-image + install + + build + push + + + + + + + + internal @@ -213,6 +257,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -223,6 +276,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -266,6 +328,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -276,6 +347,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/imagemagick/Dockerfile b/engines/imagemagick/Dockerfile index d9866b44..b22abdf6 100644 --- a/engines/imagemagick/Dockerfile +++ b/engines/imagemagick/Dockerfile @@ -7,8 +7,7 @@ FROM alfresco/alfresco-base-java:jre17-rockylinux8-202306121108 # For other ImageMagick versions please look at https://github.com/Alfresco/imagemagick-build tags ARG IMAGEMAGICK_VERSION=7.1.0-16 -ENV IMAGEMAGICK_RPM_URL=https://github.com/Alfresco/imagemagick-build/releases/download/v${IMAGEMAGICK_VERSION}/ImageMagick-${IMAGEMAGICK_VERSION}.x86_64.rpm -ENV IMAGEMAGICK_LIB_RPM_URL=https://github.com/Alfresco/imagemagick-build/releases/download/v${IMAGEMAGICK_VERSION}/ImageMagick-libs-${IMAGEMAGICK_VERSION}.x86_64.rpm +ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}-ci-3/imagemagick-distribution-${IMAGEMAGICK_VERSION}-ci-3 ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ENV JAVA_OPTS="" @@ -22,9 +21,12 @@ COPY target/${env.project_artifactId}-${env.project_version}.jar /usr/bin RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \ yum install -y $IMAGEMAGICK_DEP_RPM_URL && \ - yum install -y $IMAGEMAGICK_LIB_RPM_URL $IMAGEMAGICK_RPM_URL && \ - yum clean all && \ - rpm -e --nodeps libgs + if [ "$(uname -m)" = "x86_64" ]; then \ + yum install -y ${IMAGEMAGICK_RPM_URL}-el8.rpm ${IMAGEMAGICK_RPM_URL}-el8-libs.rpm; \ + else \ + yum install -y ${IMAGEMAGICK_RPM_URL}-arm64.rpm ${IMAGEMAGICK_RPM_URL}-arm64-libs.rpm; \ + fi && \ + yum clean all ADD target/generated-resources/licenses /licenses ADD target/generated-resources/licenses.xml /licenses/ diff --git a/engines/imagemagick/pom.xml b/engines/imagemagick/pom.xml index 65026ab5..d83a6157 100644 --- a/engines/imagemagick/pom.xml +++ b/engines/imagemagick/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-imagemagick - quay.io ${project.artifactId} @@ -205,6 +204,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -215,6 +223,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -258,6 +275,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -268,6 +294,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/libreoffice/Dockerfile b/engines/libreoffice/Dockerfile index 9aff2534..74c4ec97 100644 --- a/engines/libreoffice/Dockerfile +++ b/engines/libreoffice/Dockerfile @@ -7,6 +7,7 @@ FROM alfresco/alfresco-base-java:jre17-rockylinux8-202306121108 ARG LIBREOFFICE_VERSION=7.2.5 ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/${LIBREOFFICE_VERSION}/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz +ENV LIBREOFFICE_ARM64_RPM_URL=https://dl.rockylinux.org/pub/rocky/8.8/devel/aarch64/os/Packages/l/libreoffice-core-6.4.7.2-13.el8.aarch64.rpm ENV JAVA_OPTS="" # Set default user information @@ -19,13 +20,18 @@ COPY target/${env.project_artifactId}-${env.project_version}.jar libreoffice-dis RUN ln /${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \ yum install -y cairo cups-libs libSM libGLU && \ - test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ - ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ - curl -s -S $LIBREOFFICE_RPM_URL -o libreoffice-dist-linux.gz && \ - tar xzf libreoffice-dist-linux.gz && \ - yum localinstall -y LibreOffice*/RPMS/*.rpm && \ - rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm && \ - yum clean all + if [ "$(uname -m)" = "x86_64" ]; then \ + test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ + ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ + curl -s -S $LIBREOFFICE_RPM_URL -o libreoffice-dist-linux.gz && \ + tar xzf libreoffice-dist-linux.gz && \ + yum localinstall -y LibreOffice*/RPMS/*.rpm && \ + rm -rf libreoffice-dist-*linux.gz LibreOffice_*_Linux_x86-64_rpm; \ + else \ + yum install -y $LIBREOFFICE_ARM64_RPM_URL && \ + update-alternatives --set java java-17-openjdk.aarch64; \ + fi && \ + yum clean all ADD target/generated-resources/licenses /licenses ADD target/generated-resources/licenses.xml /licenses/ diff --git a/engines/libreoffice/pom.xml b/engines/libreoffice/pom.xml index 833bd93b..6bc8f890 100644 --- a/engines/libreoffice/pom.xml +++ b/engines/libreoffice/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-libreoffice - quay.io ${project.artifactId} @@ -209,6 +208,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -219,6 +227,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -262,6 +279,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -272,6 +298,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/misc/pom.xml b/engines/misc/pom.xml index c2557bcc..6ae0216e 100644 --- a/engines/misc/pom.xml +++ b/engines/misc/pom.xml @@ -12,7 +12,6 @@ - quay.io alfresco/alfresco-transform-misc ${project.artifactId} @@ -154,7 +153,7 @@ - alfresco/alfresco-activemq:5.16.1 + alfresco/alfresco-activemq:5.17.4-jre17-rockylinux8 activemq @@ -163,7 +162,7 @@ 61616:61616 - Apache ActiveMQ 5.16.1 .* started + Apache ActiveMQ 5.* started 500 100 @@ -253,6 +252,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -263,6 +271,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -306,6 +323,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -316,6 +342,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/pdfrenderer/pom.xml b/engines/pdfrenderer/pom.xml index b6c2314c..39875c84 100644 --- a/engines/pdfrenderer/pom.xml +++ b/engines/pdfrenderer/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-pdf-renderer - quay.io ${project.artifactId} @@ -201,6 +200,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -211,6 +219,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -254,6 +271,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -264,6 +290,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/engines/tika/pom.xml b/engines/tika/pom.xml index be8dd37e..ec949a71 100644 --- a/engines/tika/pom.xml +++ b/engines/tika/pom.xml @@ -13,7 +13,6 @@ alfresco/alfresco-tika - quay.io ${project.artifactId} @@ -297,6 +296,15 @@ ${image.name}:${image.tag} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -307,6 +315,15 @@ ${image.name}:${image.tag} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -350,6 +367,15 @@ ${image.name}:${project.version} ${image.registry} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true @@ -360,6 +386,15 @@ ${image.name}:${project.version} + + + linux/amd64 + linux/arm64 + + + false + + ${project.basedir} true diff --git a/pom.xml b/pom.xml index 4aad9e89..2af1e9ad 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,7 @@ 17 latest + quay.io 2.0.26 3.0.1.18 ${project.version}