From 37e90e4f2f46748952f878045a6ad32895e19146 Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Tue, 23 Dec 2025 13:47:59 -0800 Subject: [PATCH 1/9] Enable svs-runtime conda package --- docker/x86_64/test-cpp-runtime-bindings.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/x86_64/test-cpp-runtime-bindings.sh b/docker/x86_64/test-cpp-runtime-bindings.sh index f0251294c..0fcb5bbbb 100644 --- a/docker/x86_64/test-cpp-runtime-bindings.sh +++ b/docker/x86_64/test-cpp-runtime-bindings.sh @@ -28,8 +28,11 @@ conda install -y -c conda-forge cmake=3.30.4 make=4.2 swig=4.0 "numpy>=2.0,<3.0" conda install -y -c conda-forge gxx_linux-64=14.2 sysroot_linux-64=2.17 conda install -y mkl=2022.2.1 mkl-devel=2022.2.1 +# Install libsvs-runtime from local conda package +conda install -y -c /runtime_conda libsvs-runtime + # Validate python and C++ tests against FAISS CI -git clone https://github.com/facebookresearch/faiss.git +git clone -b eglaser/svs-runtime-conda-enabling https://github.com/ethanglaser/faiss.git cd faiss echo "===============================================" @@ -37,7 +40,7 @@ echo " Running validation of library against FAISS CI" echo "-----------------------------------------------" echo " FAISS Build: " mkdir build && cd build -cmake -DBUILD_TESTING=ON -DFAISS_ENABLE_SVS=ON -DFAISS_ENABLE_GPU=OFF -DSVS_URL="file:///runtime_lib/svs-cpp-runtime-bindings${SUFFIX}.tar.gz" .. +cmake -DBUILD_TESTING=ON -DFAISS_ENABLE_SVS=ON -DFAISS_ENABLE_GPU=OFF .. make -j$(nproc) swigfaiss faiss_test echo "-----------------------------------------------" echo " FAISS C++ tests: " From 454f8a472d797eed0b47f3845f56cfab175614fa Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Sun, 28 Dec 2025 17:28:58 -0800 Subject: [PATCH 2/9] Install from path instead of channel --- docker/x86_64/test-cpp-runtime-bindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/x86_64/test-cpp-runtime-bindings.sh b/docker/x86_64/test-cpp-runtime-bindings.sh index 0fcb5bbbb..143da1f47 100644 --- a/docker/x86_64/test-cpp-runtime-bindings.sh +++ b/docker/x86_64/test-cpp-runtime-bindings.sh @@ -29,7 +29,7 @@ conda install -y -c conda-forge gxx_linux-64=14.2 sysroot_linux-64=2.17 conda install -y mkl=2022.2.1 mkl-devel=2022.2.1 # Install libsvs-runtime from local conda package -conda install -y -c /runtime_conda libsvs-runtime +conda install -y /runtime_conda/libsvs-runtime-*.conda # Validate python and C++ tests against FAISS CI git clone -b eglaser/svs-runtime-conda-enabling https://github.com/ethanglaser/faiss.git From 15276bff78296dcef82e7567808aa330f57ba461 Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Tue, 30 Dec 2025 12:20:59 -0800 Subject: [PATCH 3/9] Initial attempt at public conda build --- .../workflows/build-cpp-runtime-bindings.yml | 17 ++++-- bindings/cpp/conda-recipe/build.sh | 48 +++++++++++++++ bindings/cpp/conda-recipe/meta.yaml | 61 +++++++++++++++++++ docker/x86_64/build-cpp-runtime-bindings.sh | 5 ++ 4 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 bindings/cpp/conda-recipe/build.sh create mode 100644 bindings/cpp/conda-recipe/meta.yaml diff --git a/.github/workflows/build-cpp-runtime-bindings.yml b/.github/workflows/build-cpp-runtime-bindings.yml index 81ba47ec0..2066166c2 100644 --- a/.github/workflows/build-cpp-runtime-bindings.yml +++ b/.github/workflows/build-cpp-runtime-bindings.yml @@ -67,6 +67,13 @@ jobs: path: svs-cpp-runtime-bindings${{ matrix.suffix }}.tar.gz retention-days: 7 # Reduce retention due to size + - name: Upload conda package artifacts + uses: actions/upload-artifact@v4 + with: + name: libsvs-runtime-conda${{ matrix.suffix }} + path: conda-bld/linux-64/libsvs-runtime-*.conda + retention-days: 7 + # Run unit tests that were built as part of this job - name: Run unit tests in Docker container run: | @@ -97,21 +104,21 @@ jobs: docker build -t svs-manylinux228:latest -f docker/x86_64/manylinux228/Dockerfile . # Need to download for a new job - - name: Download shared libraries + - name: Download conda package uses: actions/download-artifact@v7 with: - name: svs-cpp-runtime-bindings${{ matrix.suffix }} - path: runtime_lib + name: libsvs-runtime-conda${{ matrix.suffix }} + path: runtime_conda - name: List available artifacts run: | - ls -la runtime_lib/ + ls -la runtime_conda/ - name: Test in Docker container run: | docker run --rm \ -v ${{ github.workspace }}:/workspace \ - -v ${{ github.workspace }}/runtime_lib:/runtime_lib \ + -v ${{ github.workspace }}/runtime_conda:/runtime_conda \ -w /workspace \ -e SUFFIX=${{ matrix.suffix }} \ svs-manylinux228:latest \ diff --git a/bindings/cpp/conda-recipe/build.sh b/bindings/cpp/conda-recipe/build.sh new file mode 100644 index 000000000..a8e38f8de --- /dev/null +++ b/bindings/cpp/conda-recipe/build.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright 2025 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +# Source gcc-toolset-11 to ensure we use the system's GCC 11 +# This is required because we are not using Conda compilers +if [ -f "/opt/rh/gcc-toolset-11/enable" ]; then + source /opt/rh/gcc-toolset-11/enable +elif command -v scl_source >/dev/null 2>&1; then + source scl_source enable gcc-toolset-11 || true +else + echo "WARNING: gcc-toolset-11 not found, proceeding without sourcing it" +fi + +# build runtime tests flag? +CMAKE_ARGS=( + "-DCMAKE_INSTALL_PREFIX=${PREFIX}" + "-DSVS_RUNTIME_ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON}" +) + +# Add SVS_URL if specified (for fetching static library) +if [ -n "$SVS_URL" ]; then + CMAKE_ARGS+=("-DSVS_URL=$SVS_URL") +fi + +cmake -B build "${CMAKE_ARGS[@]}" -S . + +cmake --build build -j +cmake --install build + +# Create lib64 symlink if needed (for compatibility) +cd "${PREFIX}" +if [ ! -e lib64 ] && [ -d lib ]; then + ln -s lib lib64 +fi diff --git a/bindings/cpp/conda-recipe/meta.yaml b/bindings/cpp/conda-recipe/meta.yaml new file mode 100644 index 000000000..97b2375a6 --- /dev/null +++ b/bindings/cpp/conda-recipe/meta.yaml @@ -0,0 +1,61 @@ +# Copyright 2025 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +{% set version = '0.1.0' %} +{% set buildnumber = 0 %} +{% set variant_suffix = environ.get('SUFFIX', '') %} + +package: + name: libsvs-runtime + version: {{ version }} + +source: + path: ../../.. + +build: + number: {{ buildnumber }} + string: {{ GIT_DESCRIBE_HASH }}_{{ buildnumber }}{{ variant_suffix }} + skip: true # [not linux] + include_recipe: False + +requirements: + build: + # required for MAP_HUGE_* defines in allocator.h + - kernel-headers_linux-64 ==4.18.0 # [linux] + - python 3.10.* # Build tool only + run: + - python >=3.10 + +# Simple test validation handled in GitHub Actions + +about: + home: https://intel.github.io/ScalableVectorSearch/index.html + license: Intel Simplified Software License (Version October 2022) + license_file: + - distributions/LICENSE + - ScalableVectorSearch/THIRD-PARTY-PROGRAMS + summary: SVS C++ shared libraries for CMake integration + description: | + LEGAL NOTICE: Use of this software package is subject to the + software license agreement (as set forth above, in the license section of + the installed Conda package and/or the README file) and all notices, + disclaimers or license terms for third party or open source software + included in or with the software. +

