forked from LesnyRumcajs/grpc_bench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request LesnyRumcajs#139 from brunoborges/fix-other-jvm-ex…
…ecutors Use same executor service (workStealing) for Kotlin and Micronaut
- Loading branch information
Showing
41 changed files
with
635 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,58 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "5.2.0" | ||
id "net.ltgt.apt-eclipse" version "0.18" | ||
id "net.ltgt.apt-idea" version "0.18" | ||
// tag::plugin[] | ||
id 'com.google.protobuf' version '0.8.12' | ||
// end::plugin[] | ||
id "application" | ||
id "java" | ||
id("com.github.johnrengelman.shadow") version "7.0.0" | ||
id("io.micronaut.application") version "1.5.0" | ||
id("com.google.protobuf") version "0.8.15" | ||
} | ||
|
||
version "0.1" | ||
group "helloworld" | ||
|
||
|
||
version = "0.1" | ||
group = "com.example" | ||
|
||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
ext { | ||
micronautVersion = "2.3.3" | ||
micronautGrpcVersion = "2.3.3" | ||
mavenCentral() | ||
} | ||
|
||
configurations { | ||
all { | ||
resolutionStrategy.eachDependency { DependencyResolveDetails details -> | ||
String group = details.requested.group | ||
if(group == 'io.micronaut.grpc') { | ||
details.useVersion(micronautGrpcVersion) | ||
} | ||
} | ||
micronaut { | ||
testRuntime("junit5") | ||
processing { | ||
incremental(true) | ||
annotations("com.example.*") | ||
} | ||
} | ||
|
||
dependencies { | ||
annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
testAnnotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
|
||
annotationProcessor("io.micronaut:micronaut-inject-java") | ||
annotationProcessor("io.micronaut:micronaut-validation") | ||
|
||
compileOnly "io.micronaut:micronaut-inject-java" | ||
implementation "io.micronaut:micronaut-inject" | ||
implementation "io.micronaut:micronaut-validation" | ||
implementation "io.micronaut:micronaut-runtime" | ||
|
||
implementation "io.micronaut.grpc:micronaut-grpc-runtime" | ||
|
||
implementation "io.micronaut:micronaut-discovery-client" | ||
runtimeOnly "ch.qos.logback:logback-classic:1.2.3" | ||
|
||
testAnnotationProcessor "io.micronaut:micronaut-inject-java" | ||
testAnnotationProcessor "io.micronaut:micronaut-validation" | ||
|
||
testImplementation("org.junit.jupiter:junit-jupiter-api") | ||
testImplementation 'io.micronaut.test:micronaut-test-junit5' | ||
testImplementation "org.mockito:mockito-junit-jupiter:2.22.0" | ||
testImplementation "io.micronaut:micronaut-inject-java" | ||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" | ||
|
||
compileOnly("org.graalvm.nativeimage:svm") | ||
annotationProcessor("io.micronaut:micronaut-graal") | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
implementation("io.micronaut:micronaut-runtime") | ||
implementation("io.micronaut.grpc:micronaut-grpc-runtime") | ||
implementation("javax.annotation:javax.annotation-api") | ||
runtimeOnly("ch.qos.logback:logback-classic") | ||
implementation("io.micronaut:micronaut-validation") | ||
testImplementation("io.micronaut:micronaut-http-client") | ||
} | ||
|
||
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1') | ||
|
||
mainClassName = "helloworld.Application" | ||
tasks.withType(JavaCompile){ | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add('-parameters') | ||
application { | ||
mainClass.set("helloworld.Application") | ||
} | ||
|
||
// tag::config[] | ||
ext { | ||
protocVersion="3.12.2" | ||
grpcVersion="1.30.0" | ||
java { | ||
sourceCompatibility = JavaVersion.toVersion("11") | ||
targetCompatibility = JavaVersion.toVersion("11") | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs 'build/generated/source/proto/main/grpc' | ||
srcDirs 'build/generated/source/proto/main/java' | ||
srcDirs("build/generated/source/proto/main/grpc") | ||
srcDirs("build/generated/source/proto/main/java") | ||
} | ||
} | ||
} | ||
|
||
protobuf { | ||
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" } | ||
protoc { artifact = "com.google.protobuf:protoc:3.14.0" } | ||
plugins { | ||
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } | ||
grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.33.1" } | ||
} | ||
generateProtoTasks { | ||
all()*.plugins { grpc {} } | ||
} | ||
} | ||
// end::config[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
micronautVersion=2.5.1 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
profile: service | ||
defaultPackage: helloworld | ||
--- | ||
applicationType: default | ||
defaultPackage: helloworld | ||
testFramework: junit | ||
sourceLanguage: java | ||
sourceLanguage: java | ||
buildTool: gradle | ||
features: [annotation-api, app-name, graalvm, gradle, http-client, java, java-application, junit, logback, netty-server, readme, shade, yaml] |
2 changes: 0 additions & 2 deletions
2
...sources/META-INF/native-image/example/micronaut/basic-application/native-image.properties
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...main/resources/META-INF/native-image/helloworld/basic-application/native-image.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Args = -H:Name=hello-world-java \ | ||
-H:Class=helloworld.Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM adoptopenjdk:14.0.2_8-jre-hotspot-bionic | ||
FROM adoptopenjdk:16_36-jdk-hotspot | ||
|
||
WORKDIR /app | ||
COPY java_micronaut_bench /app | ||
COPY proto/helloworld/helloworld.proto /app/src/main/proto/helloworld.proto | ||
|
||
RUN /app/gradlew installDist | ||
|
||
ENV JAVA_OPTS "-XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" | ||
ENV GC "-XX:+UseParallelGC" | ||
ENV JAVA_OPTS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" | ||
|
||
ENTRYPOINT ["/app/build/install/app/bin/app"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,58 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "5.2.0" | ||
id "net.ltgt.apt-eclipse" version "0.18" | ||
id "net.ltgt.apt-idea" version "0.18" | ||
// tag::plugin[] | ||
id 'com.google.protobuf' version '0.8.12' | ||
// end::plugin[] | ||
id "application" | ||
id "java" | ||
id("com.github.johnrengelman.shadow") version "7.0.0" | ||
id("io.micronaut.application") version "1.5.0" | ||
id("com.google.protobuf") version "0.8.15" | ||
} | ||
|
||
version "0.1" | ||
group "helloworld" | ||
|
||
|
||
version = "0.1" | ||
group = "com.example" | ||
|
||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
ext { | ||
micronautVersion = "2.0.0.M3" | ||
micronautGrpcVersion = "2.0.0.M3" | ||
mavenCentral() | ||
} | ||
|
||
configurations { | ||
all { | ||
resolutionStrategy.eachDependency { DependencyResolveDetails details -> | ||
String group = details.requested.group | ||
if(group == 'io.micronaut.grpc') { | ||
details.useVersion(micronautGrpcVersion) | ||
} | ||
} | ||
micronaut { | ||
testRuntime("junit5") | ||
processing { | ||
incremental(true) | ||
annotations("com.example.*") | ||
} | ||
} | ||
|
||
dependencies { | ||
annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
testAnnotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
|
||
annotationProcessor("io.micronaut:micronaut-inject-java") | ||
annotationProcessor("io.micronaut:micronaut-validation") | ||
|
||
compileOnly "io.micronaut:micronaut-inject-java" | ||
implementation "io.micronaut:micronaut-inject" | ||
implementation "io.micronaut:micronaut-validation" | ||
implementation "io.micronaut:micronaut-runtime" | ||
|
||
implementation "io.micronaut.grpc:micronaut-grpc-runtime" | ||
|
||
implementation "io.micronaut:micronaut-discovery-client" | ||
runtimeOnly "ch.qos.logback:logback-classic:1.2.3" | ||
|
||
testAnnotationProcessor "io.micronaut:micronaut-inject-java" | ||
testAnnotationProcessor "io.micronaut:micronaut-validation" | ||
|
||
testImplementation("org.junit.jupiter:junit-jupiter-api") | ||
testImplementation 'io.micronaut.test:micronaut-test-junit5' | ||
testImplementation "org.mockito:mockito-junit-jupiter:2.22.0" | ||
testImplementation "io.micronaut:micronaut-inject-java" | ||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
implementation("io.micronaut:micronaut-runtime") | ||
implementation("io.micronaut.grpc:micronaut-grpc-runtime") | ||
implementation("javax.annotation:javax.annotation-api") | ||
runtimeOnly("ch.qos.logback:logback-classic") | ||
implementation("io.micronaut:micronaut-validation") | ||
testImplementation("io.micronaut:micronaut-http-client") | ||
} | ||
|
||
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1') | ||
|
||
mainClassName = "helloworld.Application" | ||
tasks.withType(JavaCompile){ | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add('-parameters') | ||
application { | ||
mainClass.set("helloworld.Application") | ||
} | ||
|
||
// tag::config[] | ||
ext { | ||
protocVersion="3.12.2" | ||
grpcVersion="1.30.0" | ||
java { | ||
sourceCompatibility = JavaVersion.toVersion("16") | ||
targetCompatibility = JavaVersion.toVersion("16") | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs 'build/generated/source/proto/main/grpc' | ||
srcDirs 'build/generated/source/proto/main/java' | ||
srcDirs("build/generated/source/proto/main/grpc") | ||
srcDirs("build/generated/source/proto/main/java") | ||
} | ||
} | ||
} | ||
|
||
protobuf { | ||
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" } | ||
protoc { artifact = "com.google.protobuf:protoc:3.14.0" } | ||
plugins { | ||
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } | ||
grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.33.1" } | ||
} | ||
generateProtoTasks { | ||
all()*.plugins { grpc {} } | ||
} | ||
} | ||
// end::config[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
micronautVersion=2.5.1 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.