Browse Source

Upgrade to Inverno 1.6.2

Jeremy Kuhn 1 year ago
parent
commit
4a500ea81d

+ 3 - 3
frameworks/Java/inverno/inverno-postgres.dockerfile

@@ -1,11 +1,11 @@
-FROM maven:3.8.2-openjdk-16 as maven
+FROM maven:3.9.6-amazoncorretto-21 as maven
 WORKDIR /inverno
 COPY src src
 COPY pom.xml pom.xml
-RUN mvn package -q
+RUN mvn package -q -Pio.inverno.io_uring
 
 EXPOSE 8080
 
 # CMD [ "target/maven-inverno/application_linux_amd64/inverno-benchmark-1.0.0-SNAPSHOT/bin/inverno-benchmark" ]
 CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \
-    target/maven-inverno/application_linux_amd64/inverno-benchmark-1.0.0-SNAPSHOT/bin/inverno-benchmark --com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\"
+    target/maven-inverno/application_linux_amd64/inverno-benchmark-1.0.0-SNAPSHOT/bin/inverno-benchmark --com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\"

+ 3 - 3
frameworks/Java/inverno/inverno.dockerfile

@@ -1,9 +1,9 @@
-FROM maven:3.8.2-openjdk-16 as maven
+FROM maven:3.9.6-amazoncorretto-21 as maven
 WORKDIR /inverno
 COPY src src
 COPY pom.xml pom.xml
-RUN mvn package -q
+RUN mvn package -q -Pio.inverno.io_uring
 
 EXPOSE 8080
 
-CMD [ "target/maven-inverno/application_linux_amd64/inverno-benchmark-1.0.0-SNAPSHOT/bin/inverno-benchmark", "--com.techempower.inverno.benchmark.appConfiguration.boot.reactor_prefer_vertx=false" ]
+CMD [ "target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark", "--com.techempower.inverno.benchmark.appConfiguration.boot.reactor_prefer_vertx=false" ]

+ 97 - 35
frameworks/Java/inverno/pom.xml

@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>io.inverno.dist</groupId>
 		<artifactId>inverno-parent</artifactId>
-		<version>1.4.1</version>
+		<version>1.6.2</version>
 	</parent>
 	<groupId>com.techempower</groupId>
 	<artifactId>inverno-benchmark</artifactId>
@@ -17,9 +17,9 @@
 	<description>Inverno framework benchmark test</description>
 	
 	<properties>
-		<maven.compiler.source>16</maven.compiler.source>
-		<maven.compiler.target>16</maven.compiler.target>
-		<maven.compiler.release>16</maven.compiler.release>
+		<maven.compiler.source>21</maven.compiler.source>
+		<maven.compiler.target>21</maven.compiler.target>
+		<maven.compiler.release>21</maven.compiler.release>
 	</properties>
 	
 	<dependencies>
@@ -79,10 +79,21 @@
 			<version>${version.netty}</version>
 		</dependency>
 
-		<dependency>
+		<!--<dependency>
 			<groupId>io.netty</groupId>
 			<artifactId>netty-transport-native-epoll</artifactId>
 			<classifier>linux-x86_64</classifier>
+		</dependency>-->
+		
+		<dependency>
+			<groupId>io.netty.incubator</groupId>
+			<artifactId>netty-incubator-transport-native-io_uring</artifactId>
+			<classifier>linux-x86_64</classifier>
+		</dependency>
+		
+		<dependency>
+			<groupId>io.vertx</groupId>
+			<artifactId>vertx-io_uring-incubator</artifactId>
 		</dependency>
 		
 		<dependency>
@@ -90,36 +101,87 @@
 			<artifactId>log4j-core</artifactId>
 		</dependency>
 	</dependencies>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>io.inverno.tool</groupId>
-				<artifactId>inverno-maven-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>inverno-package</id>
-						<phase>package</phase>
-						<goals>
-							<goal>build-app</goal>
-						</goals>
-						<configuration>
-							<vm>server</vm>
-							<launchers>
-								<launcher>
-									<name>inverno-benchmark</name>
-									<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.epoll</vmOptions>
-								</launcher>
-							</launchers>
-							<formats>
-								<format>zip</format>
-							</formats>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
+	
+	<profiles>
+		<profile>
+			<id>io.inverno.epoll</id>
+			<dependencies>
+				<dependency>
+					<groupId>io.netty</groupId>
+					<artifactId>netty-transport-native-epoll</artifactId>
+					<classifier>linux-x86_64</classifier>
+				</dependency>
+			</dependencies>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>io.inverno.tool</groupId>
+						<artifactId>inverno-maven-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>inverno-package-app</id>
+								<phase>package</phase>
+								<goals>
+									<goal>package-app</goal>
+								</goals>
+								<configuration>
+									<vm>server</vm>
+									<launchers>
+										<launcher>
+											<name>inverno-benchmark</name>
+											<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64</vmOptions>
+										</launcher>
+									</launchers>
+									<archiveFormats>
+										<archiveFormat>zip</archiveFormat>
+									</archiveFormats>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>io.inverno.io_uring</id>
+			<dependencies>
+				<dependency>
+					<groupId>io.netty</groupId>
+					<artifactId>netty-transport-native-epoll</artifactId>
+					<classifier>linux-x86_64</classifier>
+				</dependency>
+			</dependencies>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>io.inverno.tool</groupId>
+						<artifactId>inverno-maven-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>inverno-package-app</id>
+								<phase>package</phase>
+								<goals>
+									<goal>package-app</goal>
+								</goals>
+								<configuration>
+									<vm>server</vm>
+									<launchers>
+										<launcher>
+											<name>inverno-benchmark</name>
+											<vmOptions>-Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64</vmOptions>
+										</launcher>
+									</launchers>
+									<archiveFormats>
+										<archiveFormat>zip</archiveFormat>
+									</archiveFormats>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
 
 </project>
 

+ 0 - 99
frameworks/Java/inverno/src/jmods/io.vertx.core/module-info.java

@@ -1,99 +0,0 @@
-module io.vertx.core {
-    requires io.netty.handler.proxy;
-    requires io.netty.resolver.dns;
-    requires io.netty.transport.epoll;
-    requires io.netty.transport.unix.common;
-    requires java.naming;
-    requires org.apache.logging.log4j;
-
-    requires transitive com.fasterxml.jackson.core;
-    requires transitive com.fasterxml.jackson.databind;
-    requires transitive io.netty.buffer;
-    requires transitive io.netty.codec;
-    requires transitive io.netty.codec.dns;
-    requires transitive io.netty.codec.http;
-    requires transitive io.netty.codec.http2;
-    requires transitive io.netty.common;
-    requires transitive io.netty.handler;
-    requires transitive io.netty.resolver;
-    requires transitive io.netty.transport;
-    requires transitive java.compiler;
-    requires transitive java.logging;
-
-    exports io.vertx.core;
-    exports io.vertx.core.buffer;
-    exports io.vertx.core.buffer.impl;
-    exports io.vertx.core.cli;
-    exports io.vertx.core.cli.annotations;
-    exports io.vertx.core.cli.converters;
-    exports io.vertx.core.cli.impl;
-    exports io.vertx.core.datagram;
-    exports io.vertx.core.datagram.impl;
-    exports io.vertx.core.dns;
-    exports io.vertx.core.dns.impl;
-    exports io.vertx.core.dns.impl.decoder;
-    exports io.vertx.core.eventbus;
-    exports io.vertx.core.eventbus.impl;
-    exports io.vertx.core.eventbus.impl.clustered;
-    exports io.vertx.core.eventbus.impl.codecs;
-    exports io.vertx.core.file;
-    exports io.vertx.core.file.impl;
-    exports io.vertx.core.http;
-    exports io.vertx.core.http.impl;
-    exports io.vertx.core.http.impl.cgbystrom;
-    exports io.vertx.core.http.impl.headers;
-    exports io.vertx.core.http.impl.ws;
-    exports io.vertx.core.impl;
-    exports io.vertx.core.impl.cpu;
-    exports io.vertx.core.impl.future;
-    exports io.vertx.core.impl.launcher;
-    exports io.vertx.core.impl.launcher.commands;
-    exports io.vertx.core.impl.logging;
-    exports io.vertx.core.impl.resolver;
-    exports io.vertx.core.impl.utils;
-    exports io.vertx.core.impl.verticle;
-    exports io.vertx.core.json;
-    exports io.vertx.core.json.impl;
-    exports io.vertx.core.json.jackson;
-    exports io.vertx.core.json.pointer;
-    exports io.vertx.core.json.pointer.impl;
-    exports io.vertx.core.logging;
-    exports io.vertx.core.metrics;
-    exports io.vertx.core.metrics.impl;
-    exports io.vertx.core.net;
-    exports io.vertx.core.net.impl;
-    exports io.vertx.core.net.impl.pkcs1;
-    exports io.vertx.core.net.impl.pool;
-    exports io.vertx.core.net.impl.transport;
-    exports io.vertx.core.parsetools;
-    exports io.vertx.core.parsetools.impl;
-    exports io.vertx.core.shareddata;
-    exports io.vertx.core.shareddata.impl;
-    exports io.vertx.core.spi;
-    exports io.vertx.core.spi.cluster;
-    exports io.vertx.core.spi.cluster.impl;
-    exports io.vertx.core.spi.cluster.impl.selector;
-    exports io.vertx.core.spi.json;
-    exports io.vertx.core.spi.launcher;
-    exports io.vertx.core.spi.logging;
-    exports io.vertx.core.spi.metrics;
-    exports io.vertx.core.spi.observability;
-    exports io.vertx.core.spi.resolver;
-    exports io.vertx.core.spi.tracing;
-    exports io.vertx.core.streams;
-    exports io.vertx.core.streams.impl;
-    exports io.vertx.core.tracing;
-
-    provides io.vertx.core.spi.launcher.CommandFactory with
-        io.vertx.core.impl.launcher.commands.RunCommandFactory,
-        io.vertx.core.impl.launcher.commands.VersionCommandFactory,
-        io.vertx.core.impl.launcher.commands.BareCommandFactory,
-        io.vertx.core.impl.launcher.commands.ListCommandFactory,
-        io.vertx.core.impl.launcher.commands.StartCommandFactory,
-        io.vertx.core.impl.launcher.commands.StopCommandFactory;
-    
-    uses io.vertx.core.spi.VertxServiceProvider;
-    uses io.vertx.core.spi.VerticleFactory;
-    uses io.vertx.core.spi.JsonFactory;
-
-}

