From 48eedf26d67a0d02507af4a4376e1d4f927b9592 Mon Sep 17 00:00:00 2001 From: Sagar Upadhyaya Date: Wed, 6 Apr 2022 12:55:03 -0700 Subject: [PATCH] Adding OS 2.0 related changes Signed-off-by: Sagar Upadhyaya --- .github/workflows/gauntlet-tests-workflow.yml | 2 +- .github/workflows/gradle.yml | 16 +++++----- build.gradle | 30 ++++++++++++++----- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/workflows/gauntlet-tests-workflow.yml b/.github/workflows/gauntlet-tests-workflow.yml index 67dee24ed..552b0ae85 100644 --- a/.github/workflows/gauntlet-tests-workflow.yml +++ b/.github/workflows/gauntlet-tests-workflow.yml @@ -25,4 +25,4 @@ jobs: path: ./tmp/performance-analyzer-rca - name: Build RCA and run Gauntlet tests working-directory: ./tmp/performance-analyzer-rca - run: ./gradlew build -Drun.gauntlet.tests=true -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew build -Drun.gauntlet.tests=true diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index fd85e0fe8..2ce0d5388 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -31,7 +31,7 @@ jobs: path: ./tmp/performance-analyzer-rca - name: Build RCA working-directory: ./tmp/performance-analyzer-rca - run: ./gradlew build --stacktrace -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew build --stacktrace - name: Upload reports uses: actions/upload-artifact@v2 with: @@ -47,21 +47,21 @@ jobs: run: bash <(curl -s https://codecov.io/bash) -f ./build/reports/jacoco/test/jacocoTestReport.xml - name: Publish RCA jar to maven local working-directory: ./tmp/performance-analyzer-rca - run: ./gradlew publishToMavenLocal -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew publishToMavenLocal # PA in ./tmp/performance-analyzer - name: Checkout Performance Analyzer uses: actions/checkout@v2 with: - repository: opensearch-project/performance-analyzer - ref: main + repository: sgup432/performance-analyzer + ref: jdk_gradle_7_OS2 path: ./tmp/performance-analyzer - name: Build PA gradle using the new RCA jar working-directory: ./tmp/performance-analyzer run: rm -f licenses/performanceanalyzer-rca-*.jar.sha1 - name: Update SHA working-directory: ./tmp/performance-analyzer - run: ./gradlew updateShas -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew updateShas - name: Set docker-compose path run: echo "DOCKER_COMPOSE_LOCATION=$(which docker-compose)" >> $GITHUB_ENV # Set the vm.max_map_count system property to the minimum required to run OpenSearch @@ -69,14 +69,14 @@ jobs: run: sudo sysctl -w vm.max_map_count=262144 - name: Build PA and run Unit Tests working-directory: ./tmp/performance-analyzer - run: ./gradlew build -i -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew build # Enable RCA for Integration Tests - name: Spin up Docker cluster for integ testing working-directory: ./tmp/performance-analyzer-rca - run: ./gradlew enableRca -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew enableRca # Run Integration Tests in PA - name: Run integration tests working-directory: ./tmp/performance-analyzer - run: ./gradlew integTest --info --stacktrace -Dtests.enableIT=true -Dopensearch.version=1.3.0-SNAPSHOT + run: ./gradlew integTest --info --stacktrace -Dtests.enableIT=true diff --git a/build.gradle b/build.gradle index ccf37357a..0208f5095 100644 --- a/build.gradle +++ b/build.gradle @@ -52,10 +52,21 @@ distributions { } ext { - opensearch_version = System.getProperty("opensearch.version", "1.3.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.0.0-alpha1-SNAPSHOT") isSnapshot = "true" == System.getProperty("build.snapshot", "true") - gitPaBranch = 'main' - gitPaRepo = "https://github.com/opensearch-project/performance-analyzer.git" + buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1") + + // 2.0.0-alpha1-SNAPSHOT -> 2.0.0.0-alpha1-SNAPSHOT + version_tokens = opensearch_version.tokenize('-') + opensearch_build = version_tokens[0] + '.0' + if (buildVersionQualifier) { + opensearch_build += "-${buildVersionQualifier}" + } + if (isSnapshot) { + opensearch_build += "-SNAPSHOT" + } + gitPaBranch = 'jdk_gradle_7_OS2.0' + gitPaRepo = "https://github.com/sgup432/performance-analyzer.git" runGauntletTests = "true" == System.getProperty("run.gauntlet.tests", "false") } @@ -181,10 +192,7 @@ jacocoTestCoverageVerification { // to run coverage verification during the build (and fail when appropriate) check.dependsOn jacocoTestCoverageVerification -version = opensearch_version - '-SNAPSHOT' + '.0' -if (isSnapshot) { - version += "-SNAPSHOT" -} +version = opensearch_build distZip { archiveName "performance-analyzer-rca-${version}.zip" @@ -411,7 +419,13 @@ task buildPa(type: Exec) { dependsOn(assemble, publishToMavenLocal, regenerateLicenses) workingDir paDir println String.format('pa in dir: (%s) will be built.', paDir) - commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}" + println String.format('opensearch_version: (%s), plugin_version: (%s), snapshot: (%s), qualifier: (%s).', opensearch_version, version, isSnapshot, buildVersionQualifier) + if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') { + commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}" + } + else { + commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}" + } println "PA repo located at '" + paDir + "' will be used." }