-
Notifications
You must be signed in to change notification settings - Fork 69
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 dependency on k-NN plugin #10
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -124,12 +124,30 @@ repositories { | |||||||
maven { url "https://plugins.gradle.org/m2/" } | ||||||||
} | ||||||||
|
||||||||
configurations { | ||||||||
zipArchive | ||||||||
} | ||||||||
|
||||||||
def knnJarDirectory = "$buildDir/dependencies/opensearch-knn" | ||||||||
|
||||||||
dependencies { | ||||||||
api "org.opensearch:opensearch:${opensearch_version}" | ||||||||
zipArchive group: 'org.opensearch.plugin', name:'opensearch-knn', version: "${opensearch_build}" | ||||||||
api fileTree(dir: knnJarDirectory, include: '*.jar') | ||||||||
Comment on lines
+135
to
+136
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. Refer to above comment |
||||||||
api group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}" | ||||||||
} | ||||||||
|
||||||||
// From maven, we can get the k-NN plugin as a zip. In order to add the jar to the classpath, we need to unzip the | ||||||||
// k-NN zip and then copy it into a directory that we specify as a dependency. | ||||||||
task unzip(type: Copy) { | ||||||||
configurations.zipArchive.asFileTree.each { | ||||||||
from(zipTree(it)) | ||||||||
} | ||||||||
into knnJarDirectory | ||||||||
} | ||||||||
|
||||||||
compileJava { | ||||||||
dependsOn unzip | ||||||||
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) | ||||||||
} | ||||||||
compileTestJava { | ||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why we are taking it as a proper dependency?
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.
Also why can't we just pull from maven central?
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.
We can get the zip from maven, but we need to add the jar to the class path. To do this, we must unzip the zip file.
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.
Did we try using api thing. It will add in the class path.
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.
Yes I tried. api wont unzip the zipfile. We have to do it on our own.
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.
How this is different from getting the dependency of ML commons or lets say any other dependency like apache commons in the project? They all get downloaded from maven.
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.
Maven does not necessarily have to be jars. Following opensearch-project/opensearch-build#1916, k-NN published the zip using the custom pluginzip function (see k-NN's build.gradle).
ml-commons a different method to just publish the jar to maven. k-NN could also do this, but does not right now. Hence, we have to rely on the zip.
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.
@jmazanec15 , seems it's reasonable to publish just shared part as jar to maven like ml-commons, so client plugin like neural search doesn't need to add the whole zip as dependency. But that takes time. I think it's fine for current phase to rely on zip. I don't see other risks, but we'd better confirm there is no big concern from others like asking infra team?
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.
@ylwu-amzn I think this is good for now. I dont see any risks. Integ tests install ml-commons, k-NN and neural-search in same cluster and there are not any issues, so I think it will be okay. What are the other risks involved?
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.
Lets go ahead and create a issue on k-NN for this. Approving the PR meanwhile.