Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sparsevec in weighted vector search function #328

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.3)
include(CheckSymbolExists)

set(LANTERN_VERSION 0.3.2)
set(LANTERN_VERSION 0.3.3)

project(
LanternDB
Expand Down Expand Up @@ -263,6 +263,7 @@ endif()
set (_update_files
sql/updates/0.3.0--0.3.1.sql
sql/updates/0.3.1--0.3.2.sql
sql/updates/0.3.2--0.3.3.sql
)

# Generate version information for the binary
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function setup_environment() {
export DEBIAN_FRONTEND=noninteractive
export PG_VERSION=${PG_VERSION:-15}
export GITHUB_OUTPUT=${GITHUB_OUTPUT:-/dev/null}
export PGVECTOR_VERSION=0.6.1
export PGVECTOR_VERSION=0.7.3-lanterncloud
#fix pg_cron at the latest commit of the time
export PG_CRON_COMMIT_SHA=7e91e72b1bebc5869bb900d9253cc9e92518b33f
}
Expand All @@ -41,7 +41,7 @@ function clone_or_use_source() {
function install_external_dependencies() {
# Install pgvector
pushd /tmp
wget --quiet -O pgvector.tar.gz https://github.com/pgvector/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz
wget --quiet -O pgvector.tar.gz https://github.com/lanterndata/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz
tar xzf pgvector.tar.gz
rm -rf pgvector || true
mv pgvector-${PGVECTOR_VERSION} pgvector
Expand Down
10 changes: 5 additions & 5 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG VERSION=15
ARG PGVECTOR_VERSION=0.5.1
ARG PGVECTOR_VERSION=0.7.3-lanterncloud
#fix pg_cron at the latest commit of the time
ARG PG_CRON_COMMIT_SHA=7e91e72b1bebc5869bb900d9253cc9e92518b33f

Expand Down Expand Up @@ -31,7 +31,7 @@ RUN gem install pg -- --with-pg-include=/usr/local/pgsql/include/ --with-pg-lib=
# hack to make sure postgres user has write access to externally mounted volumes
RUN mkdir /lantern_shared && chown postgres:postgres /lantern_shared

RUN cd /root/postgresql-15.5/contrib && make install -j
RUN cd /root/postgresql-15.5/contrib && make install
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info: Removed '-j' flag from make install. This might slow down the build process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Contributor Author

@dqii dqii Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

440.5 /usr/bin/install -c -m 755  postgres_fdw.so '/usr/local/pgsql/lib/postgres_fdw.so'
440.5 /usr/bin/install -c -m 644 ./postgres_fdw.control '/usr/local/pgsql/share/extension/'
440.6 /usr/bin/install -c -m 644 ./postgres_fdw--1.0.sql ./postgres_fdw--1.0--1.1.sql  '/usr/local/pgsql/share/extension/'
440.6 make[1]: Leaving directory '/root/postgresql-15.5/contrib/postgres_fdw'
------
Dockerfile.dev:34
--------------------
  32 |     RUN mkdir /lantern_shared && chown postgres:postgres /lantern_shared
  33 |     
  34 | >>> RUN cd /root/postgresql-15.5/contrib && make install -j
  35 |     
  36 |     # allow non-root users to install in the container to make it easier to run update-tests
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /root/postgresql-15.5/contrib && make install -j" did not complete successfully: exit code: 2

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/ojyc3i59rx9nve3a7qeqpdid7
diqi@Dis-Laptop lantern % 

The error I get with -j


# allow non-root users to install in the container to make it easier to run update-tests
RUN chmod -R 777 /usr/local/pgsql/lib/ /usr/local/pgsql/share/extension/ /usr/local/pgsql/include/server/
Expand All @@ -41,7 +41,7 @@ USER postgres
RUN pip install GitPython libtmux

# Build & Install pgvector
RUN wget --quiet -O pgvector.tar.gz https://github.com/pgvector/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz && \
RUN wget --quiet -O pgvector.tar.gz https://github.com/lanterndata/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz && \
tar xzf pgvector.tar.gz && \
(cd pgvector-${PGVECTOR_VERSION} && make -j && make install)

Expand All @@ -55,7 +55,7 @@ COPY . .
RUN sudo rm -rf build \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Debug .. \
&& cmake .. \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info: Removed '-DCMAKE_BUILD_TYPE=Debug'. This changes the build type from Debug to default (usually Release). Ensure this is intentional and won't affect development workflows.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this?

The dockerfile is meant for development and I often use GDB from inside it, so having a build with symbols is often good.

Though, I usually attach a folder from host and rebuild the DB for debugging so not a big deal but would still like to know why the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build did not succeed for me without it

&& make -j install

# Install benchmarking tools in build folder
Expand All @@ -65,7 +65,7 @@ RUN git clone https://github.com/lanterndata/benchmark build/benchmark \
&& pip install -r external/requirements.txt

# Install perf
RUN sudo apt update && sudo apt install -y linux-tools-common linux-tools-generic linux-tools-`uname -r`
RUN sudo apt update && sudo apt install -y linux-tools-common linux-tools-generic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info: Removed 'linux-tools-uname -r'. This might cause issues if specific kernel version tools are needed.

# in host, enable perf_event paranoid via
# echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid

Expand Down
Loading
Loading