Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mslacken:ml
milvus
milvus.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File milvus.spec of Package milvus
# # spec file for package milvus # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} #!BuildTarget: x86_64_v3-linux %if "%{flavor}" == "cppcore" %bcond_without cppcore %else %{nil} %endif %define milvus_proto_vers 2.4.11 %define milvus_storage_vers 9d1ad9c %define knowhere_vers 2.3.8 Name: milvus Version: 2.4.11 Release: 0 Summary: cloud-native vector database, storage for next generation AI applications License: Apache-2.0 URL: https://milvus.io/ Source0: %{name}-%{version}.tar # see comment in _service in how to create the vendor directory Source1: vendor.tar.xz Source2: https://github.com/milvus-io/milvus-proto/archive/v%{milvus_proto_vers}.tar.gz#/milvus-proto-%{milvus_proto_vers}.tar.gz Source3: https://github.com/milvus-io/milvus-storage/archive/%{milvus_storage_vers}.tar.gz#/milvus-storage-%{milvus_storage_vers}.tar.gz Source4: https://github.com/zilliztech/knowhere/archive/v%{knowhere_vers}.tar.gz#/knowhere-%{knowhere_vers}.tar.gz Source10: CMakeLists.txt-milvus-storage Source20: tantivy-config.toml Source21: tantivy-vendor.tar.xz # patch for vendored third party stuff, I hate them so much Source50: knowhere-opentelemetry.patch Patch0: build-without-conan.patch Patch1: fix-simjson.patch Patch2: correct-third_party-location.patch Patch3: tantivity-local-install.patch Patch6: include-gflags-if-they-are-used.patch #Patch8: additional-libraries.patch Patch8: add-shared-libs-to-milvus-common.patch Patch9: google-cpp-2_25-handling.patch BuildRequires: gcc13 BuildRequires: gcc13-c++ BuildRequires: go >= 1.21 BuildRequires: librdkafka-devel BuildRequires: opentelemetry-cpp_19-devel BuildRequires: pkgconfig BuildRequires: protobuf-devel #BuildRequires: protoc-gen-go132 BuildRequires: protoc-gen-go BuildRequires: protoc-gen-go-grpc BuildRequires: rocksdb6-devel %if %{without cppcore} BuildRequires: milvus-cpp-core BuildRequires: milvus-cpp-core-devel %else BuildRequires: aws-c-auth-devel BuildRequires: aws-c-common-devel BuildRequires: aws-c-http-devel BuildRequires: aws-c-io-devel BuildRequires: aws-c-mqtt-devel BuildRequires: aws-c-s3-devel BuildRequires: aws-c-sdkutils-devel BuildRequires: aws-crt-cpp-devel BuildRequires: aws-sdk-cpp-devel BuildRequires: aws-sdk-cpp-libs BuildRequires: cargo1.79 BuildRequires: cblas-devel BuildRequires: cmake BuildRequires: conan BuildRequires: double-conversion-devel BuildRequires: fmt-9-devel BuildRequires: folly-devel BuildRequires: gflags-devel BuildRequires: git BuildRequires: glog-devel BuildRequires: gmock BuildRequires: google-cloud-cpp25-devel BuildRequires: gtest BuildRequires: jemalloc-devel BuildRequires: libboost_context-devel BuildRequires: libboost_filesystem-devel BuildRequires: libboost_program_options-devel BuildRequires: libboost_regex-devel BuildRequires: libboost_system-devel BuildRequires: libboost_thread-devel BuildRequires: libdwarf-devel BuildRequires: libevent-devel BuildRequires: libgoogle_cloud_cpp252 BuildRequires: libuuid-devel BuildRequires: marisa-devel BuildRequires: openblas-devel BuildRequires: pkgconfig BuildRequires: protobuf-devel BuildRequires: rapidjson-devel BuildRequires: roaring-devel BuildRequires: rust1.79 BuildRequires: s2n-devel BuildRequires: simdjson-devel BuildRequires: tbb-devel BuildRequires: xz BuildRequires: cmake(Catch2) BuildRequires: cmake(Snappy) BuildRequires: cmake(arrow) BuildRequires: cmake(aws-c-cal) BuildRequires: cmake(aws-c-compression) BuildRequires: cmake(aws-c-event-stream) BuildRequires: cmake(aws-checksums) BuildRequires: cmake(nlohmann_json) BuildRequires: cmake(prometheus-cpp) BuildRequires: cmake(re2) BuildRequires: cmake(yaml-cpp) BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(liblz4) %endif %define make_depend_src() test -e %{?2}%{!?2:$(basename %1| sed 's/-.*//')} && rmdir %{?2}%{!?2:$(basename %1| sed 's/-.*//')}; tar xzf %1; mv $(basename %{1} | sed 's/\.tar\.gz//' )* %{?2}%{!?2:$(basename %1| sed 's/-.*//')} %description Milvus is an open-source vector database built to power embedding similarity search and AI applications. Milvus makes unstructured data search more accessible, and provides a consistent user experience regardless of the deployment environment. %if %{with cppcore} %package cpp-core Summary: The cpp core of milvus, including knowhere %description cpp-core Milvus is an open-source vector database built to power embedding similarity search and AI applications. Milvus makes unstructured data search more accessible, and provides a consistent user experience regardless of the deployment environment. %package cpp-core-devel Summary: The cpp core of milvus, including knowhere Requires: milvus-cpp-core = %{version} %description cpp-core-devel Milvus is an open-source vector database built to power embedding similarity search and AI applications. Milvus makes unstructured data search more accessible, and provides a consistent user experience regardless of the deployment environment. %endif %prep %autosetup -p1 -a1 test -f vendor.tar && tar xf vendor.tar mkdir -p cmake_build/thirdparty pushd . cd cmake_build/thirdparty %make_depend_src %{SOURCE2} milvus-proto popd pushd . cd internal/core/thirdparty %make_depend_src %{SOURCE3} milvus-storage/milvus-storage-src # ugly method to patch vendored source cp %{SOURCE10} milvus-storage/milvus-storage-src/cpp/CMakeLists.txt # hard way patching sed -i 's/arrow::internal::Uri/arrow::util::Uri/g' milvus-storage/milvus-storage-src/cpp/src/common/fs_util.cpp %make_depend_src %{SOURCE4} knowhere/knowhere-src cd knowhere/knowhere-src #patch -p1 < %{S:50} popd # setup rust vendor stuff for tantivy pushd . mkdir -p ~/.cargo/bin/ cd internal/core/thirdparty/tantivy/tantivy-binding mkdir -p .cargo cp %{SOURCE20} .cargo/config.toml tar xJf %{SOURCE21} # tantivy bindings are severly br0ken mkdir -p ~/usr/include \ ~/usr/lib \ %{nil} popd # some more weired thing to setup testing of tantivity mkdir -p ~/usr/lib ~/usr/lib %build # create protobuf for milvus core mkdir -p cmake_build/bin ln -s $(which protoc) cmake_build/bin/protoc pwd ./scripts/generate_proto.sh find internal/core/thirdparty/milvus-storage/milvus-storage-src -name \*.pb.\* -delete # proto files from milvus-storage make -C internal/core/thirdparty/milvus-storage/milvus-storage-src/cpp proto make -C internal/core/thirdparty/milvus-storage/milvus-storage-src/go proto # build the c++ core of mivlus export CXX=g++-13 export CC=gcc-13 %if %{with cppcore} export CXXFLAGS="-Wno-error=return-type " export CXXFLAGS="${CXXFLAGS} -march=x86-64-v3" # this is realy ugly, parts of milvus sue -msse4.2 what # will make the code only to runable on x86-64-v3 so set # set this explicitly. Also folly needs this export CXXFLAGS="${CXXFLAGS} -DGLOG_USE_GLOG_EXPORT" # milvus doesn't start glog correctly export CXXFLAGS="${CXXFLAGS} -DHAVE_ABSEIL" # avoid opentelemetry-cpp to use its own deprecated abseil export CXXFLAGS="${CXXFLAGS} -DHAVE_CPP_STDLIB -DHAVE_GSL" # add some more flags, which would be fixed in # newer opentelemetry-cpp version, which deprectated # Jaeger so we can't use them #export CXXFLAGS="-Wno-error=return-type -msse4.2 -DGLOG_USE_GLOG_EXPORT" pushd . cd internal/core #-DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \ %cmake \ -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \ -DCMAKE_POLICY_DEFAULT_CMP0167=OLD \ -DCMAKE_CXX_STANDARD=17 \ -DFETCHCONTENT_FULLY_DISCONNECTED=ON \ -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS \ -DWITH_CONAN=OFF \ -DMILVUS_DEPENDENCY_SOURCE=SYSTEM \ -DWITH_COVERAGE=OFF \ -DWITH_UT=OFF \ -DBUILD_STATIC=OFF \ -DWITH_LIGHT=ON \ %{nil} %cmake_build popd %else # now the go build export OBJPREFIX="github.com/milvus-io/milvus/cmd/milvus" export BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)" export GOFLAGS="-buildmode=pie" export CGO_LDFLAGS="-labsl_hash" CGO_ENABLED="1" GO111MODULE=on go build \ -ldflags=" -X=${OBJPREFIX}.BuildTime=${BUILD_DATE}" \ -tags dynamic -mod vendor -o milvus ./cmd/main.go %endif %install %if %{without cppcore} mkdir -p %{buildroot}/usr/bin/ cat <<EOF > %{buildroot}/usr/bin/milvus #!/bin/bash export MILVUSCONF=/etc/milvus/configs/ milvus-server $@ EOF chmod 755 %{buildroot}/usr/bin/milvus install -Dm 755 milvus %{buildroot}/usr/bin/milvus-server install -Dm 755 configs/milvus.yaml %{buildroot}/etc/milvus/configs/milvus.yaml install -Dm 755 configs/advanced/etcd.yaml %{buildroot}/etc/milvus/configs/advanced/etcd.yaml install -Dm 644 build/rpm/services/milvus.service %{buildroot}%{_unitdir}/milvus.service #install -Dm 644 services/milvus-etcd.service %{buildroot}/etc/systemd/system/milvus-etcd.service #install -Dm 644 services/milvus-minio.service %{buildroot}/etc/systemd/system/milvus-minio.service mkdir -p %{buildroot}%{_sbindir}/ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcmilvus %else cd internal/core mkdir build/lib %cmake_install rm -r %{buildroot}%{_libdir}/objects-RelWithDebInfo %endif %pre %service_add_pre milvus.service %post %service_add_post milvus.service %preun %service_del_preun milvus.service %postun %service_del_postun milvus.service %if %{without cppcore} %files %license LICENSE %doc README.md %{_bindir}/milvus %{_bindir}/milvus-server %{_sysconfdir}/milvus %{_sbindir}/rcmilvus %{_unitdir}/milvus.service %endif %if %{with cppcore} %files cpp-core %license LICENSE %doc README.md %{_libdir}/libknowhere.so %{_libdir}/libmilvus*.so %files cpp-core-devel %{_libdir}/pkgconfig/milvus* %{_includedir}/storage %{_includedir}/segcore %{_includedir}/knowhere %{_includedir}/indexbuilder %{_includedir}/common %{_includedir}/clustering %{_includedir}/futures %{_includedir}/monitor %endif %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor