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

[BUG] Knn plugin is fetching from snapshot for few dependencies #2569

Open
owaiskazi19 opened this issue Feb 27, 2025 · 6 comments
Open

[BUG] Knn plugin is fetching from snapshot for few dependencies #2569

owaiskazi19 opened this issue Feb 27, 2025 · 6 comments
Labels
bug Something isn't working untriaged

Comments

@owaiskazi19
Copy link
Member

What is the bug?
For building jniLIb, knn is fetching from snapshot rather release version here

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Build the release version of knn from any release branch like 2.18 or 2.19
  2. See for the build ./gradlew :buildJniLib -Davx512.enabled=false -Davx2.enabled=false -Dbuild.lib.commit_patches=false, it fetches the snapshot version

What is the expected behavior?
Should fetch from the release version

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@owaiskazi19 owaiskazi19 added bug Something isn't working untriaged labels Feb 27, 2025
@gaiksaya
Copy link
Member

gaiksaya commented Feb 27, 2025

Adding more context,

Recently 2.18.0-SNAPSHOTS were unavailable on https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/gradle/build-tools/ due to some issue with sonatype storage.
On trying to build, 2.18.0 distribution using manifest file , k-NN failed with below error:

* What went wrong:
A problem occurred configuring root project 'opensearch-knn'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find org.opensearch.gradle:build-tools:2.18.0-SNAPSHOT.
     Searched in the following locations:
       - file:/home/ci-runner/.m2/repository/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/maven-metadata.xml
       - file:/home/ci-runner/.m2/repository/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/build-tools-2.18.0-SNAPSHOT.pom
       - https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/maven-metadata.xml
       - https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/build-tools-2.18.0-SNAPSHOT.pom
       - https://repo.maven.apache.org/maven2/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/build-tools-2.18.0-SNAPSHOT.pom
       - https://plugins.gradle.org/m2/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/maven-metadata.xml
       - https://plugins.gradle.org/m2/org/opensearch/gradle/build-tools/2.18.0-SNAPSHOT/build-tools-2.18.0-SNAPSHOT.pom
     Required by:
         project 

This is coming from https://github.com/opensearch-project/k-NN/blob/2.18.0.0/scripts/build.sh#L127-L134
Looks like gradle tries to compile the dependencies and since gradle property of "opensearch.version" is not passed in while building JNI library here, it takes the default which was set to 2.18.0-SNAPSHOT.
cc: @navneet1v @jmazanec15 @peterzhuamazon

@peterzhuamazon
Copy link
Member

Hi @owaiskazi19 @gaiksaya as per offline discussion yes we are in the process of contacting sonatype on this.

Thanks.

@owaiskazi19
Copy link
Member Author

Hi @owaiskazi19 @gaiksaya as per offline discussion yes we are in the process of contacting sonatype on this.

@peterzhuamazon that's not the issue here. Issue is with the knn build file using SNAPSHOT version rather release version for building jni library.

@navneet1v
Copy link
Collaborator

Hi @owaiskazi19 @gaiksaya as per offline discussion yes we are in the process of contacting sonatype on this.

@peterzhuamazon that's not the issue here. Issue is with the knn build file using SNAPSHOT version rather release version for building jni library.

@owaiskazi19 I think its not JNI lib, its the build script we have in the k-NN repo. Correct? JNI as per my understanding don't look at SNAPSHOT version or not.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 28, 2025

Hi @owaiskazi19 @gaiksaya as per offline discussion yes we are in the process of contacting sonatype on this.

@peterzhuamazon that's not the issue here. Issue is with the knn build file using SNAPSHOT version rather release version for building jni library.

@owaiskazi19 I think its not JNI lib, its the build script we have in the k-NN repo. Correct? JNI as per my understanding don't look at SNAPSHOT version or not.

If concerned, add -Dbuild.snapshot=$SNAPSHOT in scripts/build.sh on the corresponding lines should be fine.

If you run the command by itself it will just default to snapshot=true.

@owaiskazi19
Copy link
Member Author

@owaiskazi19 I think its not JNI lib, its the build script we have in the k-NN repo. Correct? JNI as per my understanding don't look at SNAPSHOT version or not.

Yes it's the build script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

4 participants