From fd8e2819b4630ed22731e3a0907df4dbe973d905 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 15 Aug 2024 00:55:42 -0500 Subject: [PATCH 1/2] Test with OpenJDK 17 (LTS) --- .github/workflows/ci.yml | 8 +++- docker/Linux-JDK17/Dockerfile | 56 +++++++++++++++++++++++++++ docker/Linux-JDK17/compose.yml | 20 ++++++++++ docker/Windows-JDK17/Dockerfile | 29 ++++++++++++++ docker/Windows-JDK17/Dockerfile-minio | 10 +++++ docker/Windows-JDK17/compose.yml | 18 +++++++++ 6 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 docker/Linux-JDK17/Dockerfile create mode 100644 docker/Linux-JDK17/compose.yml create mode 100644 docker/Windows-JDK17/Dockerfile create mode 100644 docker/Windows-JDK17/Dockerfile-minio create mode 100644 docker/Windows-JDK17/compose.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e07fd191d..a9e4c38f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - java: [jdk11, jdk18, graalvm] + java: [jdk11, jdk17, jdk18, graalvm] fail-fast: false steps: - name: Check out the repository @@ -19,6 +19,9 @@ jobs: - name: Test in Linux JDK 11 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk11' run: docker compose -f docker/Linux-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Linux JDK 17 (LTS) + if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk17' + run: docker compose -f docker/Linux-JDK17/compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux JDK 18 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk18' run: docker compose -f docker/Linux-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe @@ -28,6 +31,9 @@ jobs: - name: Test in Windows JDK 11 if: matrix.os == 'windows-latest' && matrix.java == 'jdk11' run: docker compose -f docker/Windows-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Windows JDK 17 (LTS) + if: matrix.os == 'windows-latest' && matrix.java == 'jdk17' + run: docker compose -f docker/Windows-JDK17/compose.yml up --build --exit-code-from cantaloupe - name: Test in Windows JDK 18 if: matrix.os == 'windows-latest' && matrix.java == 'jdk18' run: docker compose -f docker/Windows-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe diff --git a/docker/Linux-JDK17/Dockerfile b/docker/Linux-JDK17/Dockerfile new file mode 100644 index 000000000..838170a37 --- /dev/null +++ b/docker/Linux-JDK17/Dockerfile @@ -0,0 +1,56 @@ +FROM ubuntu:lunar + +ARG DEBIAN_FRONTEND=noninteractive + +# Install various dependencies: +# * ca-certificates is needed by wget +# * ffmpeg is needed by FfmpegProcessor +# * wget download stuffs in this dockerfile +# * libopenjp2-tools is needed by OpenJpegProcessor +# * All the rest is needed by GrokProcessor +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + ffmpeg \ + wget \ + libopenjp2-tools \ + liblcms2-dev \ + libpng-dev \ + libzstd-dev \ + libtiff-dev \ + libjpeg-dev \ + zlib1g-dev \ + libwebp-dev \ + libimage-exiftool-perl \ + libgrokj2k1 \ + grokj2k-tools \ + adduser \ + openjdk-17-jdk \ + maven \ + && rm -rf /var/lib/apt/lists/* + +# Install TurboJpegProcessor dependencies +RUN mkdir -p /opt/libjpeg-turbo/lib +COPY docker/Linux-JDK11/image_files/libjpeg-turbo/lib64 /opt/libjpeg-turbo/lib + +# Install KakaduNativeProcessor dependencies +COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ + +# A non-root user is needed for some FilesystemSourceTest tests to work. +ARG user=cantaloupe +ARG home=/home/$user +RUN adduser --home $home $user +RUN chown -R $user $home +USER $user +WORKDIR $home + +# Install application dependencies +COPY ./pom.xml pom.xml + +RUN echo "export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" > ~/.bashrc +RUN mvn --quiet dependency:resolve + +# Copy the code +COPY --chown=cantaloupe docker/Linux-JDK11/image_files/test.properties test.properties +COPY --chown=cantaloupe ./src src + +ENTRYPOINT mvn --batch-mode test -Pfreedeps diff --git a/docker/Linux-JDK17/compose.yml b/docker/Linux-JDK17/compose.yml new file mode 100644 index 000000000..ff2b1994b --- /dev/null +++ b/docker/Linux-JDK17/compose.yml @@ -0,0 +1,20 @@ +# +# N.B.: docker compose must be invoked from the project root directory: +# +# docker compose -f path/to/compose.yml up --exit-code-from cantaloupe +# +services: + cantaloupe: + build: + context: ../../ + dockerfile: $PWD/docker/Linux-JDK17/Dockerfile + minio: + image: minio/minio + environment: + MINIO_ACCESS_KEY: MinioUser + MINIO_SECRET_KEY: OpenSesame + hostname: minio + command: server /data + redis: + image: redis:alpine + hostname: redis diff --git a/docker/Windows-JDK17/Dockerfile b/docker/Windows-JDK17/Dockerfile new file mode 100644 index 000000000..f3726f23b --- /dev/null +++ b/docker/Windows-JDK17/Dockerfile @@ -0,0 +1,29 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +ENV chocolateyUseWindowsCompression false + +# Install the Chocolatey package manager, which makes it easier to install +# dependencies. +RUN powershell -Command \ + iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \ + choco feature disable --name showDownloadProgress + +# Install various dependencies +# TODO: openjpeg +RUN choco install -y maven ffmpeg +RUN choco install -y openjdk --version=17.0.2 + +# Install TurboJpegProcessor dependencies TODO: libjpeg-turbo +#RUN mkdir -p /opt/libjpeg-turbo/lib +#COPY docker/Windows10-JDK11/image_files/libjpeg-turbo/lib64 c:\windows\system32 + +# Install KakaduNativeProcessor dependencies +COPY dist/deps/Windows-x86-64/lib/* c:/Windows/System32/ + +# Install application dependencies +COPY pom.xml pom.xml +RUN mvn dependency:resolve + +# Copy the code +COPY docker/Windows-JDK11/image_files/test.properties test.properties +COPY src src diff --git a/docker/Windows-JDK17/Dockerfile-minio b/docker/Windows-JDK17/Dockerfile-minio new file mode 100644 index 000000000..115389668 --- /dev/null +++ b/docker/Windows-JDK17/Dockerfile-minio @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +ENV MINIO_ACCESS_KEY=MinioUser +ENV MINIO_SECRET_KEY=OpenSesame + +RUN curl.exe --output minio.exe --url https://dl.min.io/server/minio/release/windows-amd64/minio.exe + +RUN mkdir c:\data + +CMD minio.exe server --address=:9000 c:\data diff --git a/docker/Windows-JDK17/compose.yml b/docker/Windows-JDK17/compose.yml new file mode 100644 index 000000000..17d58fa5d --- /dev/null +++ b/docker/Windows-JDK17/compose.yml @@ -0,0 +1,18 @@ +# +# N.B.: docker-compose must be invoked from the project root directory: +# +# docker compose -f path/to/compose.yml up --exit-code-from cantaloupe +# +services: + cantaloupe: + build: + context: ../../ + dockerfile: docker/Windows-JDK17/Dockerfile + minio: + build: + context: ../../ + dockerfile: docker/Windows-JDK17/Dockerfile-minio + environment: + MINIO_ACCESS_KEY: MinioUser + MINIO_SECRET_KEY: OpenSesame + hostname: minio From ecded4deea21db8442a88a0be85ecbf1cd621a71 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 15 Aug 2024 10:19:09 -0500 Subject: [PATCH 2/2] Add JDK21 (LTS) to the test matrix --- .github/workflows/ci.yml | 8 +++- docker/Linux-JDK21/Dockerfile | 56 +++++++++++++++++++++++++++ docker/Linux-JDK21/compose.yml | 20 ++++++++++ docker/Windows-JDK21/Dockerfile | 29 ++++++++++++++ docker/Windows-JDK21/Dockerfile-minio | 10 +++++ docker/Windows-JDK21/compose.yml | 18 +++++++++ 6 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 docker/Linux-JDK21/Dockerfile create mode 100644 docker/Linux-JDK21/compose.yml create mode 100644 docker/Windows-JDK21/Dockerfile create mode 100644 docker/Windows-JDK21/Dockerfile-minio create mode 100644 docker/Windows-JDK21/compose.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9e4c38f6..5b7f08dd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - java: [jdk11, jdk17, jdk18, graalvm] + java: [jdk11, jdk17, jdk18, jdk21, graalvm] fail-fast: false steps: - name: Check out the repository @@ -25,6 +25,9 @@ jobs: - name: Test in Linux JDK 18 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk18' run: docker compose -f docker/Linux-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Linux JDK 21 (LTS) + if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk21' + run: docker compose -f docker/Linux-JDK21/compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux GraalVM if: matrix.os == 'ubuntu-latest' && matrix.java == 'graalvm' run: docker compose -f docker/Linux-GraalVM20/docker-compose.yml up --build --exit-code-from cantaloupe @@ -37,4 +40,7 @@ jobs: - name: Test in Windows JDK 18 if: matrix.os == 'windows-latest' && matrix.java == 'jdk18' run: docker compose -f docker/Windows-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Windows JDK 21 (LTS) + if: matrix.os == 'windows-latest' && matrix.java == 'jdk21' + run: docker compose -f docker/Windows-JDK21/compose.yml up --build --exit-code-from cantaloupe # TODO: Windows+GraalVM diff --git a/docker/Linux-JDK21/Dockerfile b/docker/Linux-JDK21/Dockerfile new file mode 100644 index 000000000..78b428bee --- /dev/null +++ b/docker/Linux-JDK21/Dockerfile @@ -0,0 +1,56 @@ +FROM ubuntu:lunar + +ARG DEBIAN_FRONTEND=noninteractive + +# Install various dependencies: +# * ca-certificates is needed by wget +# * ffmpeg is needed by FfmpegProcessor +# * wget download stuffs in this dockerfile +# * libopenjp2-tools is needed by OpenJpegProcessor +# * All the rest is needed by GrokProcessor +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + ffmpeg \ + wget \ + libopenjp2-tools \ + liblcms2-dev \ + libpng-dev \ + libzstd-dev \ + libtiff-dev \ + libjpeg-dev \ + zlib1g-dev \ + libwebp-dev \ + libimage-exiftool-perl \ + libgrokj2k1 \ + grokj2k-tools \ + adduser \ + openjdk-21-jdk \ + maven \ + && rm -rf /var/lib/apt/lists/* + +# Install TurboJpegProcessor dependencies +RUN mkdir -p /opt/libjpeg-turbo/lib +COPY docker/Linux-JDK11/image_files/libjpeg-turbo/lib64 /opt/libjpeg-turbo/lib + +# Install KakaduNativeProcessor dependencies +COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ + +# A non-root user is needed for some FilesystemSourceTest tests to work. +ARG user=cantaloupe +ARG home=/home/$user +RUN adduser --home $home $user +RUN chown -R $user $home +USER $user +WORKDIR $home + +# Install application dependencies +COPY ./pom.xml pom.xml + +RUN echo "export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" > ~/.bashrc +RUN mvn --quiet dependency:resolve + +# Copy the code +COPY --chown=cantaloupe docker/Linux-JDK11/image_files/test.properties test.properties +COPY --chown=cantaloupe ./src src + +ENTRYPOINT mvn --batch-mode test -Pfreedeps diff --git a/docker/Linux-JDK21/compose.yml b/docker/Linux-JDK21/compose.yml new file mode 100644 index 000000000..ff0388419 --- /dev/null +++ b/docker/Linux-JDK21/compose.yml @@ -0,0 +1,20 @@ +# +# N.B.: docker compose must be invoked from the project root directory: +# +# docker compose -f path/to/compose.yml up --exit-code-from cantaloupe +# +services: + cantaloupe: + build: + context: ../../ + dockerfile: $PWD/docker/Linux-JDK21/Dockerfile + minio: + image: minio/minio + environment: + MINIO_ACCESS_KEY: MinioUser + MINIO_SECRET_KEY: OpenSesame + hostname: minio + command: server /data + redis: + image: redis:alpine + hostname: redis diff --git a/docker/Windows-JDK21/Dockerfile b/docker/Windows-JDK21/Dockerfile new file mode 100644 index 000000000..b6741f4f3 --- /dev/null +++ b/docker/Windows-JDK21/Dockerfile @@ -0,0 +1,29 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +ENV chocolateyUseWindowsCompression false + +# Install the Chocolatey package manager, which makes it easier to install +# dependencies. +RUN powershell -Command \ + iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \ + choco feature disable --name showDownloadProgress + +# Install various dependencies +# TODO: openjpeg +RUN choco install -y maven ffmpeg +RUN choco install -y openjdk --version=21.0.2 + +# Install TurboJpegProcessor dependencies TODO: libjpeg-turbo +#RUN mkdir -p /opt/libjpeg-turbo/lib +#COPY docker/Windows10-JDK11/image_files/libjpeg-turbo/lib64 c:\windows\system32 + +# Install KakaduNativeProcessor dependencies +COPY dist/deps/Windows-x86-64/lib/* c:/Windows/System32/ + +# Install application dependencies +COPY pom.xml pom.xml +RUN mvn dependency:resolve + +# Copy the code +COPY docker/Windows-JDK11/image_files/test.properties test.properties +COPY src src diff --git a/docker/Windows-JDK21/Dockerfile-minio b/docker/Windows-JDK21/Dockerfile-minio new file mode 100644 index 000000000..115389668 --- /dev/null +++ b/docker/Windows-JDK21/Dockerfile-minio @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +ENV MINIO_ACCESS_KEY=MinioUser +ENV MINIO_SECRET_KEY=OpenSesame + +RUN curl.exe --output minio.exe --url https://dl.min.io/server/minio/release/windows-amd64/minio.exe + +RUN mkdir c:\data + +CMD minio.exe server --address=:9000 c:\data diff --git a/docker/Windows-JDK21/compose.yml b/docker/Windows-JDK21/compose.yml new file mode 100644 index 000000000..9b286b036 --- /dev/null +++ b/docker/Windows-JDK21/compose.yml @@ -0,0 +1,18 @@ +# +# N.B.: docker-compose must be invoked from the project root directory: +# +# docker compose -f path/to/compose.yml up --exit-code-from cantaloupe +# +services: + cantaloupe: + build: + context: ../../ + dockerfile: docker/Windows-JDK21/Dockerfile + minio: + build: + context: ../../ + dockerfile: docker/Windows-JDK21/Dockerfile-minio + environment: + MINIO_ACCESS_KEY: MinioUser + MINIO_SECRET_KEY: OpenSesame + hostname: minio