-
Notifications
You must be signed in to change notification settings - Fork 482
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
Blog Post: OpenSearch plugin zips now in Maven repo #930
Changes from 6 commits
440d45b
a488d6e
9517a36
def0426
176c6e0
f265e40
f39b12e
468df99
4baf4fe
75e744b
f85f993
70ccaa4
3133ffe
3c77c4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,5 @@ end | |
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] | ||
|
||
gem "rouge" | ||
|
||
gem "webrick", "~> 1.7" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: Prudhvi Godithi | ||
short_name: prudhvigodithi | ||
linkedin: 'prudhvi-godithi' | ||
photo: '/assets/media/authors/prudhvigodithi.jpg' | ||
--- | ||
|
||
**Prudhvi Godithi** is a System Enginner at AWS working on the OpenSearch project. | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,73 @@ | ||||||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||||||
layout: post | ||||||||||||||||||||||||||||||||||
title: "OpenSearch plugin zips now in Maven repo" | ||||||||||||||||||||||||||||||||||
authors: | ||||||||||||||||||||||||||||||||||
- prudhvigodithi | ||||||||||||||||||||||||||||||||||
date: 2022-07-24 01:01:01 -0700 | ||||||||||||||||||||||||||||||||||
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. @prudhvigodithi since this has been in edit for a while - please update this date |
||||||||||||||||||||||||||||||||||
categories: | ||||||||||||||||||||||||||||||||||
- technical-post | ||||||||||||||||||||||||||||||||||
twittercard: | ||||||||||||||||||||||||||||||||||
description: "Details on how to consume OpenSearch plugin zips from maven repo and the process involved in shipping them to the maven repo." | ||||||||||||||||||||||||||||||||||
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. Capitalize both instances of "Maven". Additionally, should it be "Details on how to consume OpenSearch plugin zips from a Maven repo and the process involved in shipping them to a Maven repo."? |
||||||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
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. I deleted the Summary section and used that description as the Intro.
Suggested change
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. Sentence Reformation: Starting with the release of OpenSearch 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. In "Maven Repo URL's", change to "Maven repo URLs". |
||||||||||||||||||||||||||||||||||
### Motivation and Current Challenges: | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
The plugins zips that are used as dependencies cannot be downloaded dynamically during runtime, as they are not part of version controlled maven system. Only the respective Java jars are available to download using maven coordinates. This forces a user to now to use a dependency plugin zip of some random version built on a developer desktop, which is not reliable, also the tests executed as part of this build zip cannot be accurate, so eventually for few plugins the local build zip is forced to check in to the plugin repo to facilitate the plugin availability for dependency, this is one of the challenge faced by the community. Coming to the download part of plugins as separate isolated components via a cached mechanism like maven is not possible, with this challenge users had to pre-bake the random built zip to the project. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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. Can we re-form the sentence to match the meaning as follows Before OpenSearch 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. Remove the commas after "runtime" and "desktop". Capitalize the second instance of "Maven". |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
Starting with release `2.1.0` OpenSearch plugin zips are now signed and published to central maven repo, with `groupID` as [org.opensearch.plugin](https://repo1.maven.org/maven2/org/opensearch/plugin/). These zips can now be fetched as individual components by directly downloading using maven coordinates or by clickstream from central maven repo which can be later cached to the desired user local maven repo. The snapshot version of the zips can be fetched from nexus maven repo with the same `groupID` as [org.opensearch.plugin](https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/). | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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. This looks really good, small change though Furthermore, to facilitate the plugin availability as dependency, the plugin zip's are forced to check in to the plugin repo and so tests executed as part of the OpenSearch build process are not accurate. These restrictions were challenging to our community, since those wishing to use plugin zips as separate isolated components via a cached mechanism proved to be impossible. 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. Add "a" between "as" and "dependency" ("as a dependency"). Change "zip's" to "zips" (no apostrophe). Change to "...to the plugin repo, so tests...". Remove the comma after "community". Change "since those wishing to use" to "since using". |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
### Maven publish task with custom gradle plugin. | ||||||||||||||||||||||||||||||||||
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. I also changed the order of the "Benefits" and "Gradle" sections.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
The publishing of zips to central maven repo had been possible with custom gradle plugin `opensearch.pluginzip`. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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. Just some additional change to last point
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. Add a terminating period to the first list item. In the second list item, should it be "a clickstream"? In the third list item, change "with same Mavin" to "with the same Maven". |
||||||||||||||||||||||||||||||||||
Starting with release `2.1.0` all OpenSearch gradle supported plugins will have custom gradle plugin `opensearch.pluginzip` applied to the gradle project, this will create a new task `publishPluginZipPublicationToZipStagingRepository` which does all the heavy lifting in identifying the distribution plugin zip, setting the maven coordinates, generating the POM file, updating the user passed POM fields and publishing it to maven repo. More details and inner workings of the plugin can found at [opensearch-plugins](https://github.com/opensearch-project/opensearch-plugins/blob/main/BUILDING.md#opensearchpluginzip). | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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.
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. In the first list item, change to "Plugin zips in the central Maven repo are already signed with...". Add "and" after the last comma. In the second list item, remove the comma after "files" and add a comma after "'artifactID'". In the third list item, change to "Tests and CI workflows can run directly against the Maven repo instead of requiring a manual download." |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
**Figure 1**: Workflow that ship generated plugin zips to maven | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
![Figure 1: Workflow that ship zips to maven]({{ site.baseurl }}/assets/media/blog-images/2022-07-24-opensearch-plugin-zips-now-in-maven-repo/figure1.png){: .img-fluid } | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
### Benefits of plugin zips in maven: | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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. Heading change as |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
* The plugin dependencies can now be fetched using the right maven coordinates from maven repo and a user need not use a zip of some random version built on a developer desktop. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
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. Heading change as Add A small adjustment in 4th, 5th point as follows:
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. Capitalize all instances of "Gradle". Line 33: Add a comma after "OpenSearch publishes plugin zips using a custom Gradle plugin,". Change to "Gradle-supported". Add terminating periods to all list items. The fourth list item should read "Updating the user-generated POM fields." The Figure caption should read "Workflow that ships generated plugin zips to Maven". |
||||||||||||||||||||||||||||||||||
* The development dependent `SNAPSHOT` version zips can be directly fetched from maven using the dependency mechanism. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
* Not required to check in the zips manually to any `src/` folders, as zips can now be fetched using the right `grounID`, `artifactID` and `version`. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
* The published zips to central maven repo are signed with `.asc`, `.md5`, `.sha1`, `.sha256`, `.sha512` extensions. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
* The tests and CI workflows can directly run against the zips fetched from maven repo, instead of requiring a manual download and checking into the project. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
### Consume plugin zips from maven: | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
**Using mvn cli:** | ||||||||||||||||||||||||||||||||||
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. Should this be "Using the Maven CLI"? Remove the colon (:) from the heading. |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
Consume from Central Maven repo: | ||||||||||||||||||||||||||||||||||
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. Change to "Consume from the central Maven repo:". |
||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=https://repo1.maven.org/maven2 -Dartifact=org.opensearch.plugin:opensearch-job-scheduler:2.1.0.0:zip | ||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
Consume from Snapshot Maven repo: | ||||||||||||||||||||||||||||||||||
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. Add "the" before "Snapshot". |
||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=https://aws.oss.sonatype.org/content/repositories/snapshots -Dartifact=org.opensearch.plugin:opensearch-job-scheduler:2.1.0.0-SNAPSHOT:zip | ||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
**Gradle Project: using build.gradle file** | ||||||||||||||||||||||||||||||||||
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. Change to "Gradle project: Using the build.gradle file". |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
dependencies { | ||||||||||||||||||||||||||||||||||
classpath "org.opensearch.plugin:opensearch-job-scheduler:2.1.0.0@zip" | ||||||||||||||||||||||||||||||||||
classpath "org.opensearch.plugin:opensearch-knn:2.1.0.0@zip" | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
**Maven Project: using pom.xml file** | ||||||||||||||||||||||||||||||||||
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. Change to "Maven project: Using the pom.xml file". |
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
<dependencies> | ||||||||||||||||||||||||||||||||||
<dependency> | ||||||||||||||||||||||||||||||||||
<groupId>org.opensearch.plugin</groupId> | ||||||||||||||||||||||||||||||||||
<artifactId>opensearch-job-scheduler</artifactId> | ||||||||||||||||||||||||||||||||||
<version>2.1.0.0</version> | ||||||||||||||||||||||||||||||||||
<packaging>zip</packaging> | ||||||||||||||||||||||||||||||||||
</dependency> | ||||||||||||||||||||||||||||||||||
</dependencies> | ||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
### Summary: | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||||||||
Using the maven [Release zips Maven Repo](https://repo1.maven.org/maven2/org/opensearch/plugin/) and [Snapshot zips Maven Repo](https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/) URL’s, the plugin zips can be consumed and used as dependency to build other plugins and can also be fetched as standalone components to install them to the OpenSearch cluster. | ||||||||||||||||||||||||||||||||||
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.
Suggested change
|
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.
Change to "is an AWS System Engineer working on the OpenSearch project."