This commit is contained in:
Will Jones
2023-05-23 18:09:17 -07:00
parent 5e0ff01879
commit e762a4db4b
10 changed files with 60 additions and 16 deletions

View File

@@ -17,6 +17,29 @@ jobs:
prerelease: true # hardcoded on for now
generate_release_notes: true
rust:
runs-on: ubuntu-latest
needs: draft-release
defaults:
run:
shell: bash
working-directory: rust/vectordb
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
- name: Package Rust
run: cargo package --all-features
- uses: softprops/action-gh-release@v1
with:
files: |
rust/target/vectordb-*.crate
python:
runs-on: ubuntu-latest
needs: draft-release
@@ -126,6 +149,11 @@ jobs:
for filename in node/dist/*.tgz; do
npm publish --dry-run $filename
done
- uses: softprops/action-gh-release@v1
with:
draft: false
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --dry-run --no-verify rust/target/vectordb-*.crate
# - uses: softprops/action-gh-release@v1
# with:
# draft: false

4
Cargo.lock generated
View File

@@ -3356,7 +3356,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vectordb"
version = "0.0.1"
version = "0.1.2"
dependencies = [
"arrow-array",
"arrow-data",
@@ -3369,7 +3369,7 @@ dependencies = [
[[package]]
name = "vectordb-node"
version = "0.1.0"
version = "0.1.2"
dependencies = [
"arrow-array",
"arrow-ipc",

View File

@@ -3,4 +3,4 @@ members = [
"rust/vectordb",
"rust/ffi/node"
]
resolver = "2"
resolver = "2"

View File

@@ -1,3 +1,4 @@
# These make sure our builds are compatible with old glibc versions.
[target.x86_64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
@@ -10,5 +11,4 @@ pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:centos"
# docker pull ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge-centos@sha256:8ca737af41df2a8078eb03a0a19e38405854ad05891a7381f7f671727a9ff736
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos"

View File

@@ -35,6 +35,11 @@ npm run pack-build
npm install --no-save ./dist/vectordb-*.tgz
```
`npm run build` builds the Rust library, `npm run pack-build` packages the Rust
binary into an npm module called `@vectordb/<platform>` (for example,
`@vectordb/darwin-arm64.node`), and then `npm run install ...` installs that
module.
The LanceDB javascript is built with npm:
```bash

View File

@@ -18,8 +18,13 @@ let nativeLib;
try {
nativeLib = require(`@vectordb/${currentTarget()}`);
} catch {
throw new Error('vectordb: failed to load native library. Please file a bug report at https://github.com/lancedb/lancedb/issues');
} catch (e) {
throw new Error(`vectordb: failed to load native library.
You may need to run \`npm install @vectordb/${currentTarget()}\`.
If that does not work, please file a bug report at https://github.com/lancedb/lancedb/issues
Source error: ${e}`);
}
// Dynamic require for runtime.

View File

@@ -63,13 +63,17 @@
"x86_64-apple-darwin": "@vectordb/darwin-x64",
"aarch64-apple-darwin": "@vectordb/darwin-arm64",
"x86_64-unknown-linux-gnu": "@vectordb/linux-x64-gnu",
"x86_64-unknown-linux-musl": "@vectordb/linux-x64-musl"
"x86_64-unknown-linux-musl": "@vectordb/linux-x64-musl",
"aarch64-unknown-linux-gnu": "@vectordb/linux-arm64-gnu",
"aarch64-unknown-linux-musl": "@vectordb/linux-arm64-musl"
}
},
"optionalDependencies": {
"@vectordb/darwin-arm64": "0.1.1",
"@vectordb/darwin-x64": "0.1.1",
"@vectordb/linux-x64-gnu": "0.1.1",
"@vectordb/linux-x64-musl": "0.1.1"
"@vectordb/darwin-arm64": "0.1.2",
"@vectordb/darwin-x64": "0.1.2",
"@vectordb/linux-x64-gnu": "0.1.2",
"@vectordb/linux-x64-musl": "0.1.2",
"@vectordb/linux-arm64-gnu": "0.1.2",
"@vectordb/linux-arm64-musl": "0.1.2"
}
}

View File

@@ -3,6 +3,8 @@ How to release the node module
### 1. Bump the versions
<!-- TODO: we also need to bump the optional dependencies for node! -->
```shell
pushd rust/vectordb
cargo bump minor

View File

@@ -1,6 +1,6 @@
[package]
name = "vectordb"
version = "0.0.1"
version = "0.1.2"
edition = "2021"
description = "Serverless, low-latency vector database for AI applications"
license = "Apache-2.0"