diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 131d048b..f867b8f8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -99,7 +99,7 @@ jobs: run: | # Start postgres sudo su postgres -c "PG_VERSION=$PG_VERSION RUN_TESTS=0 ./ci/scripts/run-tests-linux.sh" && \ - sudo su -c "cd /tmp/lantern/lantern_hnsw && PG_VERSION=$PG_VERSION ./cienv/bin/python ./scripts/test_updates.py -U postgres" &&\ + sudo su -c "cd /tmp/lantern && PG_VERSION=$PG_VERSION ./lantern_hnsw/cienv/bin/python ./lantern_hnsw/scripts/test_updates.py -U postgres --builddir ./lantern_hnsw/build_updates --rootdir ./lantern_hnsw" &&\ echo "Done with updates" env: PG_VERSION: ${{ matrix.postgres }} @@ -138,6 +138,7 @@ jobs: /tmp/pg-out.log /tmp/pg-error.log - name: Upload lantern coverage + if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 }} uses: actions/upload-artifact@v4 with: name: lantern-lcov.info @@ -196,6 +197,7 @@ jobs: DB_URL: "postgres://postgres@127.0.0.1:5432/postgres" - name: Upload lantern_extras coverage uses: actions/upload-artifact@v4 + if: ${{ startsWith(matrix.os, 'ubuntu') }} with: name: lantern-extras-lcov.info path: ./lantern-extras-lcov.info diff --git a/ci/scripts/run-benchmarks.sh b/ci/scripts/run-benchmarks.sh index 3280dbd5..896992ab 100755 --- a/ci/scripts/run-benchmarks.sh +++ b/ci/scripts/run-benchmarks.sh @@ -1,19 +1,7 @@ #!/bin/bash set -e -wait_for_pg(){ - tries=0 - until pg_isready -U postgres 2>/dev/null; do - if [ $tries -eq 10 ]; - then - echo "Can not connect to postgres" - exit 1 - fi - - sleep 1 - tries=$((tries+1)) - done -} +source "$(dirname "$0")/utils.sh" export WORKDIR=/tmp/lantern export PG_VERSION=15 @@ -28,7 +16,7 @@ echo "host all all ::1/128 trust" >> POSTGRES_HOST_AUTH_METHOD=trust /usr/lib/postgresql/$PG_VERSION/bin/postgres 1>/tmp/pg-out.log 2>/tmp/pg-error.log & wait_for_pg -cd $WORKDIR/build +cd $WORKDIR/lantern_hnsw/build export DATABASE_URL=postgresql://localhost:5432/postgres export LANTERN_DATABASE_URL=postgresql://localhost:5432/postgres diff --git a/lantern_extras/Cargo.toml b/lantern_extras/Cargo.toml index 55eb64eb..d7882d6d 100644 --- a/lantern_extras/Cargo.toml +++ b/lantern_extras/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lantern_extras" -version = "0.3.1" +version = "0.3.5" edition = "2021" [lib] diff --git a/lantern_hnsw/CMakeLists.txt b/lantern_hnsw/CMakeLists.txt index dc16a605..7e35e592 100644 --- a/lantern_hnsw/CMakeLists.txt +++ b/lantern_hnsw/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.3) include(CheckSymbolExists) -set(LANTERN_VERSION 0.3.4) +set(LANTERN_VERSION 0.3.5) project( LanternDB @@ -265,6 +265,7 @@ set (_update_files sql/updates/0.3.1--0.3.2.sql sql/updates/0.3.2--0.3.3.sql sql/updates/0.3.3--0.3.4.sql + sql/updates/0.3.4--0.3.5.sql ) # Generate version information for the binary diff --git a/lantern_hnsw/scripts/test_updates.py b/lantern_hnsw/scripts/test_updates.py index bbca97bf..6fa67011 100644 --- a/lantern_hnsw/scripts/test_updates.py +++ b/lantern_hnsw/scripts/test_updates.py @@ -100,7 +100,7 @@ def update_from_tag(from_version: str, to_version: str, starting_point = None): # checkout to latest to make sure we always run the latest version of all scripts repo.git.checkout(from_tag) # run "mkdir build && cd build && cmake .. && make -j4 && make install" - res = shell(f"mkdir -p {args.builddir} ; cd {args.builddir} && git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} .. && make -j install") + res = shell(f"mkdir -p {args.builddir} ; git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} -S {args.rootdir} -B {args.builddir} && make -j install") repo.git.checkout(starting_sha) @@ -121,7 +121,7 @@ def update_from_tag(from_version: str, to_version: str, starting_point = None): res = shell(f"cd {args.builddir} ; UPDATE_EXTENSION=1 UPDATE_FROM={from_version} UPDATE_TO={from_version} make test-misc FILTER=begin") repo.git.checkout(to_sha) - res = shell(f"cd {args.builddir} ; git submodule update --init --recursive && cmake -DRELEASE_ID={to_version} .. && make -j install") + res = shell(f"git submodule update --init --recursive && cmake -DRELEASE_ID={to_version} -S {args.rootdir} -B {args.builddir} && cd {args.builddir} && make -j install") repo.git.checkout(starting_sha) res = shell(f"cd {args.builddir} ; UPDATE_EXTENSION=1 UPDATE_FROM={from_version} UPDATE_TO={from_version} make test-misc FILTER=version_mismatch") @@ -168,7 +168,8 @@ def incompatible_version(pg_version, version_tag): help='Tag to update to', required=False) parser.add_argument("-db", "--db", default="update_db", type=str, help="Database name used for updates") parser.add_argument("-U", "--user", default=default_user, help="Database user") - parser.add_argument("-builddir", "--builddir", default="build_updates", help="Database user") + parser.add_argument("-builddir", "--builddir", default="build_updates", help="Build directory") + parser.add_argument("-rootdir", "--rootdir", default=".", help="Root directory") args = parser.parse_args() @@ -183,7 +184,7 @@ def incompatible_version(pg_version, version_tag): exit(1) # test updates from all tags - version_pairs = [update_fname.split("--") for update_fname in os.listdir("sql/updates")] + version_pairs = [update_fname.split("--") for update_fname in os.listdir(f"{args.rootdir}/sql/updates")] version_pairs = [(from_version, to_version.split('.sql')[0]) for from_version, to_version in version_pairs] repo = git.Repo(search_parent_directories=True) tags_actual = [tag.name for tag in repo.tags] diff --git a/lantern_hnsw/sql/updates/0.3.4--0.3.5.sql b/lantern_hnsw/sql/updates/0.3.4--0.3.5.sql new file mode 100644 index 00000000..e69de29b