Skip to content
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

Add a gradle task to download the latest OpenSearch artifact #2950

Open
dblock opened this issue Apr 18, 2022 · 5 comments
Open

Add a gradle task to download the latest OpenSearch artifact #2950

dblock opened this issue Apr 18, 2022 · 5 comments
Labels
Build Libraries & Interfaces Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. enhancement Enhancement or improvement to existing feature or request

Comments

@dblock
Copy link
Member

dblock commented Apr 18, 2022

Is your feature request related to a problem? Please describe.

Coming from https://github.com/opensearch-project/cross-cluster-replication/pull/366/files a bunch of boilerplate code was written to download https://artifacts.opensearch.org/releases/bundle/opensearch/${opensearch_previous_version}/opensearch-${opensearch_previous_version}-linux-x64.tar.gz and extract a plugin.

Describe the solution you'd like

  1. Extract the boilerplate code into OpenSearch gradle tasks.
  2. Replace the boilerplate by a 1-liner.

We are trying to publish ZIPs into maven in opensearch-project/opensearch-build#1916, so maybe this proposal is moot with that? @prudhvigodithi

@dblock dblock added enhancement Enhancement or improvement to existing feature or request untriaged labels Apr 18, 2022
@reta
Copy link
Collaborator

reta commented Apr 18, 2022

@dblock I think we already have a plugin for it (which also supports candidates and snapshots) [1]. Or you have something different in mind?

/**
 * A plugin to manage getting and extracting distributions of OpenSearch.
 * <p>
 * The plugin provides hooks to register custom distribution resolutions.
 * This plugin resolves distributions from the OpenSearch downloads service if
 * no registered resolution strategy can resolve to a distribution.
 */

[1] https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/DistributionDownloadPlugin.java

@prudhvigodithi
Copy link
Contributor

prudhvigodithi commented Apr 18, 2022

Hey @reta I have written a custom java plugin only for publishing zips, please check this link
Just testing with some integrations with the existing setup, this should be rolled out soon after being tested a user can just add apply plugin: 'opensearch.zippublish' and run a publish task, only challenge I'm facing is we are already hijacking the entire publications with another custom plugin, this plugin does not consider a specific publication (which is ideal way to do as we can segregate the custom plugins for each specific type like java, zip ...), also this is the reason we always have the sources.jar and javadoc.jar added.

So I trying to make this work so that java publications are not impacted with this zip publications, and to have a minimal code change for each component.
@dblock

@reta
Copy link
Collaborator

reta commented Apr 18, 2022

Thanks @prudhvigodithi, yeah the awesome work you have done is on publication side, but this one seems to be on download side - fetching the core distribution.

@prudhvigodithi
Copy link
Contributor

got it @reta.
@dblock I dont think we are adding .tar.gz to maven repo we can add if required with <packaging>tar.gz</packaging>, but right now the plan is to add plugin zips, should we even think of adding the core tar file as well ?
@reta

@reta
Copy link
Collaborator

reta commented Apr 18, 2022

@prudhvigodithi I believe in case of the plugins, we only support ZIPs (as per opensearch-plugin tool), but for core distributions - only for Windows we use ZIPs:

Plugins are packaged as zip files. Each packaged plugin must contain a plugin properties file.
                                                                                               
The install command takes a plugin id, which may be any of the following: 
  An official opensearch plugin name                                      
  Maven coordinates to a plugin zip                                       
  A URL to a plugin zip                                                   
  A local zip file      

@peterzhuamazon peterzhuamazon added the Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Libraries & Interfaces Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. enhancement Enhancement or improvement to existing feature or request
Projects
None yet
Development

No branches or pull requests

5 participants