-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: - add `Vectorchord` into `vchord_bm25-postgres` docker image - align package name to tensorchord/VectorChord#179 - change runner from `ubicloud-standard-4` to `ubuntu-22.04` test action: https://github.com/silver-ymz/VectorChord-bm25/actions/runs/13177519564 --------- Signed-off-by: Mingzhuo Yin <[email protected]>
- Loading branch information
1 parent
6ce2886
commit d938e20
Showing
8 changed files
with
45 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
ARG PG_VERSION=17 | ||
ARG PGVECTOR=0.8.0 | ||
ARG VCHORD_VERSION=0.2.0 | ||
|
||
FROM pgvector/pgvector:${PGVECTOR}-pg${PG_VERSION} | ||
FROM tensorchord/vchord-postgres:pg${PG_VERSION}-v${VCHORD_VERSION} | ||
|
||
ARG PG_VERSION | ||
ARG SEMVER=0.0.0 | ||
ARG TARGETARCH | ||
|
||
RUN echo ${PG_VERSION} | ||
COPY ./build/vchord-bm25-pg${PG_VERSION}_${SEMVER}_${TARGETARCH}.deb /tmp/vchord-bm25.deb | ||
COPY ./build/postgresql-${PG_VERSION}-vchord-bm25_${SEMVER}-1_${TARGETARCH}.deb /tmp/vchord-bm25.deb | ||
RUN apt-get install -y /tmp/vchord-bm25.deb && rm -f /tmp/vchord-bm25.deb | ||
|
||
CMD ["postgres", "-c" ,"shared_preload_libraries=vchord_bm25.so"] | ||
CMD ["postgres", "-c" ,"shared_preload_libraries=vchord.so,vchord_bm25.so"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,39 +6,40 @@ printf "VERSION = ${VERSION}\n" | |
printf "ARCH = ${ARCH}\n" | ||
printf "PLATFORM = ${PLATFORM}\n" | ||
|
||
rm -rf ./build/dir_zip | ||
rm -rf ./build/vchord-bm25-pg${VERSION}_${ARCH}-unknown-linux-gnu_${SEMVER}.zip | ||
rm -rf ./build/dir_deb | ||
rm -rf ./build/vchord-bm25-pg${VERSION}_${SEMVER}_${PLATFORM}.deb | ||
cargo build --lib --features pg$VERSION --release | ||
cargo pgrx schema --features pg$VERSION --out ./target/schema.sql | ||
|
||
mkdir -p ./build/dir_zip | ||
cp ./target/release/schema.sql ./build/dir_zip/vchord_bm25--$SEMVER.sql | ||
sed -e "s/@CARGO_VERSION@/$SEMVER/g" < ./vchord_bm25.control > ./build/dir_zip/vchord_bm25.control | ||
cp ./target/release/libvchord_bm25.so ./build/dir_zip/vchord_bm25.so | ||
zip ./build/vchord-bm25-pg${VERSION}_${ARCH}-unknown-linux-gnu_${SEMVER}.zip -j ./build/dir_zip/* | ||
rm -rf ./build | ||
|
||
mkdir -p ./build/dir_deb | ||
mkdir -p ./build/dir_deb/DEBIAN | ||
mkdir -p ./build/dir_deb/usr/share/postgresql/$VERSION/extension/ | ||
mkdir -p ./build/dir_deb/usr/lib/postgresql/$VERSION/lib/ | ||
for file in $(ls ./build/dir_zip/*.sql | xargs -n 1 basename); do | ||
cp ./build/dir_zip/$file ./build/dir_deb/usr/share/postgresql/$VERSION/extension/$file | ||
mkdir -p ./build/zip | ||
[[ -d ./sql/upgrade ]] && cp -a ./sql/upgrade/. ./build/zip/ | ||
cp ./target/schema.sql ./build/zip/vchord_bm25--$SEMVER.sql | ||
sed -e "s/@CARGO_VERSION@/$SEMVER/g" < ./vchord_bm25.control > ./build/zip/vchord_bm25.control | ||
cp ./target/release/libvchord_bm25.so ./build/zip/vchord_bm25.so | ||
zip ./build/postgresql-${VERSION}-vchord-bm25_${SEMVER}_${ARCH}-linux-gnu.zip -j ./build/zip/* | ||
|
||
mkdir -p ./build/deb | ||
mkdir -p ./build/deb/DEBIAN | ||
mkdir -p ./build/deb/usr/share/postgresql/$VERSION/extension/ | ||
mkdir -p ./build/deb/usr/lib/postgresql/$VERSION/lib/ | ||
for file in $(ls ./build/zip/*.sql | xargs -n 1 basename); do | ||
cp ./build/zip/$file ./build/deb/usr/share/postgresql/$VERSION/extension/$file | ||
done | ||
for file in $(ls ./build/dir_zip/*.control | xargs -n 1 basename); do | ||
cp ./build/dir_zip/$file ./build/dir_deb/usr/share/postgresql/$VERSION/extension/$file | ||
for file in $(ls ./build/zip/*.control | xargs -n 1 basename); do | ||
cp ./build/zip/$file ./build/deb/usr/share/postgresql/$VERSION/extension/$file | ||
done | ||
for file in $(ls ./build/dir_zip/*.so | xargs -n 1 basename); do | ||
cp ./build/dir_zip/$file ./build/dir_deb/usr/lib/postgresql/$VERSION/lib/$file | ||
for file in $(ls ./build/zip/*.so | xargs -n 1 basename); do | ||
cp ./build/zip/$file ./build/deb/usr/lib/postgresql/$VERSION/lib/$file | ||
done | ||
echo "Package: vchord-bm25-pg${VERSION} | ||
echo "Package: postgresql-${VERSION}-vchord-bm25 | ||
Version: ${SEMVER} | ||
Section: database | ||
Priority: optional | ||
Architecture: ${PLATFORM} | ||
Maintainer: Tensorchord <[email protected]> | ||
Description: Vector database plugin for Postgres, written in Rust, specifically designed for LLM | ||
Description: Native BM25 Ranking Index in PostgreSQL | ||
Homepage: https://github.com/tensorchord/VectorChord-bm25/ | ||
License: AGPLv3 or ELv2" \ | ||
> ./build/dir_deb/DEBIAN/control | ||
(cd ./build/dir_deb && md5sum usr/share/postgresql/$VERSION/extension/* usr/lib/postgresql/$VERSION/lib/*) > ./build/dir_deb/DEBIAN/md5sums | ||
dpkg-deb -Zxz --build ./build/dir_deb/ ./build/vchord-bm25-pg${VERSION}_${SEMVER}_${PLATFORM}.deb | ||
License: AGPL-3.0-only or Elastic-2.0" \ | ||
> ./build/deb/DEBIAN/control | ||
(cd ./build/deb && md5sum usr/share/postgresql/$VERSION/extension/* usr/lib/postgresql/$VERSION/lib/*) > ./build/deb/DEBIAN/md5sums | ||
dpkg-deb --root-owner-group -Zxz --build ./build/deb/ ./build/postgresql-${VERSION}-vchord-bm25_${SEMVER}-1_${PLATFORM}.deb |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.