Skip to content

Commit

Permalink
CI: fix onnx installation on arm instances
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Oct 8, 2024
1 parent 3667642 commit a75ffbe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
12 changes: 10 additions & 2 deletions ci/scripts/build-extras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
}

Expand Down Expand Up @@ -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" ]
Expand Down
4 changes: 2 additions & 2 deletions lantern_hnsw/scripts/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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};'")
Expand Down

0 comments on commit a75ffbe

Please sign in to comment.