diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b12203d8fb..0ebb05cdd3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -160,6 +160,10 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.pre-commit-config.yaml' - '!.shellcheckrc' + - '!CODEOWNERS' + - '!Dockerfile' + - '!README.md' + - '!SECURITY.md' - '!ci/build_docs.sh' - '!ci/build_go.sh' - '!ci/build_python.sh' @@ -171,14 +175,19 @@ jobs: - '!ci/test_python.sh' - '!ci/test_wheel_cuvs.sh' - '!ci/validate_wheel.sh' - - '!Dockerfile' + - '!conda/environments/**' + - '!conda/recipes/cuvs/**' + - '!conda/recipes/cuvs-bench/**' + - '!conda/recipes/cuvs-bench-cpu/**' - '!docs/**' + - '!examples/**' - '!fern/**' + - '!go/**' - '!img/**' - '!notebooks/**' + - '!pyproject.toml' - '!python/**' - '!rust/**' - - '!go/**' - '!thirdparty/LICENSES/**' test_python_conda: - '**' @@ -192,8 +201,12 @@ jobs: - '!.github/labeler.yml' - '!.github/ops-bot.yaml' - '!.github/release.yml' + - '!.github/workflows/check-c-abi.yaml' + - '!.github/workflows/labeler.yml' - '!.github/workflows/publish-rust.yaml' + - '!.github/workflows/store-c-abi-baseline.yaml' - '!.github/workflows/trigger-breaking-change-alert.yaml' + - '!.github/workflows/update-c-abi-baseline.yaml' - '!.pre-commit-config.yaml' - '!.shellcheckrc' - '!ci/build_go.sh' @@ -210,6 +223,7 @@ jobs: - '!cpp/.clang-format' - '!cpp/.clang-tidy' - '!cpp/doxygen/**' + - '!CODEOWNERS' - '!Dockerfile' - '!README.md' - '!SECURITY.md' @@ -252,6 +266,7 @@ jobs: - '!ci/test_python.sh' - '!ci/test_standalone_c.sh' - '!ci/validate_wheel.sh' + - '!CODEOWNERS' - '!Dockerfile' - '!README.md' - '!SECURITY.md' @@ -283,6 +298,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.pre-commit-config.yaml' - '!.shellcheckrc' + - '!CODEOWNERS' - '!Dockerfile' - '!README.md' - '!SECURITY.md' @@ -324,6 +340,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.pre-commit-config.yaml' - '!.shellcheckrc' + - '!CODEOWNERS' - '!Dockerfile' - '!README.md' - '!SECURITY.md' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c6bc0d29a..d4f8114c71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,12 +3,13 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-json - id: trailing-whitespace - id: end-of-file-fixer - id: check-symlinks + - id: check-xml - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: diff --git a/java/README.md b/java/README.md index 8a6adb4ead..ff62ff1225 100644 --- a/java/README.md +++ b/java/README.md @@ -1,6 +1,5 @@ # cuVS Java API - cuVS Java API provides a Java based simple, efficient, and a robust vector search API. > [!CAUTION] @@ -13,7 +12,6 @@ cuVS Java API provides a Java based simple, efficient, and a robust vector searc - [JDK 22](https://openjdk.org/projects/jdk/22/) - [jextract for JDK 22](https://jdk.java.net/jextract/) (If not already installed, the build script downloads it) - ## Building The libcuvs C and C++ libraries are needed for this API. If libcuvs libraries have not been built and installed, use `./build.sh libcuvs java` in the top level directory to build this API. @@ -26,17 +24,22 @@ do `./build.sh java` in the top level directory or just do `./build.sh` in this Run `./build.sh --run-java-tests` from this directory. To run a single test suite: + ```sh cd cuvs-java/ mvn clean integration-test -Dit.test=com.nvidia.cuvs.CagraBuildAndSearchIT ``` + or, for a single test: + ```sh mvn clean integration-test -Dit.test=com.nvidia.cuvs.CagraBuildAndSearchIT#testMergeStrategies ``` + Be sure to set (manually, if needed) your `LD_LIBRARY_PATH` to include the directory with the appropriate (matching) version of `libcuvs.so`. Also, ensure that your panama bindings are up-to-date. They can be re-generated by running: + ```sh ./panama-bindings/generate-bindings.sh ``` @@ -45,6 +48,7 @@ Tests run using a randomized runner. Specific failures can be reproduced running by passing `-Dtests.seed=42FC5CC6B4C6BA8E` (where `42FC5CC6B4C6BA8E` has to be replaced with your specific seed). It also possible to re-run a single test, but in this case it's necessary to pass the extended seed (suite:method), e.g. + ```shell mvn integration-test -Dit.test=com.nvidia.cuvs.CagraBuildAndSearchIT#testFloatIndexing -Dtests.seed=66039A8CAFB9D3C9:449B6310296799E0 ``` diff --git a/java/benchmarks/README.md b/java/benchmarks/README.md index 1740e52811..4e7eb8a894 100644 --- a/java/benchmarks/README.md +++ b/java/benchmarks/README.md @@ -3,25 +3,32 @@ This maven project contains JMH benchmarks for the CAGRA Java API. ## Prerequisites + - [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) - Build the CuVS-Java API (`./build.sh` from the parent directory) ## Run benchmarks Build: + ```shell mvn clean verify ``` + Run: + ```shell export RAFT_DEBUG_LOG_FILE=/dev/null java -jar target/benchmarks.jar ``` + The environment variable is needed to silence RAFT logging; RAFT emits some logs at INFO level when building indices and queries, and writing them to stdout (the default) influences benchmark results. It is possible to change the dataset size and the vectors dimension via 2 parameters: + ```shell java -jar target/benchmarks.jar -p size=4 -p dims=4 ``` + Use `java -jar target/benchmarks.jar -h` for details on the options to fine-tune your benchmark runs. diff --git a/java/benchmarks/pom.xml b/java/benchmarks/pom.xml index 129ad37458..6aa61eec99 100644 --- a/java/benchmarks/pom.xml +++ b/java/benchmarks/pom.xml @@ -15,6 +15,60 @@ cuvs-java-benchmarks + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Central + https://repo.maven.apache.org/maven2 + + true + + + false + + + + + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Plugin Repository + https://repo.maven.apache.org/maven2 + + true + + + false + + + + org.openjdk.jmh @@ -104,38 +158,14 @@ maven-clean-plugin 2.5 - - maven-deploy-plugin - 2.8.1 - - - maven-install-plugin - 2.5.1 - maven-jar-plugin 2.4 - - maven-javadoc-plugin - 2.9.1 - maven-resources-plugin 2.6 - - maven-site-plugin - 3.3 - - - maven-source-plugin - 2.2.1 - - - maven-surefire-plugin - 2.17 - diff --git a/java/cuvs-java/.mvn/maven.config b/java/cuvs-java/.mvn/maven.config new file mode 100644 index 0000000000..c83cb17ff4 --- /dev/null +++ b/java/cuvs-java/.mvn/maven.config @@ -0,0 +1,6 @@ +-e +-B +-Daether.connector.basic.downstreamThreads=1 +-Daether.transport.http.retryHandler.count=5 +-Daether.transport.http.retryHandler.interval=10000 +-Dmaven.wagon.http.retryHandler.count=5 diff --git a/java/cuvs-java/pom.xml b/java/cuvs-java/pom.xml index 9f1a36c305..246a6bcb5a 100644 --- a/java/cuvs-java/pom.xml +++ b/java/cuvs-java/pom.xml @@ -1,8 +1,6 @@ ${project.build.directory}/../../../cpp/build - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Central + https://repo.maven.apache.org/maven2 + + true + + + false + + + + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Plugin Repository + https://repo.maven.apache.org/maven2 + + true + + + false + + + @@ -204,17 +248,6 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ossrh - https://oss.sonatype.org/ - false - - com.diffplug.spotless spotless-maven-plugin diff --git a/java/examples/README.md b/java/examples/README.md index f2b2a0d3ba..4dde184871 100644 --- a/java/examples/README.md +++ b/java/examples/README.md @@ -3,25 +3,32 @@ This maven project contains examples for CAGRA, HNSW, and Bruteforce algorithms. ## Prerequisites + - [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) - Build the CuVS-Java API ## Run Examples ### CAGRA Example + In the current directory do: + ``` mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-26.08.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/26.08.0/cuvs-java-26.08.0.jar com.nvidia.cuvs.examples.CagraExample ``` ### HNSW Example + In the current directory do: + ``` mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-26.08.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/26.08.0/cuvs-java-26.08.0.jar com.nvidia.cuvs.examples.HnswExample ``` ### Bruteforce Example + In the current directory do: + ``` mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-26.08.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/26.08.0/cuvs-java-26.08.0.jar com.nvidia.cuvs.examples.BruteForceExample ``` diff --git a/java/examples/pom.xml b/java/examples/pom.xml index b57baffc2c..9a95210fab 100644 --- a/java/examples/pom.xml +++ b/java/examples/pom.xml @@ -2,8 +2,6 @@ SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved. SPDX-License-Identifier: Apache-2.0 --> - - 4.0.0 @@ -18,6 +16,60 @@ SPDX-License-Identifier: Apache-2.0 22 + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Central + https://repo.maven.apache.org/maven2 + + true + + + false + + + + + + + + gcs-maven-central-mirror + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + central + Maven Plugin Repository + https://repo.maven.apache.org/maven2 + + true + + + false + + + + com.nvidia.cuvs @@ -26,12 +78,6 @@ SPDX-License-Identifier: Apache-2.0 26.08.0 - - com.diffplug.spotless - spotless-maven-plugin - 2.44.5 - - @@ -82,31 +128,10 @@ SPDX-License-Identifier: Apache-2.0 maven-compiler-plugin 3.13.0 - - maven-surefire-plugin - 3.3.0 - maven-jar-plugin 3.4.2 - - maven-install-plugin - 3.1.2 - - - maven-deploy-plugin - 3.1.2 - - - - maven-site-plugin - 3.12.1 - - - maven-project-info-reports-plugin - 3.6.1 - maven-assembly-plugin 3.4.2