From 22af091235f4274cc5f8955389ee8a1e45fa73e6 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 19:56:26 +0400 Subject: [PATCH 1/6] chore: dockerignore everything --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a7db75e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +* +!/piped.sh From e6f50be0f5a8fba3a6e6e8abcf1ad65b3228213b Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 19:58:16 +0400 Subject: [PATCH 2/6] style: fix indents, typo --- Dockerfile.openj9 | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index 66ebf66..7f70212 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -1,42 +1,42 @@ FROM ubuntu:25.04 AS build -# partly copied from mkdocker.sh +# partially copied from mkdocker.sh # Copyright IBM Corp (Eclipse Public License 2.0) RUN apt -qq update \ - && apt -qq upgrade -y \ - && apt -qq install -y --no-install-recommends \ - ant ant-contrib autoconf build-essential ca-certificates cmake cpio curl file gcc-14 g++-14 gdb git \ - libasound2-dev libcups2-dev libdwarf-dev libelf-dev libexpat1-dev libffi-dev libfontconfig libfontconfig1-dev \ - libfreetype6-dev libnuma-dev libssl-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev \ - make nasm pkg-config python3 python3-dev rsync systemtap-sdt-dev unzip wget xvfb zip zlib1g-dev execstack unzip \ - && rm -rf /var/lib/apt/lists/* + && apt -qq upgrade -y \ + && apt -qq install -y --no-install-recommends \ + ant ant-contrib autoconf build-essential ca-certificates cmake cpio curl file gcc-14 g++-14 gdb git \ + libasound2-dev libcups2-dev libdwarf-dev libelf-dev libexpat1-dev libffi-dev libfontconfig libfontconfig1-dev \ + libfreetype6-dev libnuma-dev libssl-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev \ + make nasm pkg-config python3 python3-dev rsync systemtap-sdt-dev unzip wget xvfb zip zlib1g-dev execstack unzip \ + && rm -rf /var/lib/apt/lists/* WORKDIR /build RUN mkdir /build/bootjdk /build/dist \ - && wget --progress=dot:mega -O jdk21.tar.gz \ - https://api.adoptopenjdk.net/v3/binary/latest/21/ga/linux/x64/jdk/openj9/normal/adoptopenjdk \ - && tar -xzf jdk21.tar.gz --directory=/build/bootjdk --strip-components=1 \ - && rm -f jdk21.tar.gz + && wget --progress=dot:mega -O jdk21.tar.gz \ + https://api.adoptopenjdk.net/v3/binary/latest/21/ga/linux/x64/jdk/openj9/normal/adoptopenjdk \ + && tar -xzf jdk21.tar.gz --directory=/build/bootjdk --strip-components=1 \ + && rm -f jdk21.tar.gz RUN wget --progress=dot:mega -O jtreg.zip https://builds.shipilev.net/jtreg/jtreg-7.5.1%2B1.zip \ - && unzip jtreg.zip -d /build \ - && rm -rf jtreg.zip + && unzip jtreg.zip -d /build \ + && rm -rf jtreg.zip ENV JT_HOME=/build/jtreg RUN find /build/bootjdk -name '*.so' | xargs execstack -c RUN git clone --single-branch --depth 1 \ - https://github.com/ibmruntimes/openj9-openjdk-jdk21.git \ - /build/src + https://github.com/ibmruntimes/openj9-openjdk-jdk21.git \ + /build/src WORKDIR /build/src RUN bash get_source.sh RUN bash configure \ - --enable-libffi-bundling --enable-ddr --enable-jitserver \ - --enable-fallback-linker --with-jtreg=/build/jtreg --with-boot-jdk=/build/bootjdk \ - --with-openssl=system --with-extra-ldflags="-Wl,-z,noexecstack" + --enable-libffi-bundling --enable-ddr --enable-jitserver \ + --enable-fallback-linker --with-jtreg=/build/jtreg --with-boot-jdk=/build/bootjdk \ + --with-openssl=system --with-extra-ldflags="-Wl,-z,noexecstack" RUN make all JOBS=$(nproc) RUN make install @@ -44,8 +44,8 @@ RUN make install # jlink by advice from https://adoptium.net/blog/2021/10/jlink-to-produce-own-runtime/ WORKDIR /build/src/build/linux-x86_64-server-release/images RUN jdk/bin/jlink --strip-debug --no-man-pages --no-header-files --compress=2 \ - --output jre \ - --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,\ + --output jre \ + --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,\ java.management,java.management.rmi,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.se,\ java.security.jgss,java.security.sasl,java.smartcardio,java.sql,java.sql.rowset,java.transaction.xa,\ java.xml,java.xml.crypto,jdk.accessibility,jdk.charsets,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.dynalink,\ @@ -54,8 +54,6 @@ jdk.nio.mapmode,jdk.random,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsu jdk.xml.dom,jdk.zipfs,openj9.criu,openj9.cuda,openj9.dataaccess,openj9.gpu,openj9.jvm,\ openj9.sharedclasses,openj9.zosconditionhandling - - ENV JAVA_HOME=/build/src/build/linux-x86_64-server-release/images/jre ENV PATH="$JAVA_HOME/bin:$JAVA_HOME/lib:$PATH" ENV TEST_JDK_HOME=/build/src/build/linux-x86_64-server-release/images/jdk @@ -64,7 +62,7 @@ ENV DIAGNOSTICLEVEL=nodetails ENV NATIVE_TEST_LIBS=/build/src/build/linux-x86_64-server-release/images/test RUN cd /build/src/openj9/test \ - && git clone https://github.com/adoptium/TKG.git + && git clone https://github.com/adoptium/TKG.git WORKDIR /build/src/openj9/test/TKG @@ -84,7 +82,6 @@ RUN make -f parallelList.mk JOBS=$(nproc) WORKDIR /build/src/build/linux-x86_64-server-release/images RUN mv ./* /build/dist/ - # ------ FROM ubuntu:25.04 AS run From cc5c929b1efac740ad6439d20c7ca2461378f66d Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 20:02:44 +0400 Subject: [PATCH 3/6] fix: remove tests --- Dockerfile.openj9 | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index 7f70212..ffc725f 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -18,12 +18,6 @@ RUN mkdir /build/bootjdk /build/dist \ && tar -xzf jdk21.tar.gz --directory=/build/bootjdk --strip-components=1 \ && rm -f jdk21.tar.gz -RUN wget --progress=dot:mega -O jtreg.zip https://builds.shipilev.net/jtreg/jtreg-7.5.1%2B1.zip \ - && unzip jtreg.zip -d /build \ - && rm -rf jtreg.zip - -ENV JT_HOME=/build/jtreg - RUN find /build/bootjdk -name '*.so' | xargs execstack -c RUN git clone --single-branch --depth 1 \ @@ -39,7 +33,6 @@ RUN bash configure \ --with-openssl=system --with-extra-ldflags="-Wl,-z,noexecstack" RUN make all JOBS=$(nproc) -RUN make install # jlink by advice from https://adoptium.net/blog/2021/10/jlink-to-produce-own-runtime/ WORKDIR /build/src/build/linux-x86_64-server-release/images @@ -54,31 +47,6 @@ jdk.nio.mapmode,jdk.random,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsu jdk.xml.dom,jdk.zipfs,openj9.criu,openj9.cuda,openj9.dataaccess,openj9.gpu,openj9.jvm,\ openj9.sharedclasses,openj9.zosconditionhandling -ENV JAVA_HOME=/build/src/build/linux-x86_64-server-release/images/jre -ENV PATH="$JAVA_HOME/bin:$JAVA_HOME/lib:$PATH" -ENV TEST_JDK_HOME=/build/src/build/linux-x86_64-server-release/images/jdk -ENV TEST_ROOT=/build/src/openj9/test -ENV DIAGNOSTICLEVEL=nodetails -ENV NATIVE_TEST_LIBS=/build/src/build/linux-x86_64-server-release/images/test - -RUN cd /build/src/openj9/test \ - && git clone https://github.com/adoptium/TKG.git - -WORKDIR /build/src/openj9/test/TKG - -ENV BUILD_LIST=functional - -RUN find ../ -type f -name "playlist.xml" | xargs sed -i 's#jit_jar#jit_jarhttps://github.com/#g' -RUN find ../ -type f -name "playlist.xml" | xargs sed -i 's#testJITServer#testJITServerhttps://github.com/#g' - -RUN make compile -j$(nproc) - -RUN make genParallelList PARALLEL_OPTIONS=TEST=_sanity.functional.regular TEST_TIME= NUM_MACHINES=$(nproc) - -RUN cat parallelList.mk - -RUN make -f parallelList.mk JOBS=$(nproc) - WORKDIR /build/src/build/linux-x86_64-server-release/images RUN mv ./* /build/dist/ From 11e8999e660bc55c63a6bbb3476deea25f8e2e6d Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 20:03:32 +0400 Subject: [PATCH 4/6] style: indent, deps sort --- Dockerfile.openj9 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index ffc725f..8aed8d6 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -5,10 +5,10 @@ FROM ubuntu:25.04 AS build RUN apt -qq update \ && apt -qq upgrade -y \ && apt -qq install -y --no-install-recommends \ - ant ant-contrib autoconf build-essential ca-certificates cmake cpio curl file gcc-14 g++-14 gdb git \ - libasound2-dev libcups2-dev libdwarf-dev libelf-dev libexpat1-dev libffi-dev libfontconfig libfontconfig1-dev \ - libfreetype6-dev libnuma-dev libssl-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev \ - make nasm pkg-config python3 python3-dev rsync systemtap-sdt-dev unzip wget xvfb zip zlib1g-dev execstack unzip \ + ant ant-contrib autoconf build-essential ca-certificates cmake cpio curl execstack file gcc-14 g++-14 gdb git \ + libasound2-dev libcups2-dev libdwarf-dev libelf-dev libexpat1-dev libffi-dev libfontconfig libfontconfig1-dev \ + libfreetype6-dev libnuma-dev libssl-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev \ + make nasm pkg-config python3 python3-dev rsync systemtap-sdt-dev unzip wget xvfb zip zlib1g-dev unzip \ && rm -rf /var/lib/apt/lists/* WORKDIR /build From 6b3da81ed3b8c5e9588aa0aca2b4663ba409c399 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 20:20:46 +0400 Subject: [PATCH 5/6] perf: change flags, add optimizations --- Dockerfile.openj9 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index 8aed8d6..2143449 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -27,11 +27,13 @@ RUN git clone --single-branch --depth 1 \ WORKDIR /build/src RUN bash get_source.sh +ENV CC=/usr/bin/gcc CXX=/usr/bin/g++ \ + CFLAGS="-O3 -flto -fuse-linker-plugin" \ + LDFLAGS="-Wl,-O1" RUN bash configure \ - --enable-libffi-bundling --enable-ddr --enable-jitserver \ - --enable-fallback-linker --with-jtreg=/build/jtreg --with-boot-jdk=/build/bootjdk \ - --with-openssl=system --with-extra-ldflags="-Wl,-z,noexecstack" - + --with-boot-jdk=/build/bootjdk \ + --with-openssl=system \ + --enable-jvm-feature-link-time-opt RUN make all JOBS=$(nproc) # jlink by advice from https://adoptium.net/blog/2021/10/jlink-to-produce-own-runtime/ From ad6acfeaf9ada903bd8f2e0da3f8d5ef7c4a69a7 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 13 Mar 2025 20:22:27 +0400 Subject: [PATCH 6/6] fix: safer find|xargs --- Dockerfile.openj9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index 2143449..2102846 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -18,7 +18,7 @@ RUN mkdir /build/bootjdk /build/dist \ && tar -xzf jdk21.tar.gz --directory=/build/bootjdk --strip-components=1 \ && rm -f jdk21.tar.gz -RUN find /build/bootjdk -name '*.so' | xargs execstack -c +RUN find /build/bootjdk -name '*.so' -type f -print0 | xargs -0 -- execstack -c RUN git clone --single-branch --depth 1 \ https://github.com/ibmruntimes/openj9-openjdk-jdk21.git \