diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8f0b0efa..faa94136 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -80,17 +80,25 @@ jobs: - arch: x86_64 runner: ubuntu-latest - arch: aarch64 - runner: buildjet-8vcpu-ubuntu-2204-arm + # For successful fat LTO builds, we need a large runner to avoid OOM errors. + runner: buildjet-16vcpu-ubuntu-2204-arm steps: - name: Checkout uses: actions/checkout@v4 # Buildjet aarch64 runners have only 1.5 GB RAM per core, vs 3.5 GB per core for - # x86_64 runners. Cargo defaults to spawn a job per core, but needs a lot - # of memory per job. Thus for ARM we need to reduce the number of jobs - # to avoid OOM errors when building. + # x86_64 runners. To avoid OOM errors on ARM, we create a swap file. - name: Configure aarch64 build if: ${{ matrix.config.arch == 'aarch64' }} - run: echo "CARGO_BUILD_JOBS=4" >> "$GITHUB_ENV" + run: | + free -h + sudo fallocate -l 16G /swapfile + sudo chmod 600 /swapfile + sudo mkswap /swapfile + sudo swapon /swapfile + echo "/swapfile swap swap defaults 0 0" >> sudo /etc/fstab + # print info + swapon --show + free -h - name: Build Linux Artifacts run: | bash ci/build_linux_artifacts.sh ${{ matrix.config.arch }} diff --git a/ci/build_linux_artifacts.sh b/ci/build_linux_artifacts.sh index 70b06ad4..22b9073d 100755 --- a/ci/build_linux_artifacts.sh +++ b/ci/build_linux_artifacts.sh @@ -13,7 +13,9 @@ docker build \ . popd +# We turn on memory swap to avoid OOM killer docker run \ -v $(pwd):/io -w /io \ + --memory-swap=-1 \ lancedb-node-manylinux \ bash ci/manylinux_node/build.sh $ARCH diff --git a/nodejs/vectordb/native.d.ts b/nodejs/vectordb/native.d.ts index 5c65d2e9..1fc8c9b2 100644 --- a/nodejs/vectordb/native.d.ts +++ b/nodejs/vectordb/native.d.ts @@ -73,7 +73,7 @@ export class Table { /** Return Schema as empty Arrow IPC file. */ schema(): Buffer add(buf: Buffer): Promise - countRows(filter?: string): Promise + countRows(filter?: string | undefined | null): Promise delete(predicate: string): Promise createIndex(): IndexBuilder query(): Query