Upgrade to Gradle 7
reta opened this issue ยท 6 comments
Is your feature request related to a problem?
The OpenSearch Plugins are still built using Gradle 6.6.x whereas the Gradle release train has moved to 7.x already. The OpenSearch core is about to be switched to Gradle 7.3 (see please opensearch-project/OpenSearch#1609), it would make sense to switch all plugins to Gradle 7.3 as well.
What solution would you like?
Update Gradle to 7.3
What alternatives have you considered?
N/A
Do you have any additional context?
See please opensearch-project/OpenSearch#1246
- opensearch-project/data-prepper#662
- opensearch-project/alerting#246
- opensearch-project/anomaly-detection#326
- opensearch-project/asynchronous-search#70
- opensearch-project/dashboards-notebooks#105
- opensearch-project/reporting#234
- opensearch-project/index-management#204
- opensearch-project/job-scheduler#104
- opensearch-project/k-NN#230
- opensearch-project/performance-analyzer#92
- opensearch-project/security#1505
- opensearch-project/sql#303
- opensearch-project/observability#278
- opensearch-project/cross-cluster-replication#259
- opensearch-project/common-utils#101
Added this issue to 1.3.0 campaigns, opensearch-project/opensearch-build#889
Getting a failure related to GlobalBuildInfoPlugin with Java 14 for k-NN upgrade PR:
* What went wrong:
A problem occurred evaluating root project 'opensearch-knn'.
> Failed to apply plugin class 'org.opensearch.gradle.info.GlobalBuildInfoPlugin'.
> Could not create plugin of type 'GlobalBuildInfoPlugin'.
> Could not generate a decorated class for type GlobalBuildInfoPlugin.
> org/gradle/jvm/toolchain/JavaInstallation
Anyone else run into this?
@jmazanec15 yes, the plugin uses OpenSearch 1.3.0-SNAPSHOT which is not yet on Gradle 7, the PR opensearch-project/OpenSearch#1622 is not merged yet :(
Here are instructions for updating a project to Gradle 7:
- You can try to fix Gradle 7 errors in your project before any update. Run your build with the
--warning-mode all
flag. Fix issues your your build files.
./gradlew --warning-mode all clean build
- Run the Gradle wrapper task to update:
./gradlew wrapper --gradle-version 7.3
- Add the OpenSearch snapshot repository to your
buildscript
repositories
list. It may already be included.
maven { url 'https://aws.oss.sonatype.org/content/repositories/snapshots/' }
- Update the OpenSearch
build-tools
dependency to the correct version. Right now, this change is only available in the 2.0.0-SNAPSHOT build.
classpath 'org.opensearch.gradle:build-tools:2.0.0-SNAPSHOT'
- Run your build as usual.
Configuration snippet for reference:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
mavenCentral()
maven { url 'https://aws.oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath 'org.opensearch.gradle:build-tools:2.0.0-SNAPSHOT'
}
}
@dlvenable says Data Prepper cannot update to Gradle 7 until after OpenSearch 2.0 releases. Retaining Gradle 6 in Data Prepper does not block OpenSearch 2.0 or cause any sort of incompatibility between Data Prepper and OpenSearch. I am going to close this for 2.0.0.