Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 34cb629

Browse files
authored
Revert use of pre-built ort (#684)
Due to issues with signing build artifacts on macOS, we temporarily revert #231 (96cffe4).
1 parent 3f8437f commit 34cb629

File tree

194 files changed

+924
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+924
-203
lines changed

.gitattributes

Lines changed: 240 additions & 13 deletions
Large diffs are not rendered by default.

.github/workflows/dependencies.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Dependency matrix
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- "flake.nix"
8+
- "flake.lock"
9+
- ".github/workflows/dependencies.yml"
10+
11+
jobs:
12+
onnx-nix:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
package: [ onnxruntime ]
17+
target: [
18+
x86_64-unknown-linux-gnu,
19+
x86_64-darwin,
20+
aarch64-darwin,
21+
]
22+
23+
include:
24+
- target: x86_64-unknown-linux-gnu
25+
os: ubuntu-latest
26+
cross: false
27+
28+
- target: x86_64-darwin
29+
os: macos-11
30+
cross: false
31+
32+
runs-on: ${{ matrix.os }}
33+
steps:
34+
- name: Setting variables
35+
uses: actions/github-script@v6
36+
id: var
37+
with:
38+
script: |
39+
const target = ${{ matrix.cross }} && '-${{ matrix.target }}' || ''
40+
const package_name = '${{ matrix.package }}-static' + target
41+
core.setOutput('package-name', package_name)
42+
43+
- uses: actions/checkout@v3
44+
- run: env
45+
46+
- name: Setup nix
47+
uses: cachix/install-nix-action@v22
48+
with:
49+
github_access_token: "${{ secrets.GITHUB_TOKEN }}"
50+
51+
- name: Enable cachix
52+
uses: cachix/cachix-action@v12
53+
with:
54+
name: bloopai
55+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
56+
57+
- name: Build package ${{matrix.package}}-${{matrix.target}}
58+
env:
59+
PACKAGE_NAME: ${{ steps.var.outputs.package-name }}
60+
run: |
61+
package=$(nix build -L --json .#${{ env.PACKAGE_NAME }})
62+
package_path=$(echo $package | jq -r '.[0].outputs.out')
63+
echo package_path=$package_path >> $GITHUB_ENV
64+
mkdir ${{ env.PACKAGE_NAME }}_bundle
65+
cp -r $package_path/* ${{ env.PACKAGE_NAME }}_bundle
66+
67+
- name: Upload binaries
68+
env:
69+
PACKAGE_NAME: ${{ steps.var.outputs.package-name }}
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: "${{ matrix.package }}_${{ matrix.target }}"
73+
path: ${{ env.PACKAGE_NAME }}_bundle
74+
75+
qdrant-rustup:
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
package: [ qdrant ]
80+
target: [
81+
x86_64-unknown-linux-gnu,
82+
x86_64-apple-darwin,
83+
aarch64-apple-darwin,
84+
]
85+
86+
include:
87+
- target: x86_64-unknown-linux-gnu
88+
os: ubuntu-latest
89+
cross: false
90+
91+
- target: x86_64-apple-darwin
92+
os: macos-11
93+
cross: false
94+
95+
- target: aarch64-apple-darwin
96+
os: macos-11
97+
cross: true
98+
99+
runs-on: ${{ matrix.os }}
100+
steps:
101+
- name: Install Rust stable
102+
uses: actions-rs/toolchain@v1
103+
with:
104+
toolchain: stable
105+
profile: minimal
106+
target: ${{ matrix.target }}
107+
108+
- uses: cachix/install-nix-action@v22
109+
with:
110+
github_access_token: "${{ secrets.GITHUB_TOKEN }}"
111+
112+
- name: Install dependencies
113+
run: "nix profile install nixpkgs#protobuf"
114+
115+
- name: Build qdrant
116+
env:
117+
VERSION: 1.1.0
118+
run: |
119+
cargo install --target ${{ matrix.target }} --git https://github.com/qdrant/qdrant --tag v$VERSION --locked --root . qdrant
120+
121+
- name: Upload binaries
122+
uses: actions/upload-artifact@v3
123+
with:
124+
name: "${{ matrix.package }}_${{ matrix.target }}"
125+
path: bin

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ playwright-report
3737

3838
# local config
3939
/local_config.json
40-
41-
apps/desktop/src-tauri/dylibs/*.so
42-
apps/desktop/src-tauri/dylibs/*.dylib
43-
apps/desktop/src-tauri/dylibs/*.dll

.taurignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
server/bleep/bleep.db*
2-
apps/desktop/src-tauri/dylibs/*.so
3-
apps/desktop/src-tauri/dylibs/*.dylib
4-
apps/desktop/src-tauri/dylibs/*.dll

Cargo.lock

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,3 @@ inherits = "release"
1717
debug = true
1818
split-debuginfo = "unpacked"
1919
strip = "none"
20-
21-
[patch.crates-io]
22-
esaxx-rs = { git = "https://github.com/bloopai/esaxx-rs" }

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,15 @@ ENV CXX /usr/bin/clang++
2626
COPY server server
2727
COPY apps/desktop/src-tauri apps/desktop/src-tauri
2828
COPY Cargo.lock Cargo.toml .
29-
RUN --mount=target=/root/.cache/sccache,type=cache --mount=target=/build/target,type=cache \
29+
RUN --mount=target=/root/.cache/sccache,type=cache --mount=target=/build/target,type=cache \
3030
cargo --locked build -p bleep --release && \
3131
cp /build/target/release/bleep / && \
32-
sccache --show-stats && \
33-
mkdir /dylib && \
34-
cp /build/target/release/libonnxruntime.so /dylib/
32+
sccache --show-stats
3533

3634
FROM debian:bookworm-slim
3735
VOLUME ["/repos", "/data"]
3836
RUN apt-get update && apt-get -y install openssl ca-certificates libprotobuf-lite32 && apt-get clean
3937
COPY model /model
4038
COPY --from=builder /bleep /
41-
COPY --from=builder /dylib /dylib
4239
COPY --from=frontend /build/client/dist /frontend
43-
ENTRYPOINT ["/bleep", "--host=0.0.0.0", "--source-dir=/repos", "--index-dir=/data", "--model-dir=/model", "--dylib-dir=/dylib"]
40+
ENTRYPOINT ["/bleep", "--host=0.0.0.0", "--source-dir=/repos", "--index-dir=/data", "--model-dir=/model"]

apps/desktop/build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh -e
2+
3+
git lfs install
4+
git lfs pull
5+
6+
PROJECT_ROOT=$(realpath $(dirname $(realpath $0))/../../)
7+
LOCAL_CONFIG=$PROJECT_ROOT/local_config.json
8+
9+
if [ -z "$ORT_LIB_LOCATION" ]; then
10+
export ORT_LIB_LOCATION=$(realpath $PROJECT_ROOT/lib/$(rustc -vV |awk '/host:/ { print $2 }')/onnxruntime)
11+
fi
12+
13+
echo $ORT_LIB_LOCATION
14+
15+
if [ $1 == "dev" ]; then
16+
npm run tauri dev -- -- -- --config-file=$LOCAL_CONFIG
17+
else
18+
npm run tauri $@
19+
fi
20+

apps/desktop/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"vite-build": "vite build",
99
"build": "npm-run-all tsc vite-build",
1010
"preview": "vite preview",
11-
"tauri": "tauri"
11+
"tauri": "tauri",
12+
"tauri-dev": "./build.sh dev",
13+
"tauri-build": "./build.sh build"
1214
}
1315
}

apps/desktop/src-tauri/bin/qdrant-x86_64-pc-windows-msvc.exe

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)