diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 43adb484..aaccca3a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,13 +37,13 @@ jobs: run: sudo sh -c "GITHUB_OUTPUT=$GITHUB_OUTPUT ./ci/scripts/package-archive.sh" - name: Upload deb package artifacts uses: actions/upload-artifact@v4 - if: ${{ steps.build.outputs.deb_package_path != '' }} + if: ${{ steps.build.outputs.deb_package_path != '' && github.event_name == 'workflow_dispatch' && inputs.create_release }} with: name: ${{ steps.build.outputs.deb_package_name }} path: ${{ steps.build.outputs.deb_package_path }} - name: Upload archive package artifacts uses: actions/upload-artifact@v4 - if: ${{ steps.archive.outputs.archive_package_path != '' }} + if: ${{ steps.archive.outputs.archive_package_path != '' && github.event_name == 'workflow_dispatch' && inputs.create_release }} with: name: ${{ steps.archive.outputs.archive_package_name }} path: ${{ steps.archive.outputs.archive_package_path }} @@ -68,12 +68,13 @@ jobs: run: sudo su -c "PACKAGE_CLI=1 GITHUB_OUTPUT=$GITHUB_OUTPUT ./ci/scripts/build-extras.sh" if: ${{ matrix.postgres == 15 }} # run only once - name: Upload archive package artifacts + if: ${{ github.event_name == 'workflow_dispatch' && inputs.create_release }} uses: actions/upload-artifact@v4 with: name: ${{ steps.build.outputs.archive_package_name }} path: ${{ steps.build.outputs.archive_package_path }} - name: Upload Lantern CLI artifacts - if: ${{ matrix.postgres == 15 }} # run only once + if: ${{ matrix.postgres == 15 && github.event_name == 'workflow_dispatch' && inputs.create_release }} # run only once uses: actions/upload-artifact@v4 with: name: ${{ steps.build_cli.outputs.cli_package_name }} diff --git a/ci/scripts/build-extras.sh b/ci/scripts/build-extras.sh index 3147c6f1..3dc17712 100755 --- a/ci/scripts/build-extras.sh +++ b/ci/scripts/build-extras.sh @@ -3,10 +3,14 @@ set -e function setup_onnx() { + source "$(dirname "$0")/../../lantern_hnsw/scripts/get_arch_and_platform.sh" pushd /tmp ONNX_VERSION="1.16.1" PACKAGE_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz" && \ - if [[ $ARCH == *"arm"* ]]; then PACKAGE_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-aarch64-${ONNX_VERSION}.tgz"; fi && \ + case "$ARCH" in \ + *arm*|aarch64) \ + PACKAGE_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-aarch64-${ONNX_VERSION}.tgz"; \ + esac && \ mkdir -p /usr/local/lib && \ cd /usr/local/lib && \ wget -q $PACKAGE_URL && \ @@ -15,6 +19,7 @@ function setup_onnx() { mv ./onnx* ./onnxruntime && \ echo /usr/local/lib/onnxruntime/lib > /etc/ld.so.conf.d/onnx.conf && \ ldconfig + echo "onnxruntime installed from package: $PACKAGE_URL" popd } @@ -105,7 +110,10 @@ then setup_environment setup_locale_and_install_packages clone_or_use_source - setup_rust + if ! command -v rustc 2>&1 >/dev/null + then + setup_rust + fi fi if [ ! -z "$SETUP_POSTGRES" ] diff --git a/lantern_hnsw/scripts/test_updates.py b/lantern_hnsw/scripts/test_updates.py index d1d3456a..75faa6b4 100644 --- a/lantern_hnsw/scripts/test_updates.py +++ b/lantern_hnsw/scripts/test_updates.py @@ -104,12 +104,12 @@ def update_from_tag(from_version: str, to_version: str, starting_point = None): repo.git.checkout(from_tag) # run "mkdir build && cd build && cmake .. && make -j4 && make install" res = shell(f"rm -rf {args.builddir} || true") - res = shell(f"mkdir -p {args.builddir} ; git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} -S {rootdir} -B {args.builddir} && cd {args.builddir} && make -j install") + res = shell(f"mkdir -p {args.builddir} ; git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} -S {rootdir} -B {args.builddir} && make -C {args.builddir} -j install") repo.git.checkout(starting_sha) # We are just compilinig again (not installing) # Because file structure was changed afte 0.3.5 version # And cmake complains that CMakeFiles does not exist - res = shell(f"rm -rf {args.builddir} third_party && mkdir -p {args.builddir} && git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} -S {args.rootdir} -B {args.builddir} && cd {args.builddir} && make -j") + res = shell(f"rm -rf {args.builddir} third_party && mkdir -p {args.builddir} && git submodule update --init --recursive && cmake -DRELEASE_ID={from_version} -S {args.rootdir} -B {args.builddir} && make -C {args.builddir} -j") res = shell(f"psql postgres -U {args.user} -c 'DROP DATABASE IF EXISTS {args.db};'")