Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jdye64 committed Aug 28, 2023
2 parents 28fce59 + a71b3eb commit 4140457
Show file tree
Hide file tree
Showing 156 changed files with 4,248 additions and 2,299 deletions.
File renamed without changes.
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
* @ayushdg @charlesbluca @galipremsagar

# rust codeowners
dask_planner/ @ayushdg @charlesbluca @galipremsagar @jdye64
.cargo/ @ayushdg @charlesbluca @galipremsagar @jdye64
src/ @ayushdg @charlesbluca @galipremsagar @jdye64
Cargo.toml @ayushdg @charlesbluca @galipremsagar @jdye64
Cargo.lock @ayushdg @charlesbluca @galipremsagar @jdye64
12 changes: 7 additions & 5 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ on:
pull_request:
paths:
- setup.py
- dask_planner/Cargo.toml
- dask_planner/Cargo.lock
- dask_planner/pyproject.toml
- dask_planner/rust-toolchain.toml
- Cargo.toml
- Cargo.lock
- pyproject.toml
- continuous_integration/recipe/**
- .github/workflows/conda.yml
schedule:
Expand All @@ -34,7 +33,9 @@ jobs:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10"]
arch: ["linux-64", "linux-aarch64"]
# FIXME: aarch64 builds are consuming too much memory to run on GHA
# arch: ["linux-64", "linux-aarch64"]
arch: ["linux-64"]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -61,6 +62,7 @@ jobs:
conda mambabuild continuous_integration/recipe \
--python ${{ matrix.python }} \
--variants "{target_platform: [${{ matrix.arch }}]}" \
--error-overlinking \
--no-test \
--no-anaconda-upload \
--output-folder packages
Expand Down
40 changes: 28 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Upload Docker image
name: Build Docker image

on:
release:
types: [created]
push:
branches:
- main
pull_request:
paths:
- setup.py
- Cargo.toml
- Cargo.lock
- pyproject.toml
- docker/**
- .github/workflows/docker.yml

# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
Expand All @@ -17,15 +25,16 @@ jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: github.repository == 'dask-contrib/dask-sql'
env:
DOCKER_PUSH: ${{ github.event_name == 'push' && github.repository == 'dask-contrib/dask-sql' }}
strategy:
fail-fast: false
matrix:
platform: ["linux/amd64", "linux/arm64", "linux/386"]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3
- name: Login to DockerHub
if: ${{ fromJSON(env.DOCKER_PUSH) }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -41,10 +50,16 @@ jobs:
context: .
file: ./docker/main.dockerfile
build-args: DOCKER_META_VERSION=${{ steps.docker_meta_main.outputs.version }}
platforms: linux/amd64,linux/arm64,linux/386
platforms: ${{ matrix.platform }}
tags: ${{ steps.docker_meta_main.outputs.tags }}
labels: ${{ steps.docker_meta_main.outputs.labels }}
push: true
push: ${{ fromJSON(env.DOCKER_PUSH) }}
load: ${{ !fromJSON(env.DOCKER_PUSH) }}
- name: Check images
run: |
df -h
docker image ls
docker image inspect ${{ steps.docker_meta_main.outputs.tags }}
- name: Docker meta for cloud image
id: docker_meta_cloud
uses: crazy-max/ghaction-docker-meta@v4
Expand All @@ -56,7 +71,8 @@ jobs:
context: .
file: ./docker/cloud.dockerfile
build-args: DOCKER_META_VERSION=${{ steps.docker_meta_main.outputs.version }}
platforms: linux/amd64,linux/arm64,linux/386
platforms: ${{ matrix.platform }}
tags: ${{ steps.docker_meta_cloud.outputs.tags }}
labels: ${{ steps.docker_meta_cloud.outputs.labels }}
push: true
push: ${{ fromJSON(env.DOCKER_PUSH) }}
load: ${{ !fromJSON(env.DOCKER_PUSH) }}
190 changes: 113 additions & 77 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,123 +15,159 @@ concurrency:
env:
upload: ${{ github.event_name == 'release' && github.repository == 'dask-contrib/dask-sql' }}

# Required shell entrypoint to have properly activated conda environments
defaults:
run:
shell: bash -l {0}

jobs:
wheels:
name: Build and publish py3.${{ matrix.python }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
linux:
name: Build and publish wheels for linux ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["8", "9", "10"] # 3.x
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Protoc
if: matrix.os != 'ubuntu-latest'
uses: arduino/setup-protoc@v1
if: matrix.target == 'aarch64'
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU for linux-aarch64
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v2
- uses: actions/setup-python@v4
with:
platforms: arm64
- name: Add rust toolchain target for macos-aarch64
if: matrix.os == 'macos-latest'
run: rustup target add aarch64-apple-darwin
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: 'cp3${{ matrix.python }}-*'
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS_LINUX: 'aarch64 x86_64'
CIBW_ARCHS_WINDOWS: 'AMD64'
CIBW_ARCHS_MACOS: 'x86_64 arm64'
# Without CARGO_NET_GIT_FETCH_WITH_CLI we oom (https://github.com/rust-lang/cargo/issues/10583)
CIBW_ENVIRONMENT_LINUX: >
CARGO_NET_GIT_FETCH_WITH_CLI="true"
PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_BEFORE_BUILD: 'pip install -U setuptools-rust'
CIBW_BEFORE_BUILD_LINUX: >
ARCH=$([ $(uname -m) == x86_64 ] && echo x86_64 || echo aarch_64) &&
DOWNLOAD_URL=$(curl --retry 6 --retry-delay 10 -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | grep -o '"browser_download_url": "[^"]*' | cut -d'"' -f4 | grep "\linux-${ARCH}.zip$") &&
python-version: '3.10'
- name: Build wheels for x86_64
if: matrix.target == 'x86_64'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
manylinux: '2_17'
before-script-linux: >
DOWNLOAD_URL=$(curl --retry 6 --retry-delay 10 -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | grep -o '"browser_download_url": "[^"]*' | cut -d'"' -f4 | grep "\linux-x86_64.zip$") &&
curl --retry 6 --retry-delay 10 -LO $DOWNLOAD_URL &&
unzip protoc-*-linux-$ARCH.zip -d $HOME/.local &&
protoc --version &&
pip install -U setuptools-rust &&
pip list &&
curl --retry 6 --retry-delay 10 https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y &&
rustup show
unzip protoc-*-linux-x86_64.zip -d $HOME/.local
docker-options: --env PROTOC=/root/.local/bin/protoc
- name: Build wheels for aarch64
if: matrix.target == 'aarch64'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --zig
sccache: 'true'
manylinux: '2_17'
- name: Check dist files
run: |
pip install twine
twine check dist/*
ls -lh dist/
- name: Upload binary wheels
uses: actions/upload-artifact@v3
with:
package-dir: .
output-dir: dist
config-file: "dask_planner/pyproject.toml"
- name: Set up Python
uses: conda-incubator/[email protected]
name: wheels for linux ${{ matrix.target }}
path: dist/*
- name: Publish package
if: env.upload == 'true'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*

windows:
name: Build and publish wheels for windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
miniforge-variant: Mambaforge
use-mamba: true
python-version: "3.8"
channel-priority: strict
# FIXME: aarch64 builds require glibc>=2.32 to prevent TLS allocation error when importing;
# is there any way we could modify the TLS model of its shared object to avoid this?
# https://bugzilla.redhat.com/show_bug.cgi?id=1722181
# xref: https://github.com/dask-contrib/dask-sql/issues/1169
- name: Update platform tag for aarch64 wheel
if: matrix.os == 'ubuntu-latest'
target: x64
args: --release --out dist
sccache: 'true'
- name: Check dist files
run: |
mamba install wheel
pip install twine
wheel tags --platform-tag=manylinux_2_32_aarch64 \
--remove \
dist/*_aarch64.whl
twine check dist/*
ls dist/
- name: Upload binary wheels
uses: actions/upload-artifact@v3
with:
name: wheels for windows
path: dist/*
- name: Publish package
if: env.upload == 'true'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*

macos:
name: Build and publish wheels for macos ${{ matrix.target }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Check dist files
run: |
mamba install twine
pip install twine
twine check dist/*
ls -lh dist/
- name: Upload binary wheels
uses: actions/upload-artifact@v3
with:
name: wheels for py3.${{ matrix.python }} on ${{ matrix.os }}
name: wheels for macos ${{ matrix.target }}
path: dist/*
- name: Publish package
if: env.upload == 'true'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*

sdist:
name: Build and publish source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
fetch-depth: 0
- name: Set up Python
uses: conda-incubator/setup-[email protected]
command: sdist
args: --out dist
- uses: actions/setup-python@v4
with:
miniforge-variant: Mambaforge
use-mamba: true
python-version: "3.8"
channel-priority: strict
- name: Build source distribution
run: |
mamba install setuptools-rust twine
python setup.py sdist
python-version: '3.10'
- name: Check dist files
run: |
pip install twine
twine check dist/*
ls -lh dist/
- name: Publish source distribution
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,17 @@ jobs:
- name: Optionally update upstream dependencies
if: needs.detect-ci-trigger.outputs.triggered == 'true'
run: |
cd dask_planner
bash update-dependencies.sh
bash continuous_integration/scripts/update-dependencies.sh
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check workspace in debug mode
run: |
cd dask_planner
cargo check
- name: Check workspace in release mode
run: |
cd dask_planner
cargo check --release
# test the crate
Expand All @@ -84,14 +81,12 @@ jobs:
- name: Optionally update upstream dependencies
if: needs.detect-ci-trigger.outputs.triggered == 'true'
run: |
cd dask_planner
bash update-dependencies.sh
bash continuous_integration/scripts/update-dependencies.sh
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
cd dask_planner
cargo test
Loading

0 comments on commit 4140457

Please sign in to comment.