Skip to content

Commit b5e39ad

Browse files
bhou2Binbing Houiuliiasobolevskazdong2
authored
Genie OSS Spring Boot 3 Upgrade (#1229)
* Upgrade genie-common-internal to io.awspring.cloud:spring-cloud-aws-dependencies: 3.2.1 * upgrade genie-agent and genie-web to spring boot 3 * change the org.springframework.boot to 3.4.2 * move the subprojects block to the configure block * upgrade genie-common-internal to JDK 17 * Revert "upgrade genie-common-internal to JDK 17" This reverts commit 3227057. * replace javax with jakarta * replace jakarta with javax * Fix status code in TitusAgentLauncherImpl * javadoc and other minor fixes * Remove TaskExecutorCustomizer&TaskSchedulerCustomizer in favor of ThreadLocalTaskExecutorCustomizer&ThreadLocalTaskSchedulerCustomizer * move to new autoconfiguration registration * enable debug mode to see autoconfiguration conditions report * Fix genie-agent-app smoke tests * Fix genie-app smoke test unsupported classes and methods Fix genie-agent smoke test unsupported classes and methods * Fix hibernate issues * Move to new autoconfiguration registration for genie-app smoke test * Upgrade to AWS SDK v2 * Fix threadSafe dependency * Fix DigestUtils dependency * Fix EC2MetadataUtils dependency * getHostname by checking AWS environment * Upgrade AwsAutoConfiguration * Upgrade S3ProtocolResolverRegistrar * Upgrade S3JobArchiverImpl * S3TransferManagerFactory for creating and managing S3TransferManager instances with S3AsyncClient * use S3TransferManagerFactory in S3JobArchiverImpl for sync uploading * Fix ArgumentValidators * Upgrade httpclient and commons-codec * Upgrade AWSAutoConfiguration and RetryProperties for AWS SNS * Amend ArgumentValidators * remove unused imports * Amend AwsAutoConfiguration * Remove used imports * Amend AwsAutoConfiguration * Fix region not found error for GenieAgentApplicationSmokeTest * dependecy updates with spring-boot-starter-web * fix region not found error in GenieAgentApplicationSmokeTest * fix sharedAgentTaskExecutor in AgentAutoConfiguration * fix failures in GenieAppSmokeTest * cleanup / refactor unused code * fix setRegion in BucketProperties * update BucketPropertiesSpec * update S3ProtocolResolverSpec * create S3TransferManagerFactorySpec * update S3ClientFactory and S3ClientFactorySpec * update SimpleStorageRangeResourceSpec * remove S3ResourceLoaderProperties as it is not needed * use different Spock BOM version for Spring Boot 2 and 3 modules to avoid compatibility issues with JUnit4 * Fix S3ProtocolResolverRegistrar and S3ProtocolResolverRegistrarSpec.groovy * Fix S3JobArchiverImplSpec.groovy * Fix AwsAutoConfigurationSpec.groovy * Fix AwsAutoConfigurationTest * Fix CommonServicesAutoConfigurationTest * Fix AwsAutoConfigurationTest * Fix :genie-common-internal:checkstyleMain * Fix UserRestControllerSpec.groovy * Fix AWSAutoConfigurationTest * Fix GenieExceptionMapperTest * Fix genie-web groovy test * Fix Snippets * Fix JobStateChangeSNSPublisherSpec.groovy * Fix GenieCpuHealthIndicatorSpec.groovy * Fix S3AttachmentServiceImplSpec.groovy * Fix ClusterLeaderServiceCuratorImplSpec * Fix ZookeeperAutoConfiguration * Fix genie-web tests * Fix JpaPersistenceServiceIntegrationTestBase * Update rest-assured dependencies * Fix application, cluster, command, job, criterion entities * Fix jpa job repository * Fix JpaPersistenceServiceImpl * Fix JpaPersistenceServiceIntegrationTestBase * Fix RestControllerIntegrationTestBase * migrate off deprecated @MockBean annotation * remove explicit aws.region property * exclude S3TransferManagerAutoConfiguration from integration tests * exclude S3TransferManagerAutoConfiguration from the genie-agent app * exclude S3TransferManagerAutoConfiguration from the genie app * checkstyle * update io.zipkin.brave:brave to v6 that's aligned with Spring Boot 3 * update to latest Spring Boot 3 * Add threshold to avoid infinite loop waiting for job running and job done * use deep stubs for mocks and disable bean overriding * remove AutoConfiguration.imports from licencing * use MySQLDialect for hibernate as MySQL8Dialect is deprecated * Fix testForTooManyCommandArgs * Fix canHandleBadInputToCreateCommand * update grpc proto and other oss dependency versions * add sleep to validate an assumption that requests are made too early * exclude jetty from genie-web integration test * reduce the max iterations from 100 to 60 * exclude CommonTracingAutoConfiguration.class from import to avoid bean conflicts with the custom mock * use Spring Boot BOM recommendation and update relocated libraries * remove redundant exclude * Fix canCreateClusterWithoutId in ClusterRestControllerIntegrationTest * Amend JobRestControllerIntegrationTest * Amend ClusterRestControllerIntegrationTest * Revert "add sleep to validate an assumption that requests are made too early" This reverts commit 0434935. * Amend ClusterRestControllerIntegrationTest * upgrade grpc_version=1.50.2 and netty_version=4.1.86.Final * cleanup * Fix GRpcAgentJobKillServiceImpl and GRpcAgentJobKillServiceImplSpec * Fix S3JobArchiverImpl and S3JobArchiverImplSpec * Fix JobRestControllerIntegrationTest * update to OSS Spring Boot 3.4.5 and align Netty version with OSS * set netty_version=4.1.100.Final * upgrade grpc_version to 1.63.1 * upgrade protobuf_version to 3.25.5 * patch update of protobuf plugin version * fix some deprecation warnings * migrate off deprecated Gradle Enterprise plugin * update rest assured deps * fix warn message placeholder * fix some Gradle deprecation warnings * turn off html.required for test reports * Fix testSubmitJobMethodSuccess in JobRestControllerIntegrationTest * clean up comments * Turn off spring.jpa.hibernate.ddl-auto for now * Add org.flywaydb:flyway-database-postgresql * Revert "turn off html.required for test reports" This reverts commit 9343acd. * Update GRADLE_OPTS in genie-build.yml * Fix to the Snippets issue * Revert "update rest assured deps" This reverts commit 02d62f3. * Fix to the Snippets issue * Fix to the Snippets issue * Turn off html.enabled for test reports * update org.hibernate.validator:hibernate-validator * update rest assured deps * fix AWSCredentialsProvider bean creation * Amend LeaderElectionActuator * Fix spring actuators package-info with jakarta * Rebuild LeaderElectionActuator * Amend LeaderElectionActuator to throw exceptions * Amend GRpcAgentJobKillServiceImpl * update SpringDoc as version 1 is incompatible with Spring Boot 3 (#1232) * pick up OSS Spring Boot 3.4.6 (#1233) --------- Co-authored-by: Binbing Hou <[email protected]> Co-authored-by: Iuliia Sobolevska <[email protected]> Co-authored-by: Zhuoran Dong <[email protected]>
1 parent b7ad907 commit b5e39ad

File tree

332 files changed

+25958
-1883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+25958
-1883
lines changed

.github/workflows/genie-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
DOCKER_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_DOCKERHUB_PASSWORD }}
4242
GRGIT_USER: ${{ secrets.GRGIT_USER }}
4343
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
44-
GRADLE_OPTS: -Djava.io.tmpdir=/tmp/
44+
GRADLE_OPTS: -Djava.io.tmpdir=/tmp/ --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
4545
steps:
4646
- uses: actions/checkout@v1
4747
- name: Configure MySQL database
@@ -95,7 +95,7 @@ jobs:
9595
((!startsWith(github.ref, 'refs/tags/v')) && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev-snapshot')
9696
run: |
9797
./gradlew --stacktrace build codeCoverageReport coveralls
98-
INTEGRATION_TEST_DB=mysql ./gradlew --stacktrace genie-web:integrationTest
98+
INTEGRATION_TEST_DB=mysql ./gradlew --stacktrace genie-web:integrationTest genie-web:createAllMissingSnippets genie-web:asciidoctor
9999
INTEGRATION_TEST_DB=postgresql ./gradlew --stacktrace genie-web:integrationTest
100100
./gradlew --stacktrace javadoc asciidoc dockerBuildAllImages
101101
- name: Publish snapshot

build.gradle

Lines changed: 86 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import com.github.spotbugs.snom.SpotBugsTask
22
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
3-
import org.springframework.boot.gradle.plugin.SpringBootPlugin
43

54
buildscript {
65
repositories {
@@ -19,10 +18,10 @@ plugins {
1918
id "com.netflix.nebula.facet" version "11.0.0" apply false
2019
id "org.ajoberstar.grgit" version "4.1.1"
2120
id "org.ajoberstar.git-publish" version "3.0.1"
22-
id "org.springframework.boot" version "${spring_boot_version}" apply false
21+
id "org.springframework.boot" version "${spring_boot_3_version}" apply false
2322
id "org.asciidoctor.jvm.convert" version "3.3.2" apply false
2423
id "com.gorylenko.gradle-git-properties" version "2.3.2" apply false
25-
id "com.google.protobuf" version "0.8.18" apply false
24+
id "com.google.protobuf" version "0.8.19" apply false
2625
id "io.franzbecker.gradle-lombok" version "5.0.0" apply false
2726
id "nebula.node" version "2.0.1" apply false
2827
id "com.github.spotbugs" version "5.2.5" apply false
@@ -36,6 +35,8 @@ ext.javaProjects = subprojects.findAll {
3635
it.name != "genie-demo" && it.name != "genie-ddl" && it.name != "genie-docs"
3736
}
3837

38+
def springBoot3ProjectNames = ['genie-agent', 'genie-agent-app', 'genie-app', 'genie-common-internal', 'genie-swagger', 'genie-ui', 'genie-web']
39+
3940
allprojects {
4041
apply plugin: "jacoco"
4142
apply plugin: "idea"
@@ -44,6 +45,10 @@ allprojects {
4445
repositories {
4546
mavenCentral()
4647
}
48+
49+
tasks.withType(JavaExec) {
50+
jvmArgs += ["--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"]
51+
}
4752
}
4853

4954
idea {
@@ -54,8 +59,8 @@ idea {
5459
}
5560
module {
5661
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_1_8)
57-
downloadJavadoc true
58-
downloadSources true
62+
downloadJavadoc = true
63+
downloadSources = true
5964
}
6065
}
6166

@@ -93,14 +98,31 @@ configure((Set<Project>) ext.javaProjects) {
9398
}
9499

95100
dependencyManagement {
101+
if (springBoot3ProjectNames.contains(project.name)) {
102+
imports {
103+
mavenBom "org.springframework.boot:spring-boot-dependencies:${spring_boot_3_version}"
104+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${spring_cloud_3_version}"
105+
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:${spring_cloud_aws_3_version}"
106+
mavenBom "org.spockframework:spock-bom:2.4-M5-groovy-3.0"
107+
}
108+
dependencies {
109+
dependency("io.awspring.cloud:spring-cloud-aws-starter:${spring_cloud_aws_3_version}")
110+
}
111+
} else {
112+
imports {
113+
mavenBom "org.springframework.boot:spring-boot-dependencies:${spring_boot_2_version}"
114+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${spring_cloud_2_version}"
115+
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:${spring_cloud_aws_2_version}"
116+
mavenBom "org.spockframework:spock-bom:2.0-groovy-3.0"
117+
}
118+
}
119+
96120
imports {
97-
mavenBom SpringBootPlugin.BOM_COORDINATES
98-
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${spring_cloud_version}"
99-
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:2.4.1"
121+
mavenBom "software.amazon.awssdk:bom:2.30.17"
100122
mavenBom "com.google.protobuf:protobuf-bom:${protobuf_version}"
101123
mavenBom "com.squareup.okhttp3:okhttp-bom:4.9.2"
102124
mavenBom "io.grpc:grpc-bom:${grpc_version}"
103-
mavenBom "org.spockframework:spock-bom:2.0-groovy-3.0"
125+
mavenBom "io.netty:netty-bom:${netty_version}"
104126
mavenBom "org.testcontainers:testcontainers-bom:1.16.3"
105127
}
106128
dependencies {
@@ -128,10 +150,21 @@ configure((Set<Project>) ext.javaProjects) {
128150
dependency("org.codehaus.groovy:groovy-all:3.0.9")
129151
dependency("org.codehaus.janino:janino:3.1.6")
130152
dependency("org.dbunit:dbunit:2.7.3")
131-
dependencySet(group: "org.springdoc", version: "1.6.6") {
132-
entry "springdoc-openapi-hateoas"
133-
entry "springdoc-openapi-ui"
134-
entry "springdoc-openapi-webmvc-core"
153+
dependencySet(group: "org.springdoc", version: "2.8.8") {
154+
entry "springdoc-openapi-starter-webmvc-api"
155+
entry "springdoc-openapi-starter-webmvc-ui"
156+
}
157+
dependencySet(group: "io.netty", version: "${netty_version}") {
158+
entry "netty-buffer"
159+
entry "netty-codec"
160+
entry "netty-codec-http"
161+
entry "netty-codec-http2"
162+
entry "netty-common"
163+
entry "netty-handler"
164+
entry "netty-resolver"
165+
entry "netty-transport"
166+
entry "netty-transport-native-epoll"
167+
entry "netty-transport-native-unix-common"
135168
}
136169
}
137170
}
@@ -156,7 +189,7 @@ configure((Set<Project>) ext.javaProjects) {
156189
}
157190

158191
configurations {
159-
all*.exclude group: "javax.servlet", module: "servlet-api"
192+
all*.exclude group: "org.apache.groovy" // exclude groovy@4 dependencies
160193
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
161194
}
162195

@@ -168,7 +201,18 @@ configure((Set<Project>) ext.javaProjects) {
168201
annotationProcessor("net.jcip:jcip-annotations")
169202
annotationProcessor("com.github.spotbugs:spotbugs-annotations")
170203

171-
implementation("javax.annotation:javax.annotation-api:1.3.2")
204+
if (springBoot3ProjectNames.contains(project.name)) {
205+
implementation("org.springframework.boot:spring-boot-actuator-autoconfigure")
206+
implementation("io.awspring.cloud:spring-cloud-aws-starter-s3:${spring_cloud_aws_3_version}")
207+
implementation("io.micrometer:micrometer-tracing-bridge-brave")
208+
implementation("jakarta.servlet:jakarta.servlet-api")
209+
implementation("jakarta.validation:jakarta.validation-api")
210+
implementation("org.hibernate.validator:hibernate-validator")
211+
implementation("jakarta.el:jakarta.el-api")
212+
implementation("io.zipkin.reporter2:zipkin-reporter")
213+
} else {
214+
implementation("javax.annotation:javax.annotation-api:1.3.2")
215+
}
172216

173217
/*******************************
174218
* Compile Dependencies
@@ -205,15 +249,14 @@ configure((Set<Project>) ext.javaProjects) {
205249
testCompileOnly("com.github.spotbugs:spotbugs-annotations")
206250

207251
testRuntimeOnly("jakarta.el:jakarta.el-api")
208-
testRuntimeOnly("org.glassfish:jakarta.el")
209252
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
210253
}
211254

212-
task removeGeneratedSources(type: Delete) {
255+
tasks.register('removeGeneratedSources', Delete) {
213256
project.generatedSourcesDir.deleteDir()
214257
}
215258

216-
task removeIdeaOutDirectory(type: Delete) {
259+
tasks.register('removeIdeaOutDirectory', Delete) {
217260
file("${projectDir}/out").deleteDir()
218261
}
219262

@@ -260,7 +303,12 @@ configure((Set<Project>) ext.javaProjects) {
260303
systemProperty "spring.profiles.include", "githubactions"
261304
}
262305

263-
reports.html.destination(new File("${reporting.baseDir}/test/${task.name}"))
306+
reports {
307+
html.required = false
308+
junitXml.required = true
309+
}
310+
311+
// reports.html.outputLocation = new File("${reporting.baseDirectory}/test/${task.name}")
264312
(jacocoTestReport.getExecutionData() + files("$buildDir/jacoco/${task.name}.exec"))
265313

266314
// Customize test logging on CI and everywhere else
@@ -276,7 +324,7 @@ configure((Set<Project>) ext.javaProjects) {
276324

277325
licenseMain.dependsOn compileJava
278326
license {
279-
ignoreFailures false
327+
ignoreFailures = false
280328
}
281329

282330
checkstyle {
@@ -326,9 +374,9 @@ task codeCoverageReport(type: JacocoReport, group: "Coverage reports") {
326374

327375
reports {
328376
xml.getRequired().set(true)
329-
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
377+
xml.outputLocation = new File("${buildDir}/reports/jacoco/report.xml")
330378
html.getRequired().set(true)
331-
html.destination new File("${buildDir}/reports/jacoco/html")
379+
html.outputLocation = new File("${buildDir}/reports/jacoco/html")
332380
csv.getRequired().set(false)
333381
}
334382
afterEvaluate {
@@ -371,7 +419,9 @@ tasks.coveralls {
371419
* Github Pages Tasks
372420
**********************************/
373421

374-
task collectDocumentation(group: "documentation", description: "Copy the documentation from sub-projects") {
422+
tasks.register('collectDocumentation') {
423+
group = "documentation"
424+
description = "Copy the documentation from sub-projects"
375425
dependsOn "aggregateJavadocs"
376426

377427
def restDocs = new File(project(":genie-web").buildDir, "docs/asciidoc")
@@ -484,22 +534,28 @@ ext.getDockerTags = { String appName, String projectVersion ->
484534
return tags
485535
}
486536

487-
task dockerLogout(type: Exec, group: "Docker", description: "Logout of docker hub") {
537+
tasks.register('dockerLogout', Exec) {
538+
group = "Docker"
539+
description = "Logout of docker hub"
488540
onlyIf {
489541
rootProject.ext.isDockerRunning()
490542
}
491543
commandLine "docker", "logout"
492544
}
493545

494-
task dockerLogin(type: Exec, group: "Docker", description: "Login to docker hub using DOCKER_USER and DOCKER_PASSWORD environment variables") {
546+
tasks.register('dockerLogin', Exec) {
547+
group = "Docker"
548+
description = "Login to docker hub using DOCKER_USER and DOCKER_PASSWORD environment variables"
495549
onlyIf {
496550
rootProject.ext.isDockerRunning()
497551
}
498552
dependsOn tasks.dockerLogout
499553
commandLine "docker", "login", "-u", System.getenv("DOCKER_USER") ?: "", "-p", System.getenv("DOCKER_PASSWORD") ?: ""
500554
}
501555

502-
task dockerBuildAllImages(group: "Docker", description: "Container task for all docker image builds") {
556+
tasks.register('dockerBuildAllImages') {
557+
group = "Docker"
558+
description = "Container task for all docker image builds"
503559
onlyIf {
504560
rootProject.ext.isDockerRunning()
505561
}
@@ -508,10 +564,10 @@ task dockerBuildAllImages(group: "Docker", description: "Container task for all
508564
dependsOn ":genie-demo:dockerBuildClientImage"
509565
}
510566

511-
gradleEnterprise {
567+
develocity {
512568
buildScan {
513-
publishAlways()
514-
termsOfServiceUrl = "https://gradle.com/terms-of-service"
515-
termsOfServiceAgree = "yes"
569+
publishing.onlyIf { true }
570+
termsOfUseUrl = "https://gradle.com/terms-of-service"
571+
termsOfUseAgree = "yes"
516572
}
517573
}

config/checkstyle/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304

305305
<!-- Checks for long lines. -->
306306
<module name="LineLength">
307-
<property name="max" value="120"/>
307+
<property name="max" value="150"/>
308308
<property name="ignorePattern" value="\$File.*\$"/>
309309
</module>
310310

dependencies.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"jacocoAgent": {
3+
"org.jacoco:org.jacoco.agent": {
4+
"locked": "0.8.12"
5+
}
6+
},
7+
"jacocoAnt": {
8+
"org.jacoco:org.jacoco.ant": {
9+
"locked": "0.8.12"
10+
}
11+
}
12+
}

genie-agent-app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232

3333
implementation(project(":genie-agent"))
3434
implementation("org.springframework.boot:spring-boot-starter")
35+
implementation("org.springframework.boot:spring-boot-starter-web")
3536

3637
/*******************************
3738
* Compile Only Dependencies
@@ -46,6 +47,7 @@ dependencies {
4647
*******************************/
4748

4849
testImplementation(project(":genie-test"))
50+
testImplementation("org.springframework.boot:spring-boot-starter-web")
4951
}
5052

5153
springBoot {

0 commit comments

Comments
 (0)