-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix snapshot build using OpenSearch 1.1. #53
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
buildscript { | ||
|
||
ext { | ||
opensearch_version = System.getProperty("opensearch.version", "1.0.0") | ||
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT") | ||
} | ||
|
||
// Used to resolve build file dependencies | ||
|
@@ -68,21 +68,21 @@ spotbugsTest { | |
} | ||
|
||
ext { | ||
opensearchVersion = '1.0.0' | ||
isSnapshot = "true" == System.getProperty("build.snapshot", "true") | ||
|
||
// The RCA branch that will be built. Default value is main. | ||
rcaProjectBranch = findProperty("performance-analyzer-rca.branch") ?: "main" | ||
// The RCA branch that will be built. Default branch is main. | ||
rcaProjectRepo = System.getProperty("performance-analyzer-rca.repo", "https://github.com/opensearch-project/performance-analyzer-rca.git") | ||
rcaProjectBranch = System.getProperty("performance-analyzer-rca.branch", "main") | ||
|
||
// If true, then the build will clone the RCA Project into $rcaProjectDir | ||
cloneRcaProject = "true" == System.getProperty("performance-analyzer-rca.build", "true") | ||
|
||
// By default we will look for RCA in a peer directory | ||
rcaProjectDir = findProperty("performance-analyzer-rca.path") ?: "../performance-analyzer-rca" | ||
rcaProjectDir = System.getProperty("performance-analyzer-rca.path", "../performance-analyzer-rca") | ||
} | ||
|
||
group = "org.opensearch" | ||
version = "${opensearchVersion}.0" | ||
version = opensearch_version - '-SNAPSHOT' + '.0' | ||
if (isSnapshot) { | ||
version += "-SNAPSHOT" | ||
} | ||
|
@@ -248,7 +248,7 @@ dependencies { | |
compile 'org.apache.commons:commons-lang3:3.9' | ||
compile 'org.bouncycastle:bcprov-jdk15on:1.68' | ||
compile 'org.bouncycastle:bcpkix-jdk15on:1.68' | ||
compile 'org.opensearch:performanceanalyzer-rca:1.0.0.0' | ||
compile "org.opensearch:performanceanalyzer-rca:${version}" | ||
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" | ||
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" | ||
compile "com.fasterxml.jackson.module:jackson-module-paranamer:${jacksonVersion}" | ||
|
@@ -311,53 +311,54 @@ static def propEnabled(property) { | |
// Pass the -Dtests.enableIT property to Gradle to run ITs | ||
|
||
/** | ||
* cloneGitRepo clones the performance-analyzer-rca repo if the -Dtests.enableIT=true flag is passed | ||
* cloneRcaGitRepo clones the performance-analyzer-rca repo if the -Dtests.enableIT=true flag is passed | ||
* to the Gradle JVM | ||
*/ | ||
task cloneGitRepo(type: GitClone) { | ||
task cloneRcaGitRepo(type: GitClone) { | ||
def destination = file(rcaProjectDir) | ||
uri = "https://github.com/opensearch-project/performance-analyzer-rca.git" | ||
uri = rcaProjectRepo | ||
branch = rcaProjectBranch | ||
destinationPath = destination | ||
bare = false | ||
enabled = cloneRcaProject && !destination.exists() // to clone only once | ||
|
||
doFirst { | ||
logger.info("Cloning performance-analyzer-rca into ${rcaProjectDir}") | ||
logger.info("Cloning performance-analyzer-rca into ${rcaProjectDir} from ${rcaProjectRepo}#${rcaProjectBranch}") | ||
} | ||
} | ||
|
||
task buildRca() { | ||
dependsOn(cloneGitRepo) | ||
dependsOn(cloneRcaGitRepo) | ||
|
||
doFirst { | ||
logger.info("Building performance-analyzer-rca project in ${rcaProjectDir}") | ||
logger.info("Building performance-analyzer-rca project in ${rcaProjectDir} with -Dopensearch.version=${opensearch_version}") | ||
} | ||
|
||
doLast { | ||
exec { | ||
workingDir("$rcaProjectDir") | ||
commandLine './gradlew', 'build', '-x', 'test' | ||
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}" | ||
} | ||
exec { | ||
workingDir("$rcaProjectDir") | ||
commandLine './gradlew', 'publishToMavenLocal' | ||
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}" | ||
} | ||
exec { | ||
def licenseDir = "$projectDir/licenses" | ||
workingDir("$licenseDir") | ||
commandLine 'rm', "-f", "performanceanalyzer-rca-1.0.0.0.jar.sha1" | ||
commandLine 'rm', "-f", "performanceanalyzer-rca-${project.version}.jar.sha1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
} | ||
|
||
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.zip")) { | ||
from(zipTree("$rcaProjectDir/build/distributions/performance-analyzer-rca-${version}.zip")) { | ||
} | ||
into "$rcaProjectDir/build/distributions" | ||
rcaArtifactsDir = "$rcaProjectDir/build/distributions/performance-analyzer-rca/" | ||
|
@@ -402,10 +403,10 @@ 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 cloneGitRepo task. | ||
* repo. The performance-analyzer-rca repo is cloned as part of the cloneRcaGitRepo task. | ||
*/ | ||
task setupOpenSearchCluster() { | ||
dependsOn(cloneGitRepo) | ||
dependsOn(cloneRcaGitRepo) | ||
onlyIf = { | ||
propEnabled("tests.enableIT") | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to the main repo before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but it will break the build. So, we can't. And if I merge opensearch-project/performance-analyzer-rca#55 it's the same problem for that PR. I think the safe thing to do is to merge this PR and opensearch-project/performance-analyzer-rca#55 and then go and change on both sides carefully (which I will do).