mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-05 19:32:56 +00:00
Compare commits
1 Commits
v0.1.2-dev
...
v0.1.2-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d85cb062d7 |
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -39,7 +39,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: target/vectordb-*.crate
|
files: target/vectordb-*.crate
|
||||||
fail_on_unmatched_files: true
|
|
||||||
|
|
||||||
python:
|
python:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -67,7 +66,6 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
python/dist/lancedb-*.tar.gz
|
python/dist/lancedb-*.tar.gz
|
||||||
python/dist/lancedb-*.whl
|
python/dist/lancedb-*.whl
|
||||||
fail_on_unmatched_files: true
|
|
||||||
|
|
||||||
node:
|
node:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -97,7 +95,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: node/vectordb-*.tgz
|
files: node/vectordb-*.tgz
|
||||||
fail_on_unmatched_files: true
|
|
||||||
|
|
||||||
node-macos:
|
node-macos:
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
@@ -121,10 +118,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: node/dist/vectordb-darwin*.tgz
|
files: node/dist/vectordb-darwin*.tgz
|
||||||
fail_on_unmatched_files: true
|
|
||||||
|
|
||||||
node-linux:
|
node-linux:
|
||||||
name: node-linux (${{ matrix.arch}}-unknown-linux-${{ matrix.libc }})
|
name: Linux ${{ matrix.settings.arch}} native node module
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: draft-release
|
needs: draft-release
|
||||||
strategy:
|
strategy:
|
||||||
@@ -132,20 +128,17 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
libc:
|
libc:
|
||||||
- gnu
|
- gnu
|
||||||
# TODO: re-enable musl once we have refactored to pre-built containers
|
- musl
|
||||||
# Right now we have to build node from source which is too expensive.
|
|
||||||
# - musl
|
|
||||||
arch:
|
arch:
|
||||||
- x86_64
|
- x86_64
|
||||||
- aarch64
|
- aarch64
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
working-directory: node
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set up QEMU
|
|
||||||
if: ${{ matrix.arch == 'aarch64' }}
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
with:
|
|
||||||
platforms: arm64
|
|
||||||
- name: Build Linux GNU native node modules
|
- name: Build Linux GNU native node modules
|
||||||
if: ${{ matrix.libc == 'gnu' }}
|
if: ${{ matrix.libc == 'gnu' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -156,7 +149,7 @@ jobs:
|
|||||||
- name: Build musl Linux native node modules
|
- name: Build musl Linux native node modules
|
||||||
if: ${{ matrix.libc == 'musl' }}
|
if: ${{ matrix.libc == 'musl' }}
|
||||||
run: |
|
run: |
|
||||||
docker run --platform linux/arm64/v8 \
|
docker run \
|
||||||
-v $(pwd):/io -w /io \
|
-v $(pwd):/io -w /io \
|
||||||
quay.io/pypa/musllinux_1_1_${{ matrix.arch }} \
|
quay.io/pypa/musllinux_1_1_${{ matrix.arch }} \
|
||||||
bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-musl
|
bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-musl
|
||||||
@@ -164,7 +157,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: node/dist/vectordb-linux*.tgz
|
files: node/dist/vectordb-linux*.tgz
|
||||||
fail_on_unmatched_files: true
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [python, node, node-macos, node-linux, rust]
|
needs: [python, node, node-macos, node-linux, rust]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Builds the Linux artifacts (node binaries).
|
# Builds the Linux artifacts (node binaries).
|
||||||
# Usage: ./build_linux_artifacts.sh [target]
|
# Usage: ./build_linux_artifacts.sh [target]
|
||||||
# Targets supported:
|
# Targets supported:
|
||||||
@@ -7,7 +6,10 @@
|
|||||||
# - aarch64-unknown-linux-musl
|
# - aarch64-unknown-linux-musl
|
||||||
# - x86_64-unknown-linux-musl
|
# - x86_64-unknown-linux-musl
|
||||||
|
|
||||||
# TODO: refactor this into a Docker container we can pull
|
# On MacOS, need to run in a linux container:
|
||||||
|
# docker run -v $(pwd):/io -w /io
|
||||||
|
|
||||||
|
# Must run rustup toolchain install stable-x86_64-unknown-linux-gnu --force-non-host
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -37,15 +39,11 @@ setup_dependencies() {
|
|||||||
|
|
||||||
install_node() {
|
install_node() {
|
||||||
echo "Installing 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
|
if [[ $1 == *musl ]]; then
|
||||||
# This node version is 15, we need 16 or higher:
|
apk add nodejs-current npm
|
||||||
# apk add nodejs-current npm
|
|
||||||
# So instead we install from source (nvm doesn't provide binaries for musl):
|
|
||||||
nvm install -s 17
|
|
||||||
else
|
else
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
|
||||||
|
source "$HOME"/.nvm/nvm.sh
|
||||||
nvm install 17 # latest that supports glibc 2.17
|
nvm install 17 # latest that supports glibc 2.17
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -54,6 +52,7 @@ install_rust() {
|
|||||||
echo "Installing rust..."
|
echo "Installing rust..."
|
||||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||||
export PATH="$PATH:/root/.cargo/bin"
|
export PATH="$PATH:/root/.cargo/bin"
|
||||||
|
rustup target add $1
|
||||||
}
|
}
|
||||||
|
|
||||||
build_node_binary() {
|
build_node_binary() {
|
||||||
@@ -64,10 +63,8 @@ build_node_binary() {
|
|||||||
# This is needed for cargo to allow build cdylibs with musl
|
# This is needed for cargo to allow build cdylibs with musl
|
||||||
export RUSTFLAGS="-C target-feature=-crt-static"
|
export RUSTFLAGS="-C target-feature=-crt-static"
|
||||||
fi
|
fi
|
||||||
# We don't pass in target, since the native target here already matches
|
npm run build-release -- --target $1
|
||||||
# and openblas-src doesn't do well with cross-compilation.
|
npm run pack-build -- --target $1
|
||||||
npm run build-release
|
|
||||||
npm run pack-build
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
@@ -79,6 +76,6 @@ TARGET=${1:-x86_64-unknown-linux-gnu}
|
|||||||
# aarch64-unknown-linux-musl
|
# aarch64-unknown-linux-musl
|
||||||
|
|
||||||
setup_dependencies $TARGET
|
setup_dependencies $TARGET
|
||||||
install_node $TARGET
|
install_node
|
||||||
install_rust
|
install_rust $TARGET
|
||||||
build_node_binary $TARGET
|
build_node_binary $TARGET
|
||||||
|
|||||||
31
ci/ubuntu_build.dockerfile
Normal file
31
ci/ubuntu_build.dockerfile
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# On MacOS, need to run in a linux container:
|
||||||
|
# cat ci/ubuntu_build.dockerfile | docker build -t lancedb-node-build -
|
||||||
|
# docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/io -w /io lancedb-node-build bash ci/build_linux_artifacts.sh
|
||||||
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV TZ=Europe/Moscow
|
||||||
|
|
||||||
|
RUN apt update && apt install -y protobuf-compiler libssl-dev build-essential curl \
|
||||||
|
software-properties-common npm docker.io
|
||||||
|
|
||||||
|
# Install rust
|
||||||
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||||
|
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
# Install cross
|
||||||
|
# https://github.com/cross-rs/cross/issues/1257#issuecomment-1544553706
|
||||||
|
RUN cargo install cross --git https://github.com/cross-rs/cross
|
||||||
|
|
||||||
|
# Install additional build targets
|
||||||
|
RUN rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu aarch64-unknown-linux-musl x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
# Install node
|
||||||
|
RUN npm install npm@latest -g && \
|
||||||
|
npm install n -g && \
|
||||||
|
n latest
|
||||||
|
|
||||||
|
# set CROSS_CONTAINER_IN_CONTAINER to inform `cross` that it is executed from within a container
|
||||||
|
ENV CROSS_CONTAINER_IN_CONTAINER=true
|
||||||
|
ENV CROSS_CONTAINER_ENGINE_NO_BUILDKIT=1
|
||||||
@@ -102,10 +102,3 @@ docker run -it \
|
|||||||
bash
|
bash
|
||||||
```
|
```
|
||||||
-->
|
-->
|
||||||
|
|
||||||
```
|
|
||||||
docker run \
|
|
||||||
-v $(pwd):/io -w /io \
|
|
||||||
quay.io/pypa/musllinux_1_1_aarch64 \
|
|
||||||
bash alpine_repro.sh
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user