From 80938b74f8a7e4919abd479a357bbe759896363f Mon Sep 17 00:00:00 2001 From: Johannes Kalmbach Date: Thu, 7 Nov 2024 11:48:34 +0100 Subject: [PATCH] Docker build no tests for ARM (#1599) The cross-compilatiion currently takes more than 6 hours and is then cancelled by GitHub actions. We thus disable the building and execution of unit tests for the ARM64 build. --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd514e1e12..15d7754191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,16 +8,21 @@ RUN apt-get update && apt-get install -y software-properties-common wget && add- RUN wget https://apt.kitware.com/kitware-archive.sh && chmod +x kitware-archive.sh &&./kitware-archive.sh FROM base as builder +ARG TARGETPLATFORM RUN apt-get update && apt-get install -y build-essential cmake libicu-dev tzdata pkg-config uuid-runtime uuid-dev git libjemalloc-dev ninja-build libzstd-dev libssl-dev libboost1.81-dev libboost-program-options1.81-dev libboost-iostreams1.81-dev libboost-url1.81-dev - COPY . /app/ WORKDIR /app/ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /app/build/ -RUN cmake -DCMAKE_BUILD_TYPE=Release -DLOGLEVEL=INFO -DUSE_PARALLEL=true -D_NO_TIMING_TESTS=ON -GNinja .. && ninja -RUN ctest --rerun-failed --output-on-failure +RUN cmake -DCMAKE_BUILD_TYPE=Release -DLOGLEVEL=INFO -DUSE_PARALLEL=true -D_NO_TIMING_TESTS=ON -GNinja .. +# When cross-compiling the container for ARM64, then compiling and running all tests runs into a timeout on GitHub actions, +# so we disable tests for this platform. +# TODO(joka921) re-enable these tests as soon as we can use a native ARM64 platform to compile the docker container. +RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "target is ARM64, don't build tests to avoid timeout"; fi +RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then cmake --build . --target IndexBuilderMain ServerMain; else cmake --build . ; fi +RUN if [ $TARGETPLATFORM = "linux/arm64" ] ; then echo "Skipping tests for ARM64" ; else ctest --rerun-failed --output-on-failure ; fi FROM base as runtime WORKDIR /app