Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps OS to 3.0.0-alpha1 and JDK 21 #791

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
strategy:
matrix:
java:
- 11
- 17
- 21
- 23
fail-fast: false
runs-on: [ubuntu-latest]
name: Building PA package
Expand Down Expand Up @@ -66,6 +66,6 @@ jobs:
- name: Run Integration Tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew integTest -Dtests.enableIT -Dtests.useDockerCluster
- name: Run PerformanceAnalzyer Backwards Compatibility Tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew bwcTestSuite -Dtests.security.manager=false
#- name: Run PerformanceAnalzyer Backwards Compatibility Tests
# working-directory: ./tmp/performance-analyzer
# run: ./gradlew bwcTestSuite -Dtests.security.manager=false
146 changes: 19 additions & 127 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
buildscript {

ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-alpha1-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1")

default_bwc_version = System.getProperty("bwc.version", "2.18.0.0")
pa_bwc_version = System.getProperty("tests.bwc.version", default_bwc_version)
baseName = "paBwcCluster"

// The PA Commons (https://github.com/opensearch-project/performance-analyzer-commons)
// is a library dependency with hardcoded versioning in PA and RCA repos.
paCommonsVersion = "1.6.0"
paCommonsVersion = "2.0.0"

// 3.0.0-SNAPSHOT -> 3.0.0.0-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
Expand All @@ -26,7 +26,7 @@ buildscript {
}
if (isSnapshot) {
opensearch_build += "-SNAPSHOT"
paCommonsVersion += "-SNAPSHOT"
//paCommonsVersion += "-SNAPSHOT"

}
}
Expand All @@ -53,7 +53,7 @@ plugins {
id 'com.diffplug.spotless' version '6.25.0'
id 'checkstyle'
id 'org.ajoberstar.grgit' version '5.0.0'
id 'org.gradle.test-retry' version '1.5.2'
id 'org.gradle.test-retry' version '1.6.1'

}