+ EULA: Intel Simplified Software License (Version October 2022) +

+ This package provides pre-compiled SVS shared and static libraries with CMake configuration files for C++ development. + dev_url: https://github.com/intel/ScalableVectorSearch + doc_url: https://intel.github.io/ScalableVectorSearch/index.html diff --git a/docker/x86_64/build-cpp-runtime-bindings.sh b/docker/x86_64/build-cpp-runtime-bindings.sh index ab8897482..1597382f1 100644 --- a/docker/x86_64/build-cpp-runtime-bindings.sh +++ b/docker/x86_64/build-cpp-runtime-bindings.sh @@ -42,6 +42,11 @@ CC=gcc CXX=g++ cmake .. "${CMAKE_ARGS[@]}" cmake --build . -j cmake --install . +# Build conda package for cpp runtime bindings +source /opt/conda/etc/profile.d/conda.sh +cd /workspace +ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON} SVS_URL="${SVS_URL}" SUFFIX="${SUFFIX}" conda build bindings/cpp/conda-recipe --output-folder /workspace/conda-bld + # Create tarball with symlink for compatibility cd /workspace/install_cpp_bindings && \ ln -s lib lib64 && \ From adab13fc9cfa60cd4383ea1a607362fccdc0d9ac Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Tue, 30 Dec 2025 16:20:30 -0800 Subject: [PATCH 4/9] Add conda-build to docker env --- docker/x86_64/manylinux228/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/x86_64/manylinux228/Dockerfile b/docker/x86_64/manylinux228/Dockerfile index e8582b554..627327156 100644 --- a/docker/x86_64/manylinux228/Dockerfile +++ b/docker/x86_64/manylinux228/Dockerfile @@ -32,5 +32,7 @@ RUN echo '# Configure gcc-11' > /etc/profile.d/01-gcc.sh && \ # Download and install Miniforge RUN wget -nv https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O /tmp/miniforge.sh && \ bash /tmp/miniforge.sh -b -p /opt/conda && \ - rm /tmp/miniforge.sh + rm /tmp/miniforge.sh && \ + /opt/conda/bin/conda install -y conda-build && \ + /opt/conda/bin/conda clean -afy ENV PATH="/opt/conda/bin:$PATH" From 21d67dc44c4546ce23d8fc24e724a84f4ed7b0fb Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Mon, 5 Jan 2026 09:49:26 -0800 Subject: [PATCH 5/9] Update license paths --- bindings/cpp/conda-recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/cpp/conda-recipe/meta.yaml b/bindings/cpp/conda-recipe/meta.yaml index 97b2375a6..30d8b255c 100644 --- a/bindings/cpp/conda-recipe/meta.yaml +++ b/bindings/cpp/conda-recipe/meta.yaml @@ -44,8 +44,8 @@ about: home: https://intel.github.io/ScalableVectorSearch/index.html license: Intel Simplified Software License (Version October 2022) license_file: - - distributions/LICENSE - - ScalableVectorSearch/THIRD-PARTY-PROGRAMS + - LICENSE + - THIRD-PARTY-PROGRAMS summary: SVS C++ shared libraries for CMake integration description: | LEGAL NOTICE: Use of this software package is subject to the From 913cb193adc71dcb06970f674cbfc8e21a678ab9 Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Mon, 5 Jan 2026 15:53:21 -0800 Subject: [PATCH 6/9] Update cmake build path --- bindings/cpp/conda-recipe/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/cpp/conda-recipe/build.sh b/bindings/cpp/conda-recipe/build.sh index a8e38f8de..8b4347019 100644 --- a/bindings/cpp/conda-recipe/build.sh +++ b/bindings/cpp/conda-recipe/build.sh @@ -28,6 +28,7 @@ fi # build runtime tests flag? CMAKE_ARGS=( "-DCMAKE_INSTALL_PREFIX=${PREFIX}" + "-DSVS_BUILD_RUNTIME_TESTS=OFF" "-DSVS_RUNTIME_ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON}" ) @@ -36,7 +37,7 @@ if [ -n "$SVS_URL" ]; then CMAKE_ARGS+=("-DSVS_URL=$SVS_URL") fi -cmake -B build "${CMAKE_ARGS[@]}" -S . +cmake -B build "${CMAKE_ARGS[@]}" -S bindings/cpp cmake --build build -j cmake --install build From 20505217f74c865ed3a685253a5e6480cfcf8eed Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Tue, 6 Jan 2026 10:24:44 -0800 Subject: [PATCH 7/9] Exclude meta.yaml from precommit --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 244476136..2601df03a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,7 @@ repos: hooks: - id: check-yaml files: \.ya?ml$ + exclude: conda-recipe/meta\.yaml$ - id: check-added-large-files - id: check-illegal-windows-names - id: check-json From 66f60f6a97c4f02751d69e151678043508bc0d64 Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Tue, 6 Jan 2026 11:24:11 -0800 Subject: [PATCH 8/9] remove dashes in conda package name --- bindings/cpp/conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/cpp/conda-recipe/meta.yaml b/bindings/cpp/conda-recipe/meta.yaml index 30d8b255c..2f75ac699 100644 --- a/bindings/cpp/conda-recipe/meta.yaml +++ b/bindings/cpp/conda-recipe/meta.yaml @@ -15,7 +15,7 @@ {% set version = '0.1.0' %} {% set buildnumber = 0 %} -{% set variant_suffix = environ.get('SUFFIX', '') %} +{% set variant_suffix = environ.get('SUFFIX', '').replace('-', '_') %} package: name: libsvs-runtime From fdf50272626760241b8afee9d1a81d620fd08c66 Mon Sep 17 00:00:00 2001 From: ethanglaser <42726565+ethanglaser@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:17:37 -0800 Subject: [PATCH 9/9] Restore faiss clone to main branch --- docker/x86_64/test-cpp-runtime-bindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/x86_64/test-cpp-runtime-bindings.sh b/docker/x86_64/test-cpp-runtime-bindings.sh index 143da1f47..db2b55ccc 100644 --- a/docker/x86_64/test-cpp-runtime-bindings.sh +++ b/docker/x86_64/test-cpp-runtime-bindings.sh @@ -32,7 +32,7 @@ conda install -y mkl=2022.2.1 mkl-devel=2022.2.1 conda install -y /runtime_conda/libsvs-runtime-*.conda # Validate python and C++ tests against FAISS CI -git clone -b eglaser/svs-runtime-conda-enabling https://github.com/ethanglaser/faiss.git +git clone https://github.com/facebookresearch/faiss.git cd faiss echo "==============================================="