diff --git a/.github/workflows/make_release_commit.yml b/.github/workflows/make_release_commit.yml new file mode 100644 index 00000000..422928cc --- /dev/null +++ b/.github/workflows/make_release_commit.yml @@ -0,0 +1,48 @@ +name: Create release commit + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Just create the local commit/tags but do not push it' + required: true + default: "false" + type: choice + options: + - "true" + - "false" + part: + description: 'What kind of release is this?' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + - name: Check out main + uses: actions/checkout@v3 + with: + ref: main + persist-credentials: false + fetch-depth: 0 + lfs: true + - name: Install cargo utils + run: cargo install cargo-edit + - name: Bump versions + run: | + NEW_VERSION=$(bash ci/bump_versions.sh ${{ inputs.part }}) + echo "New version: v$NEW_VERSION" + git tag v$NEW_VERSION + - name: Push new version and tag + if: ${{ inputs.dry_run }} == "false" + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.RELEASE_TOKEN }} + branch: main + tags: true \ No newline at end of file diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index b1a85421..47f9fb32 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -67,8 +67,12 @@ jobs: - name: Build run: | npm ci - npm run build npm run tsc + npm run build + npm run pack-build + npm install --no-save ./dist/lancedb-vectordb-*.tgz + # Remove index.node to test with dependency installed + rm index.node - name: Test run: npm run test macos: @@ -94,8 +98,12 @@ jobs: - name: Build run: | npm ci - npm run build npm run tsc + npm run build + npm run pack-build + npm install --no-save ./dist/lancedb-vectordb-*.tgz + # Remove index.node to test with dependency installed + rm index.node - name: Test run: | npm run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f350b48c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,167 @@ +name: Prepare Release + +# NOTE: Python is a separate release for now. + +# Currently disabled until it can be completed. +# on: +# push: +# tags: +# - v* + +jobs: + draft-release: + runs-on: ubuntu-latest + steps: + - uses: softprops/action-gh-release@v1 + with: + draft: true + 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: + draft: true + files: target/package/vectordb-*.crate + fail_on_unmatched_files: true + + node: + runs-on: ubuntu-latest + needs: draft-release + defaults: + run: + shell: bash + working-directory: node + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: node/package-lock.json + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y protobuf-compiler libssl-dev + - name: Build + run: | + npm ci + npm run tsc + npm pack + - uses: softprops/action-gh-release@v1 + with: + draft: true + files: node/vectordb-*.tgz + fail_on_unmatched_files: true + + node-macos: + runs-on: macos-12 + needs: draft-release + strategy: + fail-fast: false + matrix: + target: [x86_64-apple-darwin, aarch64-apple-darwin] + steps: + - name: Checkout + uses: actions/checkout@v33 + - name: Install system dependencies + run: brew install protobuf + - name: Install npm dependencies + run: | + cd node + npm ci + - name: Install rustup target + if: ${{ matrix.target == 'aarch64-apple-darwin' }} + run: rustup target add aarch64-apple-darwin + - name: Build MacOS native node modules + run: bash ci/build_macos_artifacts.sh ${{ matrix.target }} + - uses: softprops/action-gh-release@v1 + with: + draft: true + files: node/dist/lancedb-vectordb-darwin*.tgz + fail_on_unmatched_files: true + + node-linux: + name: node-linux (${{ matrix.arch}}-unknown-linux-${{ matrix.libc }}) + runs-on: ubuntu-latest + needs: draft-release + strategy: + fail-fast: false + matrix: + libc: + - gnu + # TODO: re-enable musl once we have refactored to pre-built containers + # Right now we have to build node from source which is too expensive. + # - musl + arch: + - x86_64 + # Building on aarch64 is too slow for now + # - aarch64 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Change owner to root (for npm) + # The docker container is run as root, so we need the files to be owned by root + # Otherwise npm is a nightmare: https://github.com/npm/cli/issues/3773 + run: sudo chown -R root:root . + - name: Set up QEMU + if: ${{ matrix.arch == 'aarch64' }} + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + - name: Build Linux GNU native node modules + if: ${{ matrix.libc == 'gnu' }} + run: | + docker run \ + -v $(pwd):/io -w /io \ + quay.io/pypa/manylinux2014_${{ matrix.arch }} \ + bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-gnu + - name: Build musl Linux native node modules + if: ${{ matrix.libc == 'musl' }} + run: | + docker run --platform linux/arm64/v8 \ + -v $(pwd):/io -w /io \ + quay.io/pypa/musllinux_1_1_${{ matrix.arch }} \ + bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-musl + - uses: softprops/action-gh-release@v1 + with: + draft: true + files: node/dist/lancedb-vectordb-linux*.tgz + fail_on_unmatched_files: true + + release: + needs: [rust, node, node-macos, node-linux] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + - name: Publish to NPM + run: | + for filename in node/dist/*.tgz; do + npm publish --dry-run $filename + done + - 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 diff --git a/.gitignore b/.gitignore index 6f8e1514..56d590ef 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ **/__pycache__ .DS_Store +.vscode + rust/target rust/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index d4b6a611..acf44c19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3358,7 +3358,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vectordb" -version = "0.0.1" +version = "0.1.2" dependencies = [ "arrow-array", "arrow-data", @@ -3373,7 +3373,7 @@ dependencies = [ [[package]] name = "vectordb-node" -version = "0.1.0" +version = "0.1.2" dependencies = [ "arrow-array", "arrow-ipc", diff --git a/ci/build_linux_artifacts.sh b/ci/build_linux_artifacts.sh new file mode 100644 index 00000000..8ed95a2e --- /dev/null +++ b/ci/build_linux_artifacts.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# Builds the Linux artifacts (node binaries). +# Usage: ./build_linux_artifacts.sh [target] +# Targets supported: +# - x86_64-unknown-linux-gnu:centos +# - aarch64-unknown-linux-gnu:centos +# - aarch64-unknown-linux-musl +# - x86_64-unknown-linux-musl + +# TODO: refactor this into a Docker container we can pull + +set -e + +setup_dependencies() { + echo "Installing system dependencies..." + if [[ $1 == *musl ]]; then + # musllinux + apk add openssl-dev + else + # manylinux2014 + yum install -y openssl-devel unzip + fi + + if [[ $1 == x86_64* ]]; then + ARCH=x86_64 + else + # gnu target + ARCH=aarch_64 + fi + + # Install new enough protobuf (yum-provided is old) + PB_REL=https://github.com/protocolbuffers/protobuf/releases + PB_VERSION=23.1 + curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-$ARCH.zip + unzip protoc-$PB_VERSION-linux-$ARCH.zip -d /usr/local +} + +install_node() { + echo "Installing node..." + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash + source "$HOME"/.bashrc + + if [[ $1 == *musl ]]; then + # This node version is 15, we need 16 or higher: + # apk add nodejs-current npm + # So instead we install from source (nvm doesn't provide binaries for musl): + nvm install -s --no-progress 17 + else + nvm install --no-progress 17 # latest that supports glibc 2.17 + fi +} + +install_rust() { + echo "Installing rust..." + curl https://sh.rustup.rs -sSf | bash -s -- -y + export PATH="$PATH:/root/.cargo/bin" +} + +build_node_binary() { + echo "Building node library for $1..." + pushd node + + npm ci + + if [[ $1 == *musl ]]; then + # This is needed for cargo to allow build cdylibs with musl + export RUSTFLAGS="-C target-feature=-crt-static" + fi + + # Cargo can run out of memory while pulling dependencies, espcially when running + # in QEMU. This is a workaround for that. + export CARGO_NET_GIT_FETCH_WITH_CLI=true + + # We don't pass in target, since the native target here already matches + # and openblas-src doesn't do well with cross-compilation. + npm run build-release + npm run pack-build + + popd +} + +TARGET=${1:-x86_64-unknown-linux-gnu} +# Others: +# aarch64-unknown-linux-gnu +# x86_64-unknown-linux-musl +# aarch64-unknown-linux-musl + +setup_dependencies $TARGET +install_node $TARGET +install_rust +build_node_binary $TARGET diff --git a/ci/build_macos_artifacts.sh b/ci/build_macos_artifacts.sh new file mode 100644 index 00000000..15005767 --- /dev/null +++ b/ci/build_macos_artifacts.sh @@ -0,0 +1,33 @@ +# Builds the macOS artifacts (node binaries). +# Usage: ./ci/build_macos_artifacts.sh [target] +# Targets supported: x86_64-apple-darwin aarch64-apple-darwin + +prebuild_rust() { + # Building here for the sake of easier debugging. + pushd rust/ffi/node + echo "Building rust library for $1" + export RUST_BACKTRACE=1 + cargo build --release --target $1 + popd +} + +build_node_binaries() { + pushd node + echo "Building node library for $1" + npm run build-release -- --target $1 + npm run pack-build -- --target $1 + popd +} + +if [ -n "$1" ]; then + targets=$1 +else + targets="x86_64-apple-darwin aarch64-apple-darwin" +fi + +echo "Building artifacts for targets: $targets" +for target in $targets + do + prebuild_rust $target + build_node_binaries $target +done \ No newline at end of file diff --git a/ci/bump_versions.sh b/ci/bump_versions.sh new file mode 100644 index 00000000..b39022bf --- /dev/null +++ b/ci/bump_versions.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -e + +# if cargo bump isn't installed return an error +if ! cargo set-version &> /dev/null +then + echo "cargo-edit could not be found. Install with `cargo install cargo-edit`" + exit +fi + +BUMP_PART=${1:-patch} + +# if BUMP_PART isn't patch, minor, or major return an error +if [ "$BUMP_PART" != "patch" ] && [ "$BUMP_PART" != "minor" ] && [ "$BUMP_PART" != "major" ] +then + echo "BUMP_PART must be one of patch, minor, or major" + exit +fi + +function get_crate_version() { + cargo pkgid -p $1 | cut -d@ -f2 | cut -d# -f2 +} + +# First, validate versions are starting as same +VECTORDB_VERSION=$(get_crate_version vectordb) +FFI_NODE_VERSION=$(get_crate_version vectordb-node) + +# FYI, we pipe all output to /dev/null because the only thing we want to ouput +# if success is the new tag. This way it can be then used with `git tag`. +pushd node > /dev/null +NODE_VERSION=$(npm pkg get version | xargs echo) +popd > /dev/null + +if [ "$VECTORDB_VERSION" != "$FFI_NODE_VERSION" ] || [ "$VECTORDB_VERSION" != "$NODE_VERSION" ] +then + echo "Version mismatch between rust/vectordb, rust/ffi/node, and node" + echo "rust/vectordb: $VECTORDB_VERSION" + echo "rust/ffi/node: $FFI_NODE_VERSION" + echo "node: $NODE_VERSION" + exit +fi + +cargo set-version --bump $BUMP_PART > /dev/null 2>&1 +NEW_VERSION=$(get_crate_version vectordb) + +pushd node > /dev/null +npm version $BUMP_PART > /dev/null + +# Also need to update version of the native modules +NATIVE_MODULES=$(npm pkg get optionalDependencies | jq 'keys[]' | grep @vectordb/ | tr -d '"') +for module in $NATIVE_MODULES +do + npm install $module@$NEW_VERSION --save-optional > /dev/null +done +popd > /dev/null + + +echo $NEW_VERSION diff --git a/ci/release_process.md b/ci/release_process.md new file mode 100644 index 00000000..ea26a6a8 --- /dev/null +++ b/ci/release_process.md @@ -0,0 +1,136 @@ +# How to release + +This is for the Rust crate and Node module. For now, the Python module is +released separately. + + + +## Manual process + +The manual release process can be completed on a MacOS machine. + +### Bump the versions + +You can use the script `ci/bump_versions.sh` to bump the versions. It defaults +to a `patch` bump, but you can also pass `minor` and `major`. Once you have the +tag created, push it to GitHub. + +```shell +VERSION=$(bash ci/bump_versions.sh) +git tag v$VERSION +git push origin v$VERSION +``` + +### Build the MacOS release libraries + +One-time setup: + +```shell +rustup target add x86_64-apple-darwin aarch64-apple-darwin +``` + +To build both x64 and arm64, run `ci/build_macos_artifacts.sh` without any args: + +```shell +bash ci/build_macos_artifacts.sh +``` + +### Build the Linux release libraries + +To build a Linux library, we need to use docker with a different build script: + +```shell +ARCH=aarch64 +docker run \ + -v $(pwd):/io -w /io \ + quay.io/pypa/manylinux2014_$ARCH \ + bash ci/build_linux_artifacts.sh $ARCH-unknown-linux-gnu +``` + +For x64, change `ARCH` to `x86_64`. NOTE: compiling for a different architecture +than your machine in Docker is very slow. It's best to do this on a machine with +matching architecture. + + + + + + + +### Build the npm module + +To build the typescript and create a release tarball, run: + +```shell +npm ci +npm tsc +npm pack +``` + +### Release to npm + +Assuming you still have `VERSION` set from earlier: + +```shell +pushd node +npm publish lancedb-vectordb-$VERSION.tgz +for tarball in ./dist/lancedb-vectordb-*-$VERSION.tgz; + do + npm publish $tarball +done +popd +``` + +### Release to crates.io + +```shell +cargo publish -p vectordb +cargo publish -p vectordb-node +``` diff --git a/node/.npmignore b/node/.npmignore new file mode 100644 index 00000000..3da85495 --- /dev/null +++ b/node/.npmignore @@ -0,0 +1,4 @@ +gen_test_data.py +index.node +dist/lancedb*.tgz +vectordb*.tgz \ No newline at end of file diff --git a/node/README.md b/node/README.md index 5e0a4838..376ac382 100644 --- a/node/README.md +++ b/node/README.md @@ -8,6 +8,10 @@ A JavaScript / Node.js library for [LanceDB](https://github.com/lancedb/lancedb) npm install vectordb ``` +This will download the appropriate native library for your platform. We currently +support x86_64 Linux, aarch64 Linux, Intel MacOS, and ARM (M1/M2) MacOS. We do not +yet support Windows or musl-based Linux (such as Alpine Linux). + ## Usage ### Basic Example @@ -24,17 +28,33 @@ The [examples](./examples) folder contains complete examples. ## Development -The LanceDB javascript is built with npm: +To build everything fresh: + +```bash +npm install +npm run tsc +npm run build +``` + +Then you should be able to run the tests with: + +```bash +npm test +``` + +### Rebuilding Rust library + +```bash +npm run build +``` + +### Rebuilding Typescript ```bash npm run tsc ``` -Run the tests with - -```bash -npm test -``` +### Fix lints To run the linter and have it automatically fix all errors diff --git a/node/native.js b/node/native.js index 0d4172a0..f7e4b250 100644 --- a/node/native.js +++ b/node/native.js @@ -12,29 +12,26 @@ // See the License for the specific language governing permissions and // limitations under the License. +const { currentTarget } = require('@neon-rs/load'); + let nativeLib; -function getPlatformLibrary() { - if (process.platform === "darwin" && process.arch == "arm64") { - return require('./aarch64-apple-darwin.node'); - } else if (process.platform === "darwin" && process.arch == "x64") { - return require('./x86_64-apple-darwin.node'); - } else if (process.platform === "linux" && process.arch == "x64") { - return require('./x86_64-unknown-linux-gnu.node'); - } else { - throw new Error(`vectordb: unsupported platform ${process.platform}_${process.arch}. Please file a bug report at https://github.com/lancedb/lancedb/issues`) - } -} - try { - nativeLib = require('./index.node') + nativeLib = require(`@lancedb/vectordb-${currentTarget()}`); } catch (e) { - if (e.code === "MODULE_NOT_FOUND") { - nativeLib = getPlatformLibrary(); - } else { - throw new Error('vectordb: failed to load native library. Please file a bug report at https://github.com/lancedb/lancedb/issues'); - } + try { + // Might be developing locally, so try that. But don't expose that error + // to the user. + nativeLib = require("./index.node"); + } catch { + throw new Error(`vectordb: failed to load native library. + You may need to run \`npm install @lancedb/vectordb-${currentTarget()}\`. + + If that does not work, please file a bug report at https://github.com/lancedb/lancedb/issues + + Source error: ${e}`); + } } -module.exports = nativeLib - +// Dynamic require for runtime. +module.exports = nativeLib; diff --git a/node/package-lock.json b/node/package-lock.json index de82fc04..17d9d19c 100644 --- a/node/package-lock.json +++ b/node/package-lock.json @@ -1,18 +1,28 @@ { "name": "vectordb", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vectordb", - "version": "0.1.1", + "version": "0.1.2", + "cpu": [ + "x64", + "arm64" + ], "license": "Apache-2.0", + "os": [ + "darwin", + "linux" + ], "dependencies": { "@apache-arrow/ts": "^12.0.0", + "@neon-rs/load": "^0.0.74", "apache-arrow": "^12.0.0" }, "devDependencies": { + "@neon-rs/cli": "^0.0.74", "@types/chai": "^4.3.4", "@types/mocha": "^10.0.1", "@types/node": "^18.16.2", @@ -30,6 +40,12 @@ "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", "typescript": "*" + }, + "optionalDependencies": { + "@lancedb/vectordb-darwin-arm64": "0.1.2", + "@lancedb/vectordb-darwin-x64": "0.1.2", + "@lancedb/vectordb-linux-arm64-gnu": "0.1.2", + "@lancedb/vectordb-linux-x64-gnu": "0.1.2" } }, "node_modules/@apache-arrow/ts": { @@ -197,6 +213,46 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@lancedb/vectordb-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://npm.pkg.github.com/download/@lancedb/vectordb-darwin-arm64/0.1.2/84d71331e03e8aaeb9fb12cdacc759dc82cfd3b0", + "integrity": "sha512-DU6tHmmn/coSj5r5FGwTMXMQfsSSxQN1ozOl9mFUXr0aVtlx5nlA8ZY5BAF/V371yL5QzNPKtaNpogP6iw51NA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@lancedb/vectordb-linux-arm64-gnu": { + "version": "0.1.2", + "resolved": "https://npm.pkg.github.com/download/@lancedb/vectordb-linux-arm64-gnu/0.1.2/d5a9d66c3969494cf3546195fb5511f9f49aa295", + "integrity": "sha512-LZZ4KgoGqD5AzKX/utBrsxrwXq6whpUNa02tWxl/ND/601ruNi9ZUaXCTb1rSVUWJkgMR2wASk15kssyaPRSjw==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@neon-rs/cli": { + "version": "0.0.74", + "resolved": "https://registry.npmjs.org/@neon-rs/cli/-/cli-0.0.74.tgz", + "integrity": "sha512-9lPmNmjej5iKKOTMPryOMubwkgMRyTWRuaq1yokASvI5mPhr2kzPN7UVjdCOjQvpunNPngR9yAHoirpjiWhUHw==", + "dev": true, + "bin": { + "neon": "index.js" + } + }, + "node_modules/@neon-rs/load": { + "version": "0.0.74", + "resolved": "https://registry.npmjs.org/@neon-rs/load/-/load-0.0.74.tgz", + "integrity": "sha512-/cPZD907UNz55yrc/ud4wDgQKtU1TvkD9jeqZWG6J4IMmZkp6zgjkQcKA8UvpkZlcpPHvc8J17sGzLFbP/LUYg==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -4191,6 +4247,29 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@lancedb/vectordb-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://npm.pkg.github.com/download/@lancedb/vectordb-darwin-arm64/0.1.2/84d71331e03e8aaeb9fb12cdacc759dc82cfd3b0", + "integrity": "sha512-DU6tHmmn/coSj5r5FGwTMXMQfsSSxQN1ozOl9mFUXr0aVtlx5nlA8ZY5BAF/V371yL5QzNPKtaNpogP6iw51NA==", + "optional": true + }, + "@lancedb/vectordb-linux-arm64-gnu": { + "version": "0.1.2", + "resolved": "https://npm.pkg.github.com/download/@lancedb/vectordb-linux-arm64-gnu/0.1.2/d5a9d66c3969494cf3546195fb5511f9f49aa295", + "integrity": "sha512-LZZ4KgoGqD5AzKX/utBrsxrwXq6whpUNa02tWxl/ND/601ruNi9ZUaXCTb1rSVUWJkgMR2wASk15kssyaPRSjw==", + "optional": true + }, + "@neon-rs/cli": { + "version": "0.0.74", + "resolved": "https://registry.npmjs.org/@neon-rs/cli/-/cli-0.0.74.tgz", + "integrity": "sha512-9lPmNmjej5iKKOTMPryOMubwkgMRyTWRuaq1yokASvI5mPhr2kzPN7UVjdCOjQvpunNPngR9yAHoirpjiWhUHw==", + "dev": true + }, + "@neon-rs/load": { + "version": "0.0.74", + "resolved": "https://registry.npmjs.org/@neon-rs/load/-/load-0.0.74.tgz", + "integrity": "sha512-/cPZD907UNz55yrc/ud4wDgQKtU1TvkD9jeqZWG6J4IMmZkp6zgjkQcKA8UvpkZlcpPHvc8J17sGzLFbP/LUYg==" + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/node/package.json b/node/package.json index 2b41f498..0872108a 100644 --- a/node/package.json +++ b/node/package.json @@ -1,15 +1,18 @@ { "name": "vectordb", - "version": "0.1.1", + "version": "0.1.2", "description": " Serverless, low-latency vector database for AI applications", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { "tsc": "tsc -b", - "build": "cargo-cp-artifact --artifact cdylib vectordb-node index.node -- cargo build --message-format=json-render-diagnostics", + "build": "cargo-cp-artifact --artifact cdylib vectordb-node index.node -- cargo build --message-format=json", "build-release": "npm run build -- --release", + "cross-release": "cargo-cp-artifact --artifact cdylib vectordb-node index.node -- cross build --message-format=json --release -p vectordb-node", "test": "mocha -recursive dist/test", - "lint": "eslint src --ext .js,.ts" + "lint": "eslint src --ext .js,.ts", + "pack-build": "neon pack-build", + "check-npm": "printenv && which node && which npm && npm --version" }, "repository": { "type": "git", @@ -24,6 +27,7 @@ "author": "Lance Devs", "license": "Apache-2.0", "devDependencies": { + "@neon-rs/cli": "^0.0.74", "@types/chai": "^4.3.4", "@types/mocha": "^10.0.1", "@types/node": "^18.16.2", @@ -44,6 +48,29 @@ }, "dependencies": { "@apache-arrow/ts": "^12.0.0", + "@neon-rs/load": "^0.0.74", "apache-arrow": "^12.0.0" + }, + "os": [ + "darwin", + "linux" + ], + "cpu": [ + "x64", + "arm64" + ], + "neon": { + "targets": { + "x86_64-apple-darwin": "@lancedb/vectordb-darwin-x64", + "aarch64-apple-darwin": "@lancedb/vectordb-darwin-arm64", + "x86_64-unknown-linux-gnu": "@lancedb/vectordb-linux-x64-gnu", + "aarch64-unknown-linux-gnu": "@lancedb/vectordb-linux-arm64-gnu" + } + }, + "optionalDependencies": { + "@lancedb/vectordb-darwin-arm64": "0.1.2", + "@lancedb/vectordb-darwin-x64": "0.1.2", + "@lancedb/vectordb-linux-x64-gnu": "0.1.2", + "@lancedb/vectordb-linux-arm64-gnu": "0.1.2" } } diff --git a/rust/ffi/node/Cargo.toml b/rust/ffi/node/Cargo.toml index e1edae86..8239fe6c 100644 --- a/rust/ffi/node/Cargo.toml +++ b/rust/ffi/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vectordb-node" -version = "0.1.0" +version = "0.1.2" description = "Serverless, low-latency vector database for AI applications" license = "Apache-2.0" edition = "2018" diff --git a/rust/vectordb/Cargo.toml b/rust/vectordb/Cargo.toml index 2e534216..d43bfc48 100644 --- a/rust/vectordb/Cargo.toml +++ b/rust/vectordb/Cargo.toml @@ -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"