opensearch-project/opensearch-plugins

Upgrade to Gradle 7

reta opened this issue ยท 6 comments

reta commented

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

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?

reta commented

@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:

  1. 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
  1. Run the Gradle wrapper task to update:
./gradlew wrapper --gradle-version 7.3
  1. 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/' }
  1. 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'
  1. 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'
    }
}
reta commented

@dblock could you please add 2.0 label to this issue and remove 1.3.0? Thank you.

@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.