Skip to content

Commit

Permalink
update version, fix test_updates script
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Oct 8, 2024
1 parent 6c8816e commit cf797b3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -196,6 +197,7 @@ jobs:
DB_URL: "postgres://[email protected]: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
Expand Down
16 changes: 2 additions & 14 deletions ci/scripts/run-benchmarks.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lantern_extras/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lantern_extras"
version = "0.3.1"
version = "0.3.5"
edition = "2021"

[lib]
Expand Down
3 changes: 2 additions & 1 deletion lantern_hnsw/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.4)
set(LANTERN_VERSION 0.3.5)

project(
LanternDB
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lantern_hnsw/scripts/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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")
Expand Down Expand Up @@ -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()

Expand All @@ -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]
Expand Down
Empty file.

0 comments on commit cf797b3

Please sign in to comment.