Browse Source

Update dependencies and change settings

jaguililla 1 year ago
parent
commit
3846a22bae

+ 3 - 3
frameworks/Kotlin/hexagon/build.gradle

@@ -1,6 +1,6 @@
 
 
 plugins {
 plugins {
-    id "org.jetbrains.kotlin.jvm" version "2.0.20-RC" apply false
+    id "org.jetbrains.kotlin.jvm" version "2.0.10" apply false
     id "org.graalvm.buildtools.native" version "0.10.2" apply false
     id "org.graalvm.buildtools.native" version "0.10.2" apply false
 }
 }
 
 
@@ -9,7 +9,7 @@ description = "TFB benchmark"
 group = "com.hexagonkt"
 group = "com.hexagonkt"
 
 
 ext {
 ext {
-    hexagonVersion = "3.6.1"
+    hexagonVersion = "3.6.2"
     jettyVersion = "12.0.12"
     jettyVersion = "12.0.12"
     nettyVersion = "4.1.112.Final"
     nettyVersion = "4.1.112.Final"
 
 
@@ -30,5 +30,5 @@ subprojects {
 }
 }
 
 
 tasks.wrapper {
 tasks.wrapper {
-    gradleVersion = "8.9"
+    gradleVersion = "8.10"
 }
 }

BIN
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
 networkTimeout=10000
 networkTimeout=10000
 validateDistributionUrl=true
 validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
 zipStoreBase=GRADLE_USER_HOME

+ 5 - 2
frameworks/Kotlin/hexagon/gradlew

@@ -15,6 +15,8 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # limitations under the License.
 #
 #
+# SPDX-License-Identifier: Apache-2.0
+#
 
 
 ##############################################################################
 ##############################################################################
 #
 #
@@ -55,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #       Darwin, MinGW, and NonStop.
 #
 #
 #   (3) This script is generated from the Groovy template
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #       within the Gradle project.
 #
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
 # shellcheck disable=SC2034
 # shellcheck disable=SC2034
 APP_BASE_NAME=${0##*/}
 APP_BASE_NAME=${0##*/}
 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
+' "$PWD" ) || exit
 
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD=maximum
 MAX_FD=maximum

+ 2 - 0
frameworks/Kotlin/hexagon/gradlew.bat

@@ -13,6 +13,8 @@
 @rem See the License for the specific language governing permissions and
 @rem See the License for the specific language governing permissions and
 @rem limitations under the License.
 @rem limitations under the License.
 @rem
 @rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
 
 
 @if "%DEBUG%"=="" @echo off
 @if "%DEBUG%"=="" @echo off
 @rem ##########################################################################
 @rem ##########################################################################

+ 2 - 0
frameworks/Kotlin/hexagon/hexagon-helidon-native.dockerfile

@@ -16,6 +16,8 @@ RUN ./gradlew --quiet -x test hexagon_helidon_pgclient:nativeCompile
 FROM scratch
 FROM scratch
 ARG PROJECT=hexagon_helidon_pgclient
 ARG PROJECT=hexagon_helidon_pgclient
 
 
+ENV maximumPoolSize 300
+
 COPY --from=build /hexagon/$PROJECT/build/native/nativeCompile/$PROJECT /
 COPY --from=build /hexagon/$PROJECT/build/native/nativeCompile/$PROJECT /
 
 
 ENTRYPOINT [ "/hexagon_helidon_pgclient" ]
 ENTRYPOINT [ "/hexagon_helidon_pgclient" ]

+ 5 - 4
frameworks/Kotlin/hexagon/hexagon-helidon-pgclient.dockerfile

@@ -1,22 +1,23 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-22-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
 #
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-22-musl
 ARG PROJECT=hexagon_helidon_pgclient
 ARG PROJECT=hexagon_helidon_pgclient
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 5 - 4
frameworks/Kotlin/hexagon/hexagon-helidon.dockerfile

@@ -1,22 +1,23 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-22-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
 #
 #
-FROM docker.io/bellsoft/liberica-runtime-container:jre-21-musl
+FROM docker.io/bellsoft/liberica-runtime-container:jre-22-musl
 ARG PROJECT=hexagon_helidon_postgresql
 ARG PROJECT=hexagon_helidon_postgresql
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 2 - 0
frameworks/Kotlin/hexagon/hexagon-jetty-native.dockerfile

@@ -16,6 +16,8 @@ RUN ./gradlew --quiet -x test hexagon_jetty_postgresql:nativeCompile
 FROM scratch
 FROM scratch
 ARG PROJECT=hexagon_jetty_postgresql
 ARG PROJECT=hexagon_jetty_postgresql
 
 
+ENV maximumPoolSize 300
+
 COPY --from=build /hexagon/$PROJECT/build/native/nativeCompile/$PROJECT /
 COPY --from=build /hexagon/$PROJECT/build/native/nativeCompile/$PROJECT /
 
 
 ENTRYPOINT [ "/hexagon_jetty_postgresql" ]
 ENTRYPOINT [ "/hexagon_jetty_postgresql" ]

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon-jettyloom-pgclient.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,6 +17,7 @@ ARG PROJECT=hexagon_jetty_pgclient
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon-jettyloom.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,6 +17,7 @@ ARG PROJECT=hexagon_jetty_postgresql
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
 ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon-nettyepoll-pgclient.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,6 +17,7 @@ ARG PROJECT=hexagon_nettyepoll_pgclient
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,6 +17,7 @@ ARG PROJECT=hexagon_nettyepoll_postgresql
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test war
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test war
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,5 +17,6 @@ ARG MODULE=/hexagon/hexagon_tomcat_postgresql
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build $MODULE/build/libs/ROOT.war /usr/local/tomcat/webapps/ROOT.war
 COPY --from=build $MODULE/build/libs/ROOT.war /usr/local/tomcat/webapps/ROOT.war

+ 4 - 3
frameworks/Kotlin/hexagon/hexagon.dockerfile

@@ -1,13 +1,13 @@
 #
 #
 # BUILD
 # BUILD
 #
 #
-FROM docker.io/gradle:8.9-jdk21-alpine AS build
+FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-21-cds-musl AS build
 USER root
 USER root
 WORKDIR /hexagon
 WORKDIR /hexagon
 
 
 ADD . .
 ADD . .
-RUN gradle --quiet classes
-RUN gradle --quiet -x test installDist
+RUN ./gradlew --quiet classes
+RUN ./gradlew --quiet -x test installDist
 
 
 #
 #
 # RUNTIME
 # RUNTIME
@@ -17,6 +17,7 @@ ARG PROJECT=hexagon_jetty_postgresql
 
 
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV maximumPoolSize 300
 
 
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 

+ 9 - 3
frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt

@@ -6,8 +6,10 @@ import com.hexagonkt.model.CachedWorld
 import com.hexagonkt.model.Fortune
 import com.hexagonkt.model.Fortune
 import com.hexagonkt.model.World
 import com.hexagonkt.model.World
 import io.vertx.core.Future
 import io.vertx.core.Future
+import io.vertx.core.Vertx
+import io.vertx.core.VertxOptions
+import io.vertx.pgclient.PgBuilder
 import io.vertx.pgclient.PgConnectOptions
 import io.vertx.pgclient.PgConnectOptions
-import io.vertx.pgclient.PgPool
 import io.vertx.sqlclient.*
 import io.vertx.sqlclient.*
 import org.cache2k.Cache
 import org.cache2k.Cache
 
 
@@ -35,11 +37,15 @@ class BenchmarkPgClientStore(
     private val poolOptions: PoolOptions by lazy {
     private val poolOptions: PoolOptions by lazy {
         PoolOptions().apply {
         PoolOptions().apply {
             val environment = Jvm.systemSettingOrNull<String>("BENCHMARK_ENV")?.lowercase()
             val environment = Jvm.systemSettingOrNull<String>("BENCHMARK_ENV")?.lowercase()
-            maxSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
+            val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
+            maxSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize
         }
         }
     }
     }
 
 
-    private val dataSource: SqlClient by lazy { PgPool.client(connectOptions, poolOptions) }
+    private val dataSource: SqlClient by lazy {
+        val vertx = Vertx.vertx(VertxOptions().setPreferNativeTransport(true))
+        PgBuilder.client().using(vertx).connectingTo(connectOptions).with(poolOptions).build()
+    }
 
 
     override fun findAllFortunes(): List<Fortune> =
     override fun findAllFortunes(): List<Fortune> =
         dataSource.preparedQuery(SELECT_ALL_FORTUNES)
         dataSource.preparedQuery(SELECT_ALL_FORTUNES)