diff options
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | makedeps.sh | 34 | ||||
-rw-r--r-- | valkey-search-offline.patch | 30 | ||||
-rw-r--r-- | valkey-search.spec | 109 |
5 files changed, 186 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/makedeps.sh b/makedeps.sh new file mode 100755 index 0000000..e579c73 --- /dev/null +++ b/makedeps.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo usage $0 version $# + exit 1 +fi + +gitclone() { + if [ -d $3 ]; then + echo "+ $3 already downloaded" + else + echo "+ cloning $1 in $3" + git clone --branch=$2 $1 \ + $3 --recurse-submodules --shallow-submodules \ + --depth=1 --single-branch + fi +} + +DIR=.build-release/.deps +mkdir -p $DIR +pushd $DIR + gitclone "https://github.com/google/highwayhash.git" master highwayhash + gitclone "https://github.com/google/googletest.git" main googletest + gitclone "https://github.com/grpc/grpc" v1.70.1 grpc +popd + +TAR=valkey-search-deps-$1.tgz +if [ -f $TAR ]; then + echo "+ $TAR already created" +else + echo "+ Archiving $TAR" + tar czf $TAR $DIR +fi +echo "+ Done" diff --git a/valkey-search-offline.patch b/valkey-search-offline.patch new file mode 100644 index 0000000..f7e5475 --- /dev/null +++ b/valkey-search-offline.patch @@ -0,0 +1,30 @@ +diff -up ./submodules/CMakeLists.txt.old ./submodules/CMakeLists.txt +--- ./submodules/CMakeLists.txt.old 2025-09-05 12:28:45.588076443 +0200 ++++ ./submodules/CMakeLists.txt 2025-09-05 12:28:57.141504699 +0200 +@@ -22,7 +22,7 @@ set(MODULE_GOOGLE_TEST "googletest") + + set(MODULES_INSTALL_PREFIX "${MODULES_DIR}/install") + +-find_program(_GIT_EXE git REQUIRED) ++find_program(_GIT_EXE git) + + # On some distros (mainly RedHat based) the cmake files might be installed under + # lib64/ and not under lib/, this function helps locating the cmake path for the +@@ -152,7 +152,7 @@ if(WITH_SUBMODULES_SYSTEM) + else() + # Pull submodules with a given branch / tag and build them + checkout_submodule_branch(${MODULE_GRPC} "https://github.com/grpc/grpc" +- "v1.70.1" "${MODULES_DIR}/grpc/build-release") ++ "v1.70.1" "${MODULES_DIR}/grpc") + + string(FIND "${DISTRO_NAME}" "alpine" POSITION) + if(POSITION GREATER -1) +@@ -173,7 +173,7 @@ else() + + checkout_submodule_branch( + ${MODULE_GOOGLE_TEST} "https://github.com/google/googletest.git" "main" +- "${MODULES_DIR}/googletest/build-release") ++ "${MODULES_DIR}/googletest") + + set(MODULES_COMMON_CMAKE_ARGS + "-DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${MODULES_INSTALL_PREFIX} -DCMAKE_CXX_STANDARD=20" diff --git a/valkey-search.spec b/valkey-search.spec new file mode 100644 index 0000000..b2b3dd8 --- /dev/null +++ b/valkey-search.spec @@ -0,0 +1,109 @@ +# remirepo/fedora spec file for valkey-search +# +# SPDX-FileCopyrightText: Copyright 2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +# +# Please, preserve the changelog entries +# + +%global cfgname search.conf +%global libname search.so +# Github forge +%global gh_vend valkey-io +%global gh_proj valkey-search +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +#global commit afe5de4ce52bb2b80af565a6f297bf330a65d0d8 +%global tag %{version} + +Name: valkey-search +Version: 1.0.1 +%forgemeta +Release: 1%{?dist} +Summary: Vector Similarity Search engine +# this module is BSD-3-Clause +# RapidJSON is MIT +License: BSD-3-Clause AND MIT +URL: %{forgeurl} +Source0: %{forgesource} +# see submodules/CMakeLists.txt +Source1: makedeps.sh +Source2: %{name}-deps-%{version}.tgz + +# fix check for cached sources +Patch0: %{name}-offline.patch + +BuildRequires: valkey-devel >= 8.0 +BuildRequires: ninja-build +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: openssl-devel +%if 0%{?fedora} >= 41 +BuildRequires: openssl-devel-engine +%endif + +Requires: valkey(modules_abi)%{?_isa} = %{valkey_modules_abi} +Requires: valkey >= 8.0 +Supplements: valkey + +Provides: bundled(highwayhash) +Provides: bundled(googletest) +Provides: bundled(grpc) = 1.70.1 + + + +%description +valkey-search (BSD-3-Clause), provided as a Valkey module, +is a high-performance Vector Similarity Search engine optimized +for AI-driven workloads. It delivers single-digit millisecond +latency and high QPS, capable of handling billions of vectors +with over 99% recall. + +valkey-search allows users to create indexes and perform similarity +searches, incorporating complex filters. It supports Approximate Nearest +Neighbor (ANN) search with HNSW and exact matching using K-Nearest Neighbors +(KNN). Users can index data using either Valkey Hash or Valkey-JSON data types. + +While valkey-search currently focuses on Vector Search, its goal is to extend +Valkey into a full-fledged search engine, supporting Full Text Search and +additional indexing options. + + +%prep +%setup -q -n %{gh_proj}-%{version} -a2 +%patch -P0 -p1 -b .offline + +: Configuration file +cat << EOF | tee %{cfgname} +# %{gh_proj} +loadmodule %{valkey_modules_dir}/%{libname} +EOF + +cp .build-release/.deps/grpc/LICENSE LICENSE.grpc +cp .build-release/.deps/highwayhash/LICENSE LICENSE.highwayhash +cp .build-release/.deps/googletest/LICENSE LICENSE.googletest + +: submodules list +grep -E '(github.com|"v)' submodules/CMakeLists.txt + + +%build +./build.sh --verbose + + +%install +install -Dpm755 .build-release/*%{libname} %{buildroot}%{valkey_modules_dir}/%{libname} +install -Dpm640 %{cfgname} %{buildroot}%{valkey_modules_cfg}/%{cfgname} + + +%files +%license LICENSE* +%doc *.md +%attr(0640, valkey, root) %config(noreplace) %{valkey_modules_cfg}/%{cfgname} +%{valkey_modules_dir}/%{libname} + + +%changelog +* Fri Sep 5 2025 Remi Collet <remi@remirepo.net> - 1.0.1-1 +- initial package |