Expand Down Expand Up @@ -138,8 +138,8 @@ opensearchplugin {
classname 'org.opensearch.performanceanalyzer.PerformanceAnalyzerPlugin'
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

compileJava {
dependsOn spotlessApply
Expand Down Expand Up @@ -212,7 +212,7 @@ tasks.withType(JavaCompile) {
}

jacoco {
toolVersion = "0.8.11"
toolVersion = "0.8.12"
}

jacocoTestReport {
Expand Down Expand Up @@ -301,8 +301,8 @@ dependencies {

implementation 'org.jooq:jooq:3.10.8'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'org.bouncycastle:bcprov-jdk15to18:1.78.1'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'
implementation 'org.bouncycastle:bcprov-jdk18on:1.78'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78'
implementation "org.opensearch:performance-analyzer-commons:${paCommonsVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonDataBindVersion}"
Expand Down Expand Up @@ -458,85 +458,6 @@ static def propEnabled(property) {
return System.getProperty(property) != null && System.getProperty(property).toLowerCase().equals("true")
}

// The following Gradle tasks are used to create a PA/RCA enabled OpenSearch cluster
// Pass the -Dtests.enableIT property to Gradle to run ITs

/**
* cloneRcaGitRepo clones the performance-analyzer-rca repo if the -Dtests.enableIT=true flag is passed
* to the Gradle JVM
*/
task cloneRcaGitRepo() {
def destination = file(rcaProjectDir)
def uri = rcaProjectRepo
def fetch = rcaProjectFetch
def branch = rcaProjectBranch
if (!branch.startsWith(fetch)) { // to avoid checking out origin/origin/branch
branch = rcaProjectFetch + "/" + rcaProjectBranch
}
doFirst {
println "Cloning performance-analyzer-rca into ${rcaProjectDir} from ${rcaProjectRepo}#${rcaProjectBranch}"
}
doLast {
if (destination.exists() && destination.isDirectory()) { // If directory exists, use this instead.
def grgit = Grgit.open(dir: destination.toString())
} else { // Otherwise pull it from git.
def grgit = Grgit.clone(dir: destination.toString(), uri: uri)
grgit.fetch(remote: fetch)
grgit.checkout(branch: branch)
}
}
}

task buildRca() {
dependsOn(cloneRcaGitRepo)

doFirst {
logger.info("Building performance-analyzer-rca project in ${rcaProjectDir} with -Dopensearch.version=${opensearch_version}")
}

doLast {
exec {
workingDir("$rcaProjectDir")
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
commandLine './gradlew', 'build', '-x', 'test', '-x', 'jacocoTestCoverageVerification', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
}
else {
commandLine './gradlew', 'build', '-x', 'test', '-x', 'jacocoTestCoverageVerification', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
}
}
exec {
workingDir("$rcaProjectDir")
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
}
else {
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
}
}
exec {
def licenseDir = "$projectDir/licenses"
workingDir("$licenseDir")
commandLine 'rm', "-f", "performanceanalyzer-rca-${version}.jar.sha1"
}
}
}

buildRca.finalizedBy updateShas

// This value is set by the unpackRca task
def rcaArtifactsDir

task unpackRca(type: Copy) {
dependsOn(buildRca)
from(zipTree("$rcaProjectDir/build/distributions/performance-analyzer-rca-${version}.zip")) {
}
into "$rcaProjectDir/build/distributions"
rcaArtifactsDir = "$rcaProjectDir/build/distributions/performance-analyzer-rca/"

doLast {
logger.info("Unpacked performance-analyzer-rca artifacts into ${rcaProjectDir}")
}
}

tasks.withType(Test) {
jvmArgs('--add-opens=java.base/sun.security.jca=ALL-UNNAMED')
Expand All @@ -549,17 +470,6 @@ tasks.withType(Test) {


bundlePlugin {
dependsOn 'unpackRca'
from("$rcaArtifactsDir/config") {
into "config"
}
from("$rcaArtifactsDir/bin") {
into "bin"
include "performance-analyzer-agent"
}
from("$rcaArtifactsDir") {
into "performance-analyzer-rca"
}
from("packaging") {
include "performance-analyzer-agent-cli"
into "bin"
Expand All @@ -572,23 +482,6 @@ bundlePlugin {
}
}

/**
* setupOpenSearchCluster spins up a local 2 node OpenSearch cluster using the enableRca task in the performance-analyzer-rca
* repo. The performance-analyzer-rca repo is cloned as part of the cloneRcaGitRepo task.
*/
task setupOpenSearchCluster() {
dependsOn(cloneRcaGitRepo)
onlyIf = {
propEnabled("tests.enableIT")
}
doLast {
exec {
workingDir(rcaProjectDir)
commandLine './gradlew', 'enableRca'
}
sleep(30000)
}
}

/**
* integTest is a task provided by the OpenSearch test framework, which allows us to spin up clients
Expand Down Expand Up @@ -635,9 +528,9 @@ task integTest(type: RestIntegTestTask) {
}

tasks.named("check").configure { dependsOn(integTest) }
Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin");
integTest.dependsOn(bundle)
integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))}
//Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin");
//integTest.dependsOn(bundle)
//integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))}

def opensearch_tmp_dir = rootProject.file('build/private/opensearch_tmp').absoluteFile
opensearch_tmp_dir.mkdirs()
Expand Down Expand Up @@ -694,17 +587,17 @@ List<Provider<RegularFile>> plugins = []

// Ensure the artifact for the current project version is available to be used for the bwc tests
task prepareBwcTests {
dependsOn bundle
doLast {
plugins = [ project.getObjects().fileProperty().value(bundle.getArchiveFile()) ]
}
//dependsOn bundle
//doLast {
// plugins = [ project.getObjects().fileProperty().value(bundle.getArchiveFile()) ]
// }
}


// Creates 2 test clusters with 3 nodes of the old version.
2.times {i ->
task "${baseName}#oldVersionClusterTask$i"(type: StandaloneRestIntegTestTask) {
dependsOn 'prepareBwcTests'
//dependsOn 'prepareBwcTests'
useCluster testClusters."${baseName}$i"
filter {
includeTestsMatching "org.opensearch.performanceanalyzer.bwc.*IT"
Expand Down Expand Up @@ -817,7 +710,7 @@ run {
cluster.waitForAllConditions()
}
}
useCluster testClusters.integTest
//useCluster testClusters.integTest
}

// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
Expand Down Expand Up @@ -901,7 +794,6 @@ afterEvaluate {
}
}

bundlePlugin.mustRunAfter unpackRca

// updateVersion: Task to auto increment to the next development iteration
task updateVersion {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-all.zip
validateDistributionUrl=true
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (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.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +83,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down
1 change: 0 additions & 1 deletion licenses/bcpkix-jdk15to18-1.78.1.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/bcpkix-jdk18on-1.78.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dd61bcdb87678451dd42d42e267979bd4b4451a1
1 change: 0 additions & 1 deletion licenses/bcprov-jdk15to18-1.78.1.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions licenses/bcprov-jdk18on-1.78.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

package org.opensearch.performanceanalyzer;

import org.opensearch.client.Client;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.indices.breaker.CircuitBreakerService;
import org.opensearch.env.Environment;
import org.opensearch.indices.IndicesService;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.client.Client;

public final class OpenSearchResources {
public static final OpenSearchResources INSTANCE = new OpenSearchResources();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.opensearch.SpecialPermission;
import org.opensearch.action.ActionRequest;
import org.opensearch.action.support.ActionFilter;
import org.opensearch.client.Client;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -105,6 +104,7 @@
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport;
import org.opensearch.transport.TransportInterceptor;
import org.opensearch.transport.client.Client;
import org.opensearch.watcher.ResourceWatcherService;

public final class PerformanceAnalyzerPlugin extends Plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Field getClusterManagerServiceTPExecutorField() throws NoSuchFieldException {
// Currently ClusterManagerService extends MasterService, remove getSuperClass(),
// once MasterService contents are moved and class is removed.
Field threadPoolExecutorField =
ClusterManagerService.class.getSuperclass().getDeclaredField("threadPoolExecutor");
ClusterManagerService.class.getDeclaredField("threadPoolExecutor");
threadPoolExecutorField.setAccessible(true);
return threadPoolExecutorField;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.node.NodeClient;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.common.xcontent.XContentType;
Expand All @@ -27,6 +26,7 @@
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestRequest;
import org.opensearch.transport.client.node.NodeClient;

/**
* Rest request handler for handling cluster-wide enabling and disabling of performance analyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.node.NodeClient;
import org.opensearch.common.inject.Inject;
import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.core.rest.RestStatus;
Expand All @@ -24,6 +23,7 @@
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestRequest;
import org.opensearch.transport.client.node.NodeClient;

@SuppressWarnings("deprecation")
public class PerformanceAnalyzerConfigAction extends BaseRestHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.client.node.NodeClient;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.common.xcontent.XContentType;
Expand All @@ -27,6 +26,7 @@
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestRequest;
import org.opensearch.transport.client.node.NodeClient;

/** Rest request handler for handling config overrides for various performance analyzer features. */
public class PerformanceAnalyzerOverridesClusterConfigAction extends BaseRestHandler {
Expand Down
Loading
Loading