milvus-io / milvus-sdk-java

Java SDK for Milvus.
https://milvus.io
Apache License 2.0
391 stars 165 forks source link

Failed to install #627

Open FreeGoldRush opened 1 year ago

FreeGoldRush commented 1 year ago

The gradle installation instructions are leaving something out that must be obvious but unstated. On Ubuntu I do:

gradle implementation 'io.milvus:milvus-sdk-java:2.3.0'

And get this below. What additional step is required?


Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

A Gradle build should contain a 'settings.gradle' or 'settings.gradle.kts' file in its root directory. It may also contain a 'build.gradle' or 'build.gradle.kts' file.

FreeGoldRush commented 1 year ago

I also tried this with Maven and it did not work. Here is the relevant start of errors that might offer a clue:

[INFO] Changes detected - recompiling the module! [INFO] Compiling 119 source files to /home/mike/milvus/milvus-sdk-java/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/mike/milvus/milvus-sdk-java/src/main/java/io/milvus/param/R.java:[23,22] package io.milvus.grpc does not exist [ERROR] /home/mike/milvus/milvus-sdk-java/src/main/java/io/milvus/client/MilvusClient.java:[117,7] cannot find symbol symbol: class ListDatabasesResponse location: interface io.milvus.client.MilvusClient

Many more follow. What should I have done differently? Thank you!

yhmo commented 1 year ago

Maven is recommended, we didn't provide a build script for Gradle.

For the error "package io.milvus.grpc does not exist", the answer is in this issue: https://github.com/milvus-io/milvus-sdk-java/issues/273

FreeGoldRush commented 1 year ago

Thank you. It did compile. 109 tests. 3 failed.

Failed tests: MilvusMultiClientDockerTest.testAsyncMethods:667 expected:<0> but was:<-3> MilvusMultiClientDockerTest.testBinaryVectors:538 expected:<0> but was:<-3> MilvusMultiClientDockerTest.testFloatVectors:286 expected:<0> but was:<-3>

Is this important?

yhmo commented 1 year ago

The tests launch a milvus server locally. You can see there is a docker-compose.yml under the java sdk project root path. The master&v2.3 branch uses milvus v2.3.0 to test, the v2.2 branch uses milvus v2.2.14 to test. Sometimes the tests failed because two reasons:

  1. There is another milvus server is running, the tests failed to launch new milvus server. You can use docker ps to check. If you have milvus-lite running on the machine, you can use this script to close milvus-lite server.
  2. The "volumes" folder under the java sdk project root path contains some legacy data. Just remove the "volumes" and try again.

I just run the tests on my local, no problem: Screenshot from 2023-09-14 11-46-16