Fork this repository on GitHub, and clone locally with git clone
.
OpenSearch components build using Java 14 at a minimum. This means you must have a JDK 14 installed with the environment variable JAVA_HOME
referencing the path to Java home for your JDK 14 installation, e.g. JAVA_HOME=/usr/lib/jvm/jdk-14
.
- Clone the repository (see Forking and Cloning)
- Make sure
JAVA_HOME
is pointing to a Java 14 JDK (see Install Prerequisites) - Launch Intellij IDEA, Choose Import Project and select the settings.gradle file in the root of this package.
This package uses the Gradle build system. Gradle comes with excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. we also use the OpenSearch build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. Not everything in this package will work the way it's described in the Gradle documentation. If you encounter such a situation, the OpenSearch build tools source code is your best bet for figuring out what's going on.
./gradlew check
builds and tests../gradlew :run
runs the plugin../gradlew spotlessApply
formats code. And/or import formatting rules in formatterConfig.xml with IDE../gradlew test
to run the complete test suite.
Currently, the only IDE we support is IntelliJ IDEA. It's free, it's open source, it works. The gradle tasks above can also be launched from IntelliJ's Gradle toolbar and the extra parameters can be passed in via the Launch Configurations VM arguments.
The Github workflow in backport.yml
creates backport PRs automatically when the
original PR with an appropriate label backport <backport-branch-name>
is merged to main with the backport workflow
run successfully on the PR. For example, if a PR on main needs to be backported to 2.x
branch, add a label
backport 2.x
to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is
merged to main, the workflow will create a backport PR to the 2.x
branch.
Run the below command to publish the artifacts to maven local.
./gradlew publishToMavenLocal
To generate the below artifacts on local
snapshots/
└── org
└── opensearch
└── plugin
└── opensearch-ai-flow-framework
├── 3.0.0.0-SNAPSHOT
│ ├── maven-metadata.xml
│ ├── maven-metadata.xml.md5
│ ├── maven-metadata.xml.sha1
│ ├── maven-metadata.xml.sha256
│ ├── maven-metadata.xml.sha512
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.pom
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.pom.md5
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.pom.sha1
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.pom.sha256
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.pom.sha512
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.zip
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.zip.md5
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.zip.sha1
│ ├── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.zip.sha256
│ └── opensearch-ai-flow-framework-3.0.0.0-20231005.170838-1.zip.sha512
├── maven-metadata.xml
├── maven-metadata.xml.md5
├── maven-metadata.xml.sha1
├── maven-metadata.xml.sha256
└── maven-metadata.xml.sha512
- Change the url from
"https://aws.oss.sonatype.org/content/repositories/snapshots"
to your local path and comment out the credentials under publishing/repositories in build.gradle. - Run
./gradlew publishPluginZipPublicationToSnapshotsRepository
.