Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
724dde5
fix ci and some housekeeping
robtandy Mar 3, 2025
84ca43b
change fail fast
robtandy Mar 3, 2025
646553f
fix typo in action workflow
robtandy Mar 3, 2025
f2857ac
output rust version
robtandy Mar 3, 2025
1715027
output cargo version
robtandy Mar 3, 2025
207e378
update uv sync order
robtandy Mar 3, 2025
8e72f9c
try to isolate action failure
robtandy Mar 3, 2025
b1d6f32
remove arm64 runner
robtandy Mar 3, 2025
a632754
Merge remote-tracking branch 'upstream/main'
robtandy Mar 4, 2025
8d8ccad
add build workflow borring from datafusion-python
robtandy Mar 4, 2025
b53a631
allow build workflow to be manually triggered
robtandy Mar 4, 2025
a06d05e
add dev/create_license.py from datafusion-python
robtandy Mar 4, 2025
a5e213b
rename LICENSE to LICENSE.txt
robtandy Mar 4, 2025
1d57a81
remove unecessary --features from workflow
robtandy Mar 4, 2025
adfc468
fix typo in build.yml
robtandy Mar 4, 2025
7c48a1b
add protoc install where appropriate in build.yml
robtandy Mar 4, 2025
3d808e1
add protobuf-src build dependency for manylinux builds with maturin i…
robtandy Mar 4, 2025
face082
install protobuf-compiler in manylinux and sdist builds
robtandy Mar 4, 2025
9024d04
change to yum to install protobuf compiler as manylinux images are al…
robtandy Mar 4, 2025
0a94f35
manually download new protoc compiler for manylinux
robtandy Mar 5, 2025
e473498
add some useful output to manylinux builds
robtandy Mar 5, 2025
f3edc7c
unzip in correct directory
robtandy Mar 5, 2025
c56a169
I guess I just write bash scripts now
robtandy Mar 5, 2025
edbc539
use correct arch for cross comp manylinux aarch64
robtandy Mar 5, 2025
2029086
fix typo
robtandy Mar 5, 2025
5ee9912
comment out windows build as protobuf-src does not build on it at the…
robtandy Mar 5, 2025
57b4180
Merge pull request #22 from robtandy/build_workflow
robtandy Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 293 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Python Release Build
on:
pull_request:
branches: ["main"]
push:
tags: ["*-rc*"]
branches: ["branch-*"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python_version: "3.12"

# Use the --no-install-package to only install the dependencies
# but do not yet build the rust library
- name: Install dependencies
run: uv sync --dev --no-install-package datafusion-ray

generate-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Generate license file
run: uv run --no-project python ./dev/create_license.py
- uses: actions/upload-artifact@v4
with:
name: python-wheel-license
path: LICENSE.txt

build-python-mac-win:
needs: [generate-license]
name: Mac/Win
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
#os: [macos-latest, windows-latest]
os: [macos-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: dtolnay/rust-toolchain@stable

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Build Python package
run: |
uv sync --dev --no-install-package datafusion-ray
uv run --no-project maturin build --release --strip

- name: List Windows wheels
if: matrix.os == 'windows-latest'
run: dir target\wheels\
# since the runner is dynamic shellcheck (from actionlint) can't infer this is powershell
# so we specify it explicitly
shell: powershell

- name: List Mac wheels
if: matrix.os != 'windows-latest'
run: find target/wheels/

- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: target/wheels/*

build-macos-x86_64:
needs: [generate-license]
name: Mac x86_64
runs-on: macos-13
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: dtolnay/rust-toolchain@stable

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Build Python package
run: |
uv sync --dev --no-install-package datafusion-ray
uv run --no-project maturin build --release --strip

- name: List Mac wheels
run: find target/wheels/

- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: dist-macos-aarch64
path: target/wheels/*

build-manylinux-x86_64:
needs: [generate-license]
name: Manylinux x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .

- name: Build wheels
uses: PyO3/maturin-action@v1
env:
RUST_BACKTRACE: 1
with:
rust-toolchain: nightly
target: x86_64
manylinux: auto
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
args: --release --manylinux 2014
before-script-linux: |
yum install -y wget
cd /
wget https://github.com/protocolbuffers/protobuf/releases/download/v29.3/protoc-29.3-linux-x86_64.zip
unzip -o proto*zip
cd -
which protoc
protoc --version

- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: dist-manylinux-x86_64
path: target/wheels/*

build-manylinux-aarch64:
needs: [generate-license]
name: Manylinux arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .

- name: Build wheels
uses: PyO3/maturin-action@v1
env:
RUST_BACKTRACE: 1
with:
rust-toolchain: nightly
target: aarch64
# Use manylinux_2_28-cross because the manylinux2014-cross has GCC 4.8.5, which causes the build to fail
manylinux: 2_28
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
args: --release
before-script-linux: |
apt-get install -y unzip
cd /
wget https://github.com/protocolbuffers/protobuf/releases/download/v29.3/protoc-29.3-linux-x86_64.zip
unzip -o proto*zip
cd -
which protoc
protoc --version

- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: dist-manylinux-aarch64
path: target/wheels/*

build-sdist:
needs: [generate-license]
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
manylinux: auto
rustup-components: rust-std rustfmt
args: --release --sdist --out dist
before-script-linux: |
yum install -y wget
cd /
wget https://github.com/protocolbuffers/protobuf/releases/download/v29.3/protoc-29.3-linux-x86_64.zip
unzip -o proto*zip
cd -
which protoc
protoc --version

- name: Assert sdist build does not generate wheels
run: |
if [ "$(ls -A target/wheels)" ]; then
echo "Error: Sdist build generated wheels"
exit 1
else
echo "Directory is clean"
fi
shell: bash

merge-build-artifacts:
runs-on: ubuntu-latest
needs:
- build-python-mac-win
- build-macos-x86_64
- build-manylinux-x86_64
- build-manylinux-aarch64
- build-sdist
steps:
- name: Merge Build Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: dist
pattern: dist-*
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ tonic-build = { version = "0.8", default-features = false, features = [
"prost",
] }
url = "2"
protobuf-src = "2.1"

[dev-dependencies]
tempfile = "3.17"
Expand Down
File renamed without changes.
Loading
Loading