From 1b61512afa70c5058e47241986321288605faaa5 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Sat, 23 Dec 2023 17:17:39 +0800 Subject: [PATCH 01/10] Change job-scheduler plguin group to point to correct localtion Signed-off-by: zane-neo --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 658942a8..997264aa 100644 --- a/build.gradle +++ b/build.gradle @@ -122,7 +122,6 @@ dependencies { // ZipArchive dependencies used for integration tests zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${version}" - //JS plugin is published to `org/opensearch` instead of `org/opensearch/plugin` under local maven repo: https://mvnrepository.com/artifact/org.opensearch/opensearch-job-scheduler. zipArchive group: 'org.opensearch', name:'opensearch-job-scheduler', version: "${version}" zipArchive "org.opensearch.plugin:opensearch-anomaly-detection:${version}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}" From 18ca6432c17ebffbe353631c0967f07d83eb0c6e Mon Sep 17 00:00:00 2001 From: zane-neo Date: Mon, 25 Dec 2023 15:47:16 +0800 Subject: [PATCH 02/10] add dependency task to publishToStagingRepo Signed-off-by: zane-neo --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 997264aa..da46ec36 100644 --- a/build.gradle +++ b/build.gradle @@ -164,6 +164,7 @@ tasks.addJarsToClasspath.dependsOn(extractJsJar) tasks.addJarsToClasspath.dependsOn(extractAdJar) project.tasks.delombok.dependsOn(addJarsToClasspath) tasks.publishNebulaPublicationToMavenLocal.dependsOn ':generatePomFileForPluginZipPublication' +tasks.publishNebulaPublicationToStagingRepository.dependsOn ':generatePomFileForPluginZipPublication' tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication' dependencyLicenses.enabled = false From 80643140401e71207b8bff817b2c57a7ceb3e37f Mon Sep 17 00:00:00 2001 From: zane-neo Date: Mon, 25 Dec 2023 17:00:28 +0800 Subject: [PATCH 03/10] Fix publishAllPublicationsToStagingRepository failure issue Signed-off-by: zane-neo --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index da46ec36..997264aa 100644 --- a/build.gradle +++ b/build.gradle @@ -164,7 +164,6 @@ tasks.addJarsToClasspath.dependsOn(extractJsJar) tasks.addJarsToClasspath.dependsOn(extractAdJar) project.tasks.delombok.dependsOn(addJarsToClasspath) tasks.publishNebulaPublicationToMavenLocal.dependsOn ':generatePomFileForPluginZipPublication' -tasks.publishNebulaPublicationToStagingRepository.dependsOn ':generatePomFileForPluginZipPublication' tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication' dependencyLicenses.enabled = false From a06966c23cff5cc0bb0828dcb654ae38239109c3 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Tue, 26 Dec 2023 09:57:32 +0800 Subject: [PATCH 04/10] add comment to JS plugin path Signed-off-by: zane-neo --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 997264aa..658942a8 100644 --- a/build.gradle +++ b/build.gradle @@ -122,6 +122,7 @@ dependencies { // ZipArchive dependencies used for integration tests zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${version}" + //JS plugin is published to `org/opensearch` instead of `org/opensearch/plugin` under local maven repo: https://mvnrepository.com/artifact/org.opensearch/opensearch-job-scheduler. zipArchive group: 'org.opensearch', name:'opensearch-job-scheduler', version: "${version}" zipArchive "org.opensearch.plugin:opensearch-anomaly-detection:${version}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}" From bdf10a0f2f3065242ec5db77673f59d99f19460c Mon Sep 17 00:00:00 2001 From: zane-neo Date: Wed, 27 Dec 2023 10:39:07 +0800 Subject: [PATCH 05/10] change js dependency to jar Signed-off-by: zane-neo --- build.gradle | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 658942a8..c8463eaf 100644 --- a/build.gradle +++ b/build.gradle @@ -70,15 +70,14 @@ apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.pluginzip' def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin" -def jsJarDirectory = "$buildDir/dependencies/opensearch-job-scheduler" -def adJarDirectory = "$buildDir/dependencies/opensearch-anomaly-detection" +def adJarDirectory = "$buildDir/dependencies/opensearch-time-series-analytics" configurations { zipArchive all { resolutionStrategy { force "org.mockito:mockito-core:${versions.mockito}" - force "com.google.guava:guava:32.1.3-jre" // CVE for 31.1 + force "com.google.guava:guava:33.0.0-jre" // CVE for 31.1 force("org.eclipse.platform:org.eclipse.core.runtime:3.30.0") // CVE for < 3.29.0, forces JDK17 for spotless } } @@ -92,13 +91,8 @@ task addJarsToClasspath(type: Copy) { } into("$buildDir/classes") - from(fileTree(dir: jsJarDirectory)) { - include "opensearch-job-scheduler-${version}.jar" - } - into("$buildDir/classes") - from(fileTree(dir: adJarDirectory)) { - include "opensearch-anomaly-detection-${version}.jar" + include "opensearch-time-series-analytics-${version}.jar" } into("$buildDir/classes") } @@ -108,22 +102,20 @@ dependencies { compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1' compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.22.0" compileOnly group: 'org.json', name: 'json', version: '20231013' - compileOnly("com.google.guava:guava:32.1.3-jre") + compileOnly("com.google.guava:guava:33.0.0-jre") compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' compileOnly group: 'org.apache.commons', name: 'commons-text', version: '1.10.0' // Plugin dependencies compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}" - implementation fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${version}.jar"]) - implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${version}.jar"]) + implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}" + implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"]) compileOnly "org.opensearch:common-utils:${version}" compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" // ZipArchive dependencies used for integration tests zipArchive group: 'org.opensearch.plugin', name:'opensearch-ml-plugin', version: "${version}" - //JS plugin is published to `org/opensearch` instead of `org/opensearch/plugin` under local maven repo: https://mvnrepository.com/artifact/org.opensearch/opensearch-job-scheduler. - zipArchive group: 'org.opensearch', name:'opensearch-job-scheduler', version: "${version}" zipArchive "org.opensearch.plugin:opensearch-anomaly-detection:${version}" zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}" @@ -148,12 +140,6 @@ task extractSqlJar(type: Copy) { into sqlJarDirectory } -task extractJsJar(type: Copy) { - mustRunAfter() - from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-job-scheduler")})) - into jsJarDirectory -} - task extractAdJar(type: Copy) { mustRunAfter() from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-anomaly-detection")})) @@ -364,4 +350,4 @@ task updateVersion { // Include the required files that needs to be updated with new Version ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) } -} \ No newline at end of file +} From e64bf7a0214e54ba02b97463f2122c5742d9279e Mon Sep 17 00:00:00 2001 From: zane-neo Date: Wed, 27 Dec 2023 10:42:07 +0800 Subject: [PATCH 06/10] change ad dependency to jar Signed-off-by: zane-neo --- build.gradle | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index c8463eaf..260bbf53 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,6 @@ apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.pluginzip' def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin" -def adJarDirectory = "$buildDir/dependencies/opensearch-time-series-analytics" configurations { zipArchive @@ -91,10 +90,6 @@ task addJarsToClasspath(type: Copy) { } into("$buildDir/classes") - from(fileTree(dir: adJarDirectory)) { - include "opensearch-time-series-analytics-${version}.jar" - } - into("$buildDir/classes") } dependencies { @@ -109,7 +104,8 @@ dependencies { // Plugin dependencies compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}" implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}" - implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) + implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}" +// implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"]) compileOnly "org.opensearch:common-utils:${version}" compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" @@ -140,15 +136,7 @@ task extractSqlJar(type: Copy) { into sqlJarDirectory } -task extractAdJar(type: Copy) { - mustRunAfter() - from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-anomaly-detection")})) - into adJarDirectory -} - tasks.addJarsToClasspath.dependsOn(extractSqlJar) -tasks.addJarsToClasspath.dependsOn(extractJsJar) -tasks.addJarsToClasspath.dependsOn(extractAdJar) project.tasks.delombok.dependsOn(addJarsToClasspath) tasks.publishNebulaPublicationToMavenLocal.dependsOn ':generatePomFileForPluginZipPublication' tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication' @@ -192,8 +180,6 @@ spotless { compileJava { dependsOn extractSqlJar - dependsOn extractJsJar - dependsOn extractAdJar dependsOn delombok options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) } From 65d36f4cdc9b22525424f873fb8afef70ba2fbca Mon Sep 17 00:00:00 2001 From: zane-neo Date: Wed, 27 Dec 2023 14:12:26 +0800 Subject: [PATCH 07/10] Fix version conflicts in test dependencies Signed-off-by: zane-neo --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 260bbf53..8ed5f60f 100644 --- a/build.gradle +++ b/build.gradle @@ -78,6 +78,8 @@ configurations { force "org.mockito:mockito-core:${versions.mockito}" force "com.google.guava:guava:33.0.0-jre" // CVE for 31.1 force("org.eclipse.platform:org.eclipse.core.runtime:3.30.0") // CVE for < 3.29.0, forces JDK17 for spotless + force "com.google.code.gson:gson:2.10.1" + force "org.apache.commons:commons-lang3:3.13.0" } } } From 870886b0814957c90e6992733b24273522b93386 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Wed, 27 Dec 2023 15:40:56 +0800 Subject: [PATCH 08/10] Revert ad jar to plugin to fix ad jar not found issue Signed-off-by: zane-neo --- build.gradle | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8ed5f60f..5aa7de8f 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,7 @@ apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.pluginzip' def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin" +def adJarDirectory = "$buildDir/dependencies/opensearch-time-series-analytics" configurations { zipArchive @@ -92,6 +93,10 @@ task addJarsToClasspath(type: Copy) { } into("$buildDir/classes") + from(fileTree(dir: adJarDirectory)) { + include "opensearch-time-series-analytics-${version}.jar" + } + into("$buildDir/classes") } dependencies { @@ -106,8 +111,9 @@ dependencies { // Plugin dependencies compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}" implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}" - implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}" -// implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) +// implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}" + //TODO change this to jar dependency once ad successfully published main branch jars. + implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"]) compileOnly "org.opensearch:common-utils:${version}" compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" @@ -138,7 +144,14 @@ task extractSqlJar(type: Copy) { into sqlJarDirectory } +task extractAdJar(type: Copy) { + mustRunAfter() + from(zipTree(configurations.zipArchive.find { it.name.startsWith("opensearch-anomaly-detection")})) + into adJarDirectory +} + tasks.addJarsToClasspath.dependsOn(extractSqlJar) +tasks.addJarsToClasspath.dependsOn(extractAdJar) project.tasks.delombok.dependsOn(addJarsToClasspath) tasks.publishNebulaPublicationToMavenLocal.dependsOn ':generatePomFileForPluginZipPublication' tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication' @@ -182,6 +195,7 @@ spotless { compileJava { dependsOn extractSqlJar + dependsOn extractAdJar dependsOn delombok options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) } From e83ddb6ae85e5ae73e07bfc63c1a8138360c7f3b Mon Sep 17 00:00:00 2001 From: zane-neo Date: Thu, 28 Dec 2023 09:49:22 +0800 Subject: [PATCH 09/10] Remove force versions since no conflicts in depending on plugin Signed-off-by: zane-neo --- build.gradle | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 5aa7de8f..38ec9b56 100644 --- a/build.gradle +++ b/build.gradle @@ -79,8 +79,6 @@ configurations { force "org.mockito:mockito-core:${versions.mockito}" force "com.google.guava:guava:33.0.0-jre" // CVE for 31.1 force("org.eclipse.platform:org.eclipse.core.runtime:3.30.0") // CVE for < 3.29.0, forces JDK17 for spotless - force "com.google.code.gson:gson:2.10.1" - force "org.apache.commons:commons-lang3:3.13.0" } } } @@ -112,7 +110,7 @@ dependencies { compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}" implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}" // implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}" - //TODO change this to jar dependency once ad successfully published main branch jars. + //TODO change this to jar dependency once ad successfully published jars. implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"]) compileOnly "org.opensearch:common-utils:${version}" From 2b631f8474857791cb945450f1fd2c76e4c8a219 Mon Sep 17 00:00:00 2001 From: zane-neo Date: Fri, 29 Dec 2023 10:26:29 +0800 Subject: [PATCH 10/10] Change opensearch-time-series-analytics back to opensearch-anomaly-detection Signed-off-by: zane-neo --- build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 38ec9b56..e218149c 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,7 @@ apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.pluginzip' def sqlJarDirectory = "$buildDir/dependencies/opensearch-sql-plugin" -def adJarDirectory = "$buildDir/dependencies/opensearch-time-series-analytics" +def adJarDirectory = "$buildDir/dependencies/opensearch-anomaly-detection" configurations { zipArchive @@ -92,7 +92,7 @@ task addJarsToClasspath(type: Copy) { into("$buildDir/classes") from(fileTree(dir: adJarDirectory)) { - include "opensearch-time-series-analytics-${version}.jar" + include "opensearch-anomaly-detection-${version}.jar" } into("$buildDir/classes") } @@ -109,9 +109,9 @@ dependencies { // Plugin dependencies compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}" implementation group: 'org.opensearch', name: 'opensearch-job-scheduler', version: "${version}" -// implementation group: 'org.opensearch', name: 'opensearch-time-series-analytics', version: "${version}" +// implementation group: 'org.opensearch', name: 'opensearch-anomaly-detection', version: "${version}" //TODO change this to jar dependency once ad successfully published jars. - implementation fileTree(dir: adJarDirectory, include: ["opensearch-time-series-analytics-${version}.jar"]) + implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${version}.jar"]) implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"]) compileOnly "org.opensearch:common-utils:${version}" compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"