+ 0 - 38
frameworks/Java/inverno/src/jmods/r2dbc.postgresql/module-info.java

@@ -1,38 +0,0 @@
-module r2dbc.postgresql {
-    requires com.ongres.scram.client;
-    requires com.ongres.scram.common;
-    requires io.netty.codec;
-    requires io.netty.resolver;
-    requires io.netty.transport;
-    requires io.netty.transport.epoll;
-    requires io.netty.transport.unix.common;
-    requires java.naming;
-
-    requires transitive io.netty.buffer;
-    requires transitive io.netty.common;
-    requires transitive io.netty.handler;
-    requires transitive org.reactivestreams;
-    requires transitive r2dbc.spi;
-    requires transitive reactor.core;
-    requires transitive reactor.netty.core;
-
-    exports io.r2dbc.postgresql;
-    exports io.r2dbc.postgresql.api;
-    exports io.r2dbc.postgresql.authentication;
-    exports io.r2dbc.postgresql.client;
-    exports io.r2dbc.postgresql.codec;
-    exports io.r2dbc.postgresql.extension;
-    exports io.r2dbc.postgresql.message;
-    exports io.r2dbc.postgresql.message.backend;
-    exports io.r2dbc.postgresql.message.frontend;
-    exports io.r2dbc.postgresql.replication;
-    exports io.r2dbc.postgresql.util;
-
-    provides io.r2dbc.postgresql.extension.Extension with
-        io.r2dbc.postgresql.codec.BuiltinDynamicCodecs;
-    provides io.r2dbc.spi.ConnectionFactoryProvider with
-        io.r2dbc.postgresql.PostgresqlConnectionFactoryProvider;
-    
-    uses io.r2dbc.postgresql.extension.Extension;
-
-}

+ 5 - 4
frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Handler.java → frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java

@@ -23,13 +23,14 @@ import io.inverno.mod.base.Charsets;
 import io.inverno.mod.base.concurrent.Reactor;
 import io.inverno.mod.base.concurrent.ReactorScope;
 import io.inverno.mod.base.converter.ConverterException;
+import io.inverno.mod.http.base.ExchangeContext;
 import io.inverno.mod.http.base.HttpException;
 import io.inverno.mod.http.base.InternalServerErrorException;
 import io.inverno.mod.http.base.Parameter;
 import io.inverno.mod.http.base.Status;
 import io.inverno.mod.http.server.Exchange;
-import io.inverno.mod.http.server.ExchangeContext;
-import io.inverno.mod.http.server.RootExchangeHandler;
+import io.inverno.mod.http.server.ErrorExchange;
+import io.inverno.mod.http.server.ServerController;
 import io.inverno.mod.sql.SqlClient;
 import io.inverno.mod.sql.UnsafeSqlOperations;
 import io.netty.buffer.ByteBuf;
@@ -42,7 +43,7 @@ import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
 @Bean( visibility = Visibility.PRIVATE )
-public class Handler implements RootExchangeHandler<ExchangeContext, Exchange<ExchangeContext>> {
+public class Controller implements ServerController<ExchangeContext, Exchange<ExchangeContext>, ErrorExchange<ExchangeContext>> {
 
 	private static final String PATH_PLAINTEXT = "/plaintext";
 	private static final String PATH_JSON = "/json";
@@ -65,7 +66,7 @@ public class Handler implements RootExchangeHandler<ExchangeContext, Exchange<Ex
 	
 	private CharSequence date;
 	
-	public Handler(Reactor reactor, 
+	public Controller(Reactor reactor, 
 			ObjectMapper mapper,
 			ReactorScope<Mono<SqlClient>> sqlClient
 		) {

+ 3 - 3
frameworks/Java/inverno/src/main/java/module-info.java

@@ -16,9 +16,9 @@ module com.techempower.inverno.benchmark {
 	requires io.vertx.core;
 	requires java.sql;
 	
-	requires transitive io.netty.transport;
-	requires static io.netty.transport.unix.common;
-	requires static io.netty.transport.epoll;
+	//requires transitive io.netty.transport;
+	//requires static io.netty.transport.unix.common;
+	//requires static io.netty.transport.epoll;
 	
 	exports com.techempower.inverno.benchmark;
 	exports com.techempower.inverno.benchmark.model;