From 5558538e355b3fca768164095c27dd24ec4e5e02 Mon Sep 17 00:00:00 2001 From: Dhanus Date: Tue, 16 Jan 2024 17:56:20 +0530 Subject: [PATCH] build: AppImage release (#3343) * fix: formatting * build: AppImage release * chore: add x86_64 in file name * chore: appimage issues fix * chore: remove chmod * build: appimage on ubuntu 20.04 * fix: formatting * build: AppImage release * chore: add x86_64 in file name * chore: appimage issues fix * chore: remove chmod * build: appimage on ubuntu 20.04 * include web ui * fix: linux build * fix: use UI files within appimage instead of copying * chore: cleanup --- .github/workflows/release-artifacts.yml | 90 +++++++++++++++++++++---- pkg/appimage/AppRun.sh | 5 ++ pkg/appimage/qdrant.desktop | 13 ++++ 3 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 pkg/appimage/AppRun.sh create mode 100644 pkg/appimage/qdrant.desktop diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 5375388d25..b22794ac3e 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -23,13 +23,17 @@ jobs: steps: - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y gcc-multilib clang cmake protobuf-compiler - rustup default stable - rustup update - rustup show - cargo -Vv + sudo apt-get update + sudo apt-get install -y gcc-multilib clang cmake protobuf-compiler + rustup default stable + rustup update + rustup show + cargo -Vv - uses: actions/checkout@v4 + - name: Install Protoc + uses: arduino/setup-protoc@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Install cross-compilation tools @@ -70,12 +74,12 @@ jobs: steps: - name: Install dependencies run: | - brew update-reset - brew install gcc cmake protobuf-c - rustup default stable - rustup update - rustup show - cargo -Vv + brew update-reset + brew install gcc cmake protobuf-c + rustup default stable + rustup update + rustup show + cargo -Vv - uses: actions/checkout@v4 - name: Build and publish uses: taiki-e/upload-rust-binary-action@v1 @@ -108,3 +112,65 @@ jobs: with: bin: qdrant token: ${{ secrets.GITHUB_TOKEN }} + + build-app-image: + strategy: + matrix: + include: + - os: ubuntu-20.04 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc-multilib clang cmake protobuf-compiler libfuse2 + + - name: Install Protoc + uses: arduino/setup-protoc@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Build release binary + run: cargo build --release + + - name: Build AppImage + shell: bash + run: | + mkdir -p AppDir + cp docs/logo.svg qdrant.svg + cp target/release/qdrant . + + curl -Lo linuxdeploy-x86_64.AppImage \ + https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + chmod +x linuxdeploy-x86_64.AppImage + + ./linuxdeploy-x86_64.AppImage \ + --appdir AppDir \ + --executable qdrant \ + -d pkg/appimage/qdrant.desktop \ + -i qdrant.svg \ + --custom-apprun pkg/appimage/AppRun.sh + + wget -O dist-qdrant.zip "$(curl --silent "https://api.github.com/repos/qdrant/qdrant-web-ui/releases/latest" | jq -r '.assets[] | select(.name=="dist-qdrant.zip") | .browser_download_url')" + unzip -o dist-qdrant.zip -d static + mv -n static/dist/* static/ + rm -rf static/dist + mv static AppDir/usr/share + + ./linuxdeploy-x86_64.AppImage \ + --appdir AppDir \ + --output appimage + + - name: Upload AppImage + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "qdrant-x86_64.AppImage" + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/pkg/appimage/AppRun.sh b/pkg/appimage/AppRun.sh new file mode 100644 index 0000000000..cdb7c1648d --- /dev/null +++ b/pkg/appimage/AppRun.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +APPDIR="$(dirname "$(readlink -f "$0")")" +export QDRANT__SERVICE__STATIC_CONTENT_DIR="$APPDIR/usr/share/static" +exec "$APPDIR/usr/bin/qdrant" "$@" diff --git a/pkg/appimage/qdrant.desktop b/pkg/appimage/qdrant.desktop new file mode 100644 index 0000000000..57724d0bc5 --- /dev/null +++ b/pkg/appimage/qdrant.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=qdrant +GenericName=Vector Database +Comment=Advanced and High-Performant Vector Search Technology +TryExec=qdrant +Exec=qdrant %F +Terminal=true +Type=Application +Keywords=Database; +Icon=qdrant +Categories=Utility; +StartupNotify=false +