usearch 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ ARG docker_ip
7
7
  ARG user_pass
8
8
 
9
9
  RUN apt-get update && \
10
- apt-get install -y --no-install-recommends python3.11 python3-pip cmake g++-12 build-essential libjemalloc-dev golang openssh-client sshpass && \
10
+ apt-get install -y --no-install-recommends cmake g++-12 build-essential libjemalloc-dev golang openssh-client sshpass && \
11
11
  apt-get clean && \
12
12
  rm -rf /var/lib/apt/lists/*
13
13
 
@@ -23,12 +23,12 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
23
23
  export arch="arm"; \
24
24
  fi && \
25
25
  version=$(cat VERSION) && \
26
- mkdir -p usearch_"$arch"_"$version"/DEBIAN && \
27
- touch usearch_"$arch"_"$version"/DEBIAN/control && \
28
- mkdir -p usearch_"$arch"_"$version"/usr/local/lib && \
29
- mkdir usearch_"$arch"_"$version"/usr/local/include && \
30
- cp c/usearch.h usearch_"$arch"_"$version"/usr/local/include/ && \
31
- cp golang/libusearch.a usearch_"$arch"_"$version"/usr/local/lib/ && \
32
- echo "Package: usearch\nVersion: $version\nMaintainer: Ashot Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_"$arch"_"$version"/DEBIAN/control && \
33
- dpkg-deb --build usearch_"$arch"_"$version" && \
34
- sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no usearch_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/usearch/usearch/
26
+ mkdir -p usearch_linux_"$arch"_"$version"/DEBIAN && \
27
+ touch usearch_linux_"$arch"_"$version"/DEBIAN/control && \
28
+ mkdir -p usearch_linux_"$arch"_"$version"/usr/local/lib && \
29
+ mkdir usearch_linux_"$arch"_"$version"/usr/local/include && \
30
+ cp c/usearch.h usearch_linux_"$arch"_"$version"/usr/local/include/ && \
31
+ cp golang/libusearch.a usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
32
+ echo "Package: usearch\nVersion: $version\nMaintainer: Ashot Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_linux_"$arch"_"$version"/DEBIAN/control && \
33
+ dpkg-deb --build usearch_linux_"$arch"_"$version" && \
34
+ sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no usearch_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/usearch/usearch/
@@ -219,6 +219,33 @@ jobs:
219
219
  shell: bash
220
220
  working-directory: ${{ github.workspace }}/csharp/
221
221
 
222
+ test_golang:
223
+ name: Test Golang
224
+ runs-on: ubuntu-latest
225
+ steps:
226
+ - uses: actions/checkout@v3
227
+ with:
228
+ persist-credentials: false
229
+ ref: 'main-dev'
230
+ - run: git submodule update --init --recursive
231
+
232
+ - name: Prepare environment
233
+ run: |
234
+ sudo apt update &&
235
+ sudo apt install -y cmake g++-12 build-essential libjemalloc-dev
236
+
237
+ - name: Build library
238
+ run: |
239
+ cd golang && make -C ../c libusearch_c.so
240
+ sudo mv ../c/libusearch_c.so /usr/local/lib/libusearch.a
241
+ sudo mv ../c/usearch.h /usr/local/include/usearch.h
242
+
243
+ - name: Run test
244
+ run: |
245
+ cd golang
246
+ go test -v
247
+
248
+
222
249
  build_docker:
223
250
  name: Test Docker Image
224
251
  runs-on: ubuntu-latest
@@ -14,6 +14,7 @@ permissions:
14
14
  contents: write
15
15
  pages: write
16
16
  id-token: write
17
+ packages: write
17
18
 
18
19
  jobs:
19
20
 
@@ -52,54 +53,10 @@ jobs:
52
53
  force: True
53
54
 
54
55
 
55
- publish_hashes:
56
- name: Add hashes to release notes
56
+ create_linux_deb_package:
57
+ name: Create Debian Package for ${{ matrix.arch }}
57
58
  runs-on: ubuntu-latest
58
59
  needs: versioning
59
- steps:
60
- - name: Get last release ID
61
- id: last_release
62
- run: |
63
- response=$(curl -s -H "Authorization: Bearer ${{ secrets.SEMANTIC_RELEASE_TOKEN }}" \
64
- "https://api.github.com/repos/${{ github.repository }}/releases/latest")
65
- echo "last_release_id=$(echo "$response" | jq -r '.id')" >> $GITHUB_OUTPUT
66
-
67
- - uses: robinraju/release-downloader@v1.8
68
- name: Download release assets
69
- with:
70
- latest: true
71
- fileName: "*"
72
- out-file-path: "downloads"
73
- tarBall: true
74
- zipBall: true
75
-
76
- - name: Calculate source hashes
77
- id: hashes
78
- run: |
79
- source_zip_path=$(find $GITHUB_WORKSPACE/downloads -name "*.zip")
80
- zip_hash=$(sha256sum "$source_zip_path" | awk '{print $1}')
81
- source_tar_path=$(find $GITHUB_WORKSPACE/downloads -name "*.tar.gz" ! -name "docs.tar.gz")
82
- tar_hash=$(sha256sum "$source_tar_path" | awk '{print $1}')
83
- echo "zip_hash=$zip_hash" >> $GITHUB_OUTPUT
84
- echo "tar_hash=$tar_hash" >> $GITHUB_OUTPUT
85
-
86
- - name: Upload hashes to release
87
- uses: irongut/EditRelease@v1.2.0
88
- with:
89
- token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
90
- id: ${{ steps.last_release.outputs.last_release_id }}
91
- prerelease: false
92
- replacebody: false
93
- body: |
94
- ## Hashes
95
- * Source code (zip) : `${{ steps.hashes.outputs.zip_hash }}`
96
- * Source code (tar.gz) : `${{ steps.hashes.outputs.tar_hash }}`
97
-
98
-
99
- create_deb_packages_linux:
100
- name: Create deb package for Linux on ${{ matrix.arch }}
101
- needs: versioning
102
- runs-on: ubuntu-latest
103
60
  strategy:
104
61
  matrix:
105
62
  arch: ["linux/amd64", "linux/arm64"]
@@ -110,26 +67,26 @@ jobs:
110
67
  ref: 'main'
111
68
  - run: git submodule update --init --recursive
112
69
 
113
- - name: Set up QEMU
70
+ - name: Setup QEMU
114
71
  uses: docker/setup-qemu-action@v2
115
72
 
116
- - name: Set up Docker Buildx
73
+ - name: Setup Docker
117
74
  uses: docker/setup-buildx-action@v2
118
75
 
119
- - name: Get docker daemon IP
76
+ - name: Get Docker daemon IP
120
77
  id: dockerip
121
78
  run: |
122
79
  docker_ip=$(ip addr show docker0 | grep -Po 'inet \K[\d.]+') && \
123
80
  echo "docker_ip=$docker_ip" >> "$GITHUB_OUTPUT"
124
-
125
- - name: Set new password for runner user
81
+
82
+ - name: Set runner user password
126
83
  id: userpass
127
84
  run: |
128
85
  user_pass="1122"
129
86
  echo "runner:$user_pass" | sudo chpasswd
130
87
  echo "user_pass=$user_pass" >> "$GITHUB_OUTPUT"
131
88
 
132
- - name: Build Usearch lib
89
+ - name: Build library
133
90
  run: |
134
91
  docker buildx create --use
135
92
  docker buildx build \
@@ -139,11 +96,10 @@ jobs:
139
96
  --file .github/workflows/Dockerfile.libs \
140
97
  --tag unum/ustore-deps:latest \
141
98
  --load .
142
-
143
99
  - name: Clear Docker buildx cache
144
100
  run: docker buildx prune --all --force
145
101
 
146
- - name: Upload archive to release Assets
102
+ - name: Upload archive
147
103
  uses: xresloader/upload-to-github-release@v1
148
104
  env:
149
105
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -152,6 +108,157 @@ jobs:
152
108
  update_latest_release: true
153
109
 
154
110
 
111
+ create_windows_dll_library:
112
+ name: Create Dll Library for Windows ${{ matrix.arch }}
113
+ runs-on: windows-latest
114
+ needs: versioning
115
+ strategy:
116
+ matrix:
117
+ arch: [x64, x86]
118
+ steps:
119
+ - uses: actions/checkout@v3
120
+ with:
121
+ persist-credentials: false
122
+ ref: 'main'
123
+ - run: git submodule update --init --recursive
124
+
125
+ - name: Setup Cmake
126
+ uses: jwlawson/actions-setup-cmake@v1.13
127
+
128
+ - uses: actions/setup-go@v4
129
+ with:
130
+ go-version: '^1.19.0'
131
+
132
+ - name: Setup Mingw
133
+ uses: egor-tensin/setup-mingw@v2
134
+ with:
135
+ platform: ${{ matrix.arch }}
136
+
137
+ - name: Get version
138
+ id: set_version
139
+ shell: bash
140
+ run: |
141
+ version=$(cat VERSION)
142
+ echo "version=$version" >> $GITHUB_OUTPUT
143
+
144
+ - name: Build library
145
+ run: |
146
+ cd c/ && g++ -std=c++11 -o libusearch.dll -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared && cd ..
147
+ cp c/libusearch.dll golang/libusearch.dll && cp c/usearch.h golang/usearch.h
148
+
149
+ - name: Golang test
150
+ run: |
151
+ cd golang/ && go test -v
152
+ if: ${{ matrix.arch == 'x64' }}
153
+
154
+ - name: Compress library
155
+ run: |
156
+ cd golang/
157
+ tar -cvf usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar .\libusearch.dll .\usearch.h
158
+
159
+ - name: Upload archive
160
+ uses: xresloader/upload-to-github-release@v1
161
+ env:
162
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163
+ with:
164
+ file: "golang/usearch_windows_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.tar"
165
+ update_latest_release: true
166
+
167
+
168
+ create_macos_library:
169
+ name: Create Library for MacOS ${{ matrix.arch }}
170
+ runs-on: macOS-latest
171
+ needs: versioning
172
+ strategy:
173
+ matrix:
174
+ arch: [arm64, x86_64]
175
+ steps:
176
+ - uses: actions/checkout@v3
177
+ with:
178
+ persist-credentials: false
179
+ ref: 'main'
180
+ - run: git submodule update --init --recursive
181
+
182
+ - uses: actions/setup-go@v4
183
+ with:
184
+ go-version: '^1.21.0'
185
+
186
+ - name: Get version
187
+ id: version
188
+ run: |
189
+ version=$(cat VERSION)
190
+ echo "version=$version" >> $GITHUB_OUTPUT
191
+
192
+ - name: Build library
193
+ run: |
194
+ cd c/ && clang++ -std=c++11 -o libusearch.so -O3 lib.cpp -I. -I ../include/ -I ../fp16/include/ -shared -target ${{ matrix.arch }}-apple-macos11 && cd ..
195
+ cp c/usearch.h golang/
196
+ cp c/libusearch.so golang/libusearch.so
197
+
198
+ - name: Golang test
199
+ run: |
200
+ cd golang/
201
+ go test -v
202
+ if: ${{ matrix.arch == 'x86_64' }}
203
+
204
+ - name: Compress library
205
+ run: |
206
+ cd golang/
207
+ zip -r usearch_macOS_${{ matrix.arch }}_${{ steps.version.outputs.version }}.zip libusearch.so usearch.h
208
+
209
+ - name: Upload archive
210
+ uses: xresloader/upload-to-github-release@v1
211
+ env:
212
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213
+ with:
214
+ file: "golang/*.zip"
215
+ update_latest_release: true
216
+
217
+
218
+ publish_hashes:
219
+ name: Add hashes to release notes
220
+ runs-on: ubuntu-latest
221
+ needs: [versioning, create_linux_deb_package, create_windows_dll_library, create_macos_library]
222
+ steps:
223
+ - name: Get last release ID
224
+ id: last_release
225
+ run: |
226
+ response=$(curl -s -H "Authorization: Bearer ${{ secrets.SEMANTIC_RELEASE_TOKEN }}" \
227
+ "https://api.github.com/repos/${{ github.repository }}/releases/latest")
228
+ echo "last_release_id=$(echo "$response" | jq -r '.id')" >> $GITHUB_OUTPUT
229
+
230
+ - uses: robinraju/release-downloader@v1.8
231
+ name: Download release assets
232
+ with:
233
+ latest: true
234
+ fileName: "*"
235
+ out-file-path: "downloads"
236
+ tarBall: true
237
+ zipBall: true
238
+
239
+ - name: Calculate source hashes
240
+ id: hashes
241
+ run: |
242
+ source_zip_path=$(find $GITHUB_WORKSPACE/downloads -name "*.zip")
243
+ zip_hash=$(sha256sum "$source_zip_path" | awk '{print $1}')
244
+ source_tar_path=$(find $GITHUB_WORKSPACE/downloads -name "*.tar.gz" ! -name "docs.tar.gz")
245
+ tar_hash=$(sha256sum "$source_tar_path" | awk '{print $1}')
246
+ echo "zip_hash=$zip_hash" >> $GITHUB_OUTPUT
247
+ echo "tar_hash=$tar_hash" >> $GITHUB_OUTPUT
248
+
249
+ - name: Upload hashes to release
250
+ uses: irongut/EditRelease@v1.2.0
251
+ with:
252
+ token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
253
+ id: ${{ steps.last_release.outputs.last_release_id }}
254
+ prerelease: false
255
+ replacebody: false
256
+ body: |
257
+ ## Hashes
258
+ * Source code (zip) : `${{ steps.hashes.outputs.zip_hash }}`
259
+ * Source code (tar.gz) : `${{ steps.hashes.outputs.tar_hash }}`
260
+
261
+
155
262
  build_wheels:
156
263
  name: Build Wheels for ${{ matrix.os }}
157
264
  needs: versioning
@@ -375,11 +482,12 @@ jobs:
375
482
  runs-on: ubuntu-latest
376
483
  needs: [build_csharp]
377
484
  env:
485
+ SOLUTION: ${{ github.workspace }}/csharp
378
486
  USEARCH_LIBS: ${{ github.workspace }}/csharp/lib
379
- NUGET_DIR: ${{ github.workspace }}/csharp/packages
487
+ NUGET_PACKAGES: ${{ github.workspace }}/csharp/packages
380
488
  # NUGET_SOURCE: https://apiint.nugettest.org/v3/index.json
381
489
  NUGET_SOURCE: https://api.nuget.org/v3/index.json
382
- SOLUTION_DIR: ${{ github.workspace }}/csharp
490
+ GITHUB_PACKAGES_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
383
491
  steps:
384
492
  - uses: actions/checkout@v3
385
493
  - run: git submodule update --init --recursive
@@ -398,12 +506,17 @@ jobs:
398
506
  - name: Pack project
399
507
  run: |
400
508
  VERSION_CONTENT=$(< VERSION)
401
- dotnet pack "${{ env.SOLUTION_DIR }}" -c Release -p:Version="$VERSION_CONTENT" --output ${{ env.NUGET_DIR }}
509
+ dotnet pack "${{ env.SOLUTION }}" -c Release -p:Version="$VERSION_CONTENT" --output ${{ env.NUGET_PACKAGES }}
402
510
  working-directory: ${{ github.workspace }}
403
511
 
404
- - name: Publish NuGet packages
405
- run: |
406
- dotnet nuget push "${{ env.NUGET_DIR }}/*.nupkg" --api-key "${{ secrets.NUGET_API }}" --source "${{ env.NUGET_SOURCE }}"
512
+ - name: Publish to NuGet
513
+ run: dotnet nuget push "${{ env.NUGET_PACKAGES }}/*.nupkg" --api-key "${{ secrets.NUGET_API }}" --source "${{ env.NUGET_SOURCE }}" --skip-duplicate
514
+
515
+ - name: Prepare publish to GitHub Registry
516
+ run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "${{ env.GITHUB_PACKAGES_SOURCE }}"
517
+
518
+ - name: Publish to GitHub Registry
519
+ run: dotnet nuget push "${{ env.NUGET_PACKAGES }}/*.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source "github" --skip-duplicate
407
520
 
408
521
  build_docs:
409
522
  name: Build Docs
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "2.1.0"
3
+ version = "2.1.1"
4
4
  authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/conanfile.py CHANGED
@@ -4,7 +4,7 @@ from conans import ConanFile
4
4
  class USearchConan(ConanFile):
5
5
 
6
6
  name = 'USearch'
7
- version = '2.1.0'
7
+ version = '2.1.1'
8
8
  license = 'Apache 2.0'
9
9
  url = 'https://github.com/unum-cloud/usearch'
10
10
  description = 'Smaller & Faster Single-File Vector Search Engine from Unum'
@@ -15,14 +15,14 @@
15
15
 
16
16
  <PackageIcon>unum.png</PackageIcon>
17
17
  <PackageIconUrl>unum.png</PackageIconUrl>
18
- <PackageReadmeFile>NUGET.md</PackageReadmeFile>
18
+ <PackageReadmeFile>README.md</PackageReadmeFile>
19
19
  </PropertyGroup>
20
20
 
21
21
  <ItemGroup>
22
22
  <None Include="$(NativeLibDir)runtimes\**\*.*" Pack="true" PackagePath="runtimes" />
23
23
  <None Include="$(RepoRoot)LICENSE" Pack="true" PackagePath=""/>
24
24
  <None Include="$(RepoRoot)assets\unum.png" Pack="true" PackagePath=""/>
25
- <None Include="$(CSharpDir)nuget\NUGET.md" Pack="true" PackagePath=""/>
25
+ <None Include="$(RepoRoot)README.md" Pack="true" PackagePath=""/>
26
26
  </ItemGroup>
27
27
 
28
28
  <!-- Package validation https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview?WT.mc_id=DT-MVP-5003978 -->
package/golang/README.md CHANGED
@@ -2,14 +2,36 @@
2
2
 
3
3
  ## Installation
4
4
 
5
+ ### Linux
6
+
5
7
  Download and install from the Debian package from the latest release.
6
8
  Substitute `<release_tag>`, `<arch>`, and `<usearch_version>` with your settings.
7
9
 
8
10
  ```
9
- wget https://github.com/unum-cloud/usearch/releases/download/<release_tag>/usearch_<arch>_<usearch_version>.deb
11
+ wget https://github.com/unum-cloud/usearch/releases/download/<release_tag>/usearch_linux_<arch>_<usearch_version>.deb
10
12
  dpkg -i usearch_<arch>_<usearch_version>.deb
11
13
  ```
12
14
 
15
+ ### Windows
16
+
17
+ Run a `winlibinstaller.bat` script from the main repository in the folder where you will run `go run`.
18
+ That will install the USearch library and include in the same folder` where the script was run.
19
+
20
+ ```
21
+ .\usearch\winlibinstaller.bat
22
+ ```
23
+
24
+ ### MacOS
25
+
26
+ Download and unpack a zip archive from the latest release.
27
+ Move the USearch library and the include file to their respective folders.
28
+ ```
29
+ wget https://github.com/unum-cloud/usearch/releases/download/<release_tag>/usearch_macOS_<arch>_<usearch_version>.zip
30
+ unzip usearch_macOS_<arch>_<usearch_version>.zip
31
+ sudo mv libusearch.so /usr/local/lib && sudo mv usearch.h /usr/local/include
32
+
33
+ ```
34
+
13
35
  ## Quickstart
14
36
 
15
37
  1. Create a `go.mod` file:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usearch",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ash Vardanian",
6
6
  "license": "Apache 2.0",
package/wasmer.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name="unum/usearch"
3
- version="2.1.0"
3
+ version="2.1.1"
4
4
  description="Smaller & Faster Single-File Vector Search Engine from Unum"
5
5
  license="Apache-2.0"
6
6
  readme="README.md"
@@ -0,0 +1,42 @@
1
+ @echo off
2
+
3
+ rem Get latest release tag
4
+ set "repo_owner=unum-cloud"
5
+ set "repo_name=usearch"
6
+
7
+ rem Get the latest tag without quotes
8
+ for /f "delims=" %%i in ('curl -s https://api.github.com/repos/%repo_owner%/%repo_name%/releases/latest ^| findstr "tag_name"') do (
9
+ for /f "tokens=2 delims=:, " %%a in ("%%i") do (
10
+ set "latest_tag=%%~a"
11
+ )
12
+ )
13
+
14
+ rem Get Windows architecture
15
+ for /f "tokens=2 delims= " %%a in ('wmic OS get OSArchitecture ^| find "64"') do set "arch=x64"
16
+ if "%arch%"=="" set "arch=x86"
17
+
18
+ echo Split library version from release version!
19
+ timeout /t 1
20
+ rem Split the first 'v' from the version number.
21
+ for /f "tokens=1 delims=v" %%a in ('echo %latest_tag%') do (
22
+ set lib_version=%%a
23
+ )
24
+
25
+ echo Download usearch library archive!
26
+ rem Download the file.
27
+ timeout /t 2
28
+ curl -LO https://github.com/%repo_owner%/%repo_name%/releases/download/%latest_tag%/usearch_windows_%arch%_%lib_version%.tar
29
+ echo Download is complete!
30
+
31
+ echo Extract archive!
32
+ rem Extract archive.
33
+ timeout /t 1
34
+ tar -xf usearch_windows_%arch%_%lib_version%.tar
35
+ echo Extract is complete!
36
+
37
+ rem Remove the archive.
38
+ del usearch_windows_%arch%_%lib_version%.tar
39
+
40
+ echo Extraction complete and downloaded .tar file removed.
41
+ timeout /t 1
42
+ exit /b
@@ -1,11 +0,0 @@
1
- **Cloud.Unum.USearch** is a wrapper for the USearch vector search engine, offering fast searches, multiple metrics, and features like SIMD-optimized metrics.
2
-
3
- **Supported metrics**: Euclidean, Angular, Jaccard, Hamming, Haversine, User-Defined Metrics
4
-
5
- **Platforms**: Linux, MacOS, Windows
6
-
7
- # Getting Started ⚡
8
-
9
- - [Quickstart](https://github.com/unum-cloud/usearch/blob/main/csharp/README.md)
10
- - Join the [Discord community](https://discord.gg/A6wxt6dS9j)
11
- - Check out the [GitHub repository](https://github.com/unum-cloud/usearch)