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

Upgrade plugin to 2.4 and refactor zip dependencies #25

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

jmazanec15
Copy link
Member

Description

Upgrades plugin to 2.4. Fixes a couple compile time dependencies with ml-commons.

Refactors dependencies on zips for ml-commons and k-NN. Currently, both ml-commons and k-NN post zips to maven. We already depend on k-NN for the jar. We can refactor dependencies to rely only on these artifacts and not have to download separately.

Check List

  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@jmazanec15 jmazanec15 requested a review from a team October 19, 2022 20:43
@jmazanec15
Copy link
Member Author

Seems that CI is checking out wrong commit: "HEAD is now at 272d803 Integrate model inference to build query (#20)" from https://github.com/opensearch-project/neural-search/actions/runs/3284862131/jobs/5411313863

Upgrades plugin to 2.4. Fixes a couple compile time dependencies with
ml-commons. Refactors dependencies on zips for ml-commons and k-NN.

Signed-off-by: John Mazanec <jmazane@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Comment on lines 133 to +134
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}"
zipArchive group: 'org.opensearch', name:'opensearch-ml-plugin', version: "${opensearch_build}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need ML-Plugin as dependency? Seems like we just need this for integ tests? If yes what was issue with older behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They dependency is for integ tests. We specify a custom dependency configuration "zipArchive" to define the scope of the dependency. Declaring a dependency on it this way, we can avoid hardcoding urls and manually downloading from urls.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this approach is opensearch-ml-plugin will be downloaded in those cases where we don't need to run the integration tests. But with the URLs approach we make sure that we download this only when it is required not in every case. I can see this as a downside of this approach. Also, how zip archive is making sure that we are downloading the right platform version of the dependency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this approach is opensearch-ml-plugin will be downloaded in those cases where we don't need to run the integration tests.

From here I saw this:
"At runtime, Gradle will locate the declared dependencies if needed for operating a specific task. The dependencies might need to be downloaded from a remote repository, retrieved from a local directory or requires another project to be built in a multi-project setting. This process is called dependency resolution." So, gradle should be able to identify when a dependency is needed and identify that only the k-NN zip is required for compileJava and only download the ml-commons zip for integ test cluster. However, if this isnt the case, we could create a new configuration that extends zipArchive so that only the k-NN zip is downloaded for compileJava. Ill leave this FAR.

Also, how zip archive is making sure that we are downloading the right platform version of the dependency?

Unsure at the moment how this is done, but will investigate. OpenSearch core dependency is platform specific so Im guessing a similar mechanism is followed.

Copy link
Member

@martin-gaievski martin-gaievski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How we are using zip file with models from resources folder (src/test/resources/model/all-MiniLM-L6-v2.zip)?

@jmazanec15
Copy link
Member Author

How we are using zip file with models from resources folder (src/test/resources/model/all-MiniLM-L6-v2.zip)?

This is a minimal model used for integration tests. Ideally, it would be smaller and/or located somewhere we could download it from, but for now we need to check it in.

Copy link
Member

@vamshin vamshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

Copy link
Collaborator

@navneet1v navneet1v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with minor comments.

@jmazanec15 jmazanec15 merged commit ed1afb6 into opensearch-project:main Oct 24, 2022
@jmazanec15 jmazanec15 added the Maintenance Add support for new versions of OpenSearch/Dashboards from upstream label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Add support for new versions of OpenSearch/Dashboards from upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants