mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-24 22:09:58 +00:00
Compare commits
2 Commits
v0.1.2-dev
...
v0.1.2-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
181f8e1ebf | ||
|
|
c4237c61d5 |
76
.github/workflows/release.yml
vendored
76
.github/workflows/release.yml
vendored
@@ -37,8 +37,8 @@ jobs:
|
||||
run: cargo package --all-features
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
rust/target/vectordb-*.crate
|
||||
draft: true
|
||||
files: target/vectordb-*.crate
|
||||
|
||||
python:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -55,11 +55,14 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.10
|
||||
python-version: "3.10"
|
||||
- name: Build wheel
|
||||
run: python setup.py sdist bdist_wheel
|
||||
run: |
|
||||
pip install wheel
|
||||
python setup.py sdist bdist_wheel
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
python/dist/lancedb-*.tar.gz
|
||||
python/dist/lancedb-*.whl
|
||||
@@ -79,7 +82,6 @@ jobs:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
cache-dependency-path: node/package-lock.json
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
@@ -91,12 +93,14 @@ jobs:
|
||||
npm pack
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
files: node/vectordb-*.tgz
|
||||
|
||||
node-macos:
|
||||
runs-on: macos-12
|
||||
needs: draft-release
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [x86_64-apple-darwin, aarch64-apple-darwin]
|
||||
steps:
|
||||
@@ -104,35 +108,77 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
- name: Install system dependencies
|
||||
run: brew install protobuf
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
cd node
|
||||
npm ci
|
||||
- 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/vectordb-darwin*.tgz
|
||||
|
||||
node-linux:
|
||||
name: Linux ${{ matrix.settings.arch}} native node module
|
||||
runs-on: ubuntu-latest
|
||||
needs: draft-release
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu:centos
|
||||
- aarch64-unknown-linux-gnu:centos
|
||||
- aarch64-unknown-linux-musl
|
||||
- x86_64-unknown-linux-musl
|
||||
libc:
|
||||
- gnu
|
||||
- musl
|
||||
settings:
|
||||
- container: quay.io/pypa/manylinux2014_x86_64
|
||||
arch: x86_64
|
||||
protoc_arch: x86_64
|
||||
# TODO: find a way to build aarch64 on GA
|
||||
# - container: quay.io/pypa/manylinux2014_aarch64
|
||||
# arch: aarch64
|
||||
# protoc_arch: aarch_64
|
||||
container:
|
||||
image: ${{ matrix.settings.container }}
|
||||
options: --platform linux/amd64
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: node
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y protobuf-compiler libssl-dev
|
||||
- name: Build Linux native node modules
|
||||
run: bash ci/build_linux_artifacts.sh ${{ matrix.target }}
|
||||
yum install -y openssl-devel unzip
|
||||
# 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-${{ matrix.settings.protoc_arch }}.zip
|
||||
unzip protoc-$PB_VERSION-linux-${{ matrix.settings.protoc_arch }}.zip -d /usr/local
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 17 # Last that support glibc 2.17
|
||||
- name: Setup Rust
|
||||
run: |
|
||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
echo "/root/.cargo/bin" >> $GITHUB_PATH
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
- name: Build ${{ matrix.settings.libc }} library
|
||||
run: |
|
||||
BUILD_TARGET=${{ matrix.settings.arch }}-unknown-linux-${{ matrix.settings.libc }}
|
||||
rustup target add $BUILD_TARGET
|
||||
export RUSTFLAGS="-C target-feature=-crt-static" # for musl
|
||||
npm run build-release -- --target $BUILD_TARGET
|
||||
npm run pack-build -- --target $BUILD_TARGET
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
files: node/dist/vectordb-linux*.tgz
|
||||
|
||||
release:
|
||||
needs: [python, node, node-macos, node-linux]
|
||||
needs: [python, node, node-macos, node-linux, rust]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
|
||||
33
Cross.toml
33
Cross.toml
@@ -1,14 +1,39 @@
|
||||
# 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",
|
||||
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
|
||||
# Install newer gfortran
|
||||
"yum install -y openssl-devel unzip gcc-gfortran",
|
||||
"scl enable devtoolset-11 bash",
|
||||
# protobuf is too old, so we directly download binaries
|
||||
"PB_REL=https://github.com/protocolbuffers/protobuf/releases",
|
||||
"PB_VERSION=23.1",
|
||||
"curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip",
|
||||
"unzip protoc-$PB_VERSION-linux-x86_64.zip -d /usr/local",
|
||||
]
|
||||
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos"
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
pre-build = [
|
||||
"dpkg --add-architecture $CROSS_DEB_ARCH",
|
||||
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
|
||||
"yum install -y openssl-devel unzip",
|
||||
# protobuf is too old, so we directly download binaries
|
||||
"PB_REL=https://github.com/protocolbuffers/protobuf/releases",
|
||||
"PB_VERSION=23.1",
|
||||
"curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip",
|
||||
"unzip protoc-$PB_VERSION-linux-x86_64.zip -d /usr/local",
|
||||
]
|
||||
# https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.aarch64-unknown-linux-gnu.centos
|
||||
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos"
|
||||
|
||||
[target.x86_64-unknown-linux-musl]
|
||||
# https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.x86_64-unknown-linux-musl
|
||||
pre-build = [
|
||||
"dpkg --add-architecture $CROSS_DEB_ARCH",
|
||||
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH",
|
||||
]
|
||||
|
||||
[target.aarch64-unknown-linux-musl]
|
||||
# https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.aarch64-unknown-linux-musl
|
||||
pre-build = [
|
||||
"dpkg --add-architecture $CROSS_DEB_ARCH",
|
||||
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH",
|
||||
]
|
||||
|
||||
@@ -20,10 +20,10 @@ build_node_binaries() {
|
||||
do
|
||||
echo "Building node library for $target"
|
||||
# cross doesn't yet pass this down to Docker, so we do it ourselves.
|
||||
if [[ $target == x86_64* ]]; then
|
||||
export CROSS_CONTAINER_OPTS="--platform linux/amd64"
|
||||
else
|
||||
export CROSS_CONTAINER_OPTS="--platform linux/arm64/v8"
|
||||
export CROSS_CONTAINER_OPTS="--platform linux/amd64"
|
||||
if [[ $target == *musl ]]; then
|
||||
# This is needed for cargo to allow build cdylibs with musl
|
||||
RUSTFLAGS="-C target-feature=-crt-static"
|
||||
fi
|
||||
npm run cross-release -- --target $target
|
||||
npm run pack-build -- --target $target
|
||||
|
||||
Reference in New Issue
Block a user