Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update many, musllinux images and add github runner #313

Merged
merged 28 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .github/workflows/python-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ jobs:

- name: install mac dependencies arm64
if: ${{ (runner.os == 'macOS') && (matrix.arch == 'arm64') }}
# explicitly install icu4c@75(required by boost), not icu4c which defaults to icu4c@74
# explicitly install icu4c@76 and boost@1.86, not icu4c/boost to avoid unsupported combinations
# Note: when brew reinstall finds unsolved deps, it downloads and installs using the wrong arch(x86_64 instead of arm64)
run: |
set -e
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
echo "_CMAKE_PREFIX_PATH=${{ github.workspace }}/arm64-homebrew" >> $GITHUB_ENV
echo "CIBW_REPAIR_WHEEL_COMMAND_MACOS=DYLD_LIBRARY_PATH=${{ github.workspace }}/arm64-homebrew delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" >> $GITHUB_ENV
mkdir arm64-homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm64-homebrew
PACKAGES=( icu4c@75 xz lz4 zstd zlib snappy boost )
PACKAGES=( icu4c@76 xz lz4 zstd zlib snappy boost@1.86 )
for PACKAGE in "${PACKAGES[@]}"
do
arm64-homebrew/bin/brew info $PACKAGE
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/python-dockerimages-cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Python Linux docker cibuildwheel

on:
push:
branches: [ master, release-* ]
paths:
- 'docker/*/Dockerfile'
- '.github/workflows/python-dockerimages-cibuildwheel.yml'
pull_request:
branches: [ master ]
paths:
- 'docker/*/Dockerfile'
- '.github/workflows/python-dockerimages-cibuildwheel.yml'
workflow_dispatch:

jobs:
build_docker:
runs-on: ubuntu-latest
strategy:
matrix:
base_image: [many, musl]
arch: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Sets env for manylinux
run: |
echo "BASE_IMAGE=quay.io/pypa/manylinux_2_28_${{ matrix.arch }}" >> $GITHUB_ENV
if: matrix.base_image == 'many'
- name: Sets env for musllinux
run: |
echo "BASE_IMAGE=quay.io/pypa/musllinux_1_1_${{ matrix.arch }}" >> $GITHUB_ENV
if: matrix.base_image == 'musl'
- name: Build and push ${{ matrix.base_image }}-${{ matrix.arch }} docker image
uses: docker/build-push-action@v6
with:
context: docker/manylinux-builder
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name == 'push' }}
build-args: |
base_image=${{ env.BASE_IMAGE }}
tags: keyvidev/${{ matrix.base_image }}linux-builder-${{ matrix.arch }}
27 changes: 12 additions & 15 deletions docker/manylinux-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@ RUN \
if which yum; then \
yum -y update && \
yum clean all && \
yum -y install bzip2-devel snappy-devel python-devel && \
if [ $AUDITWHEEL_ARCH != "aarch64" ]; then \
yum -y install hiredis-devel libzstd-devel; \
fi && \
yum -y install bzip2-devel snappy-devel xxhash-devel libzstd-devel python3-devel openssl-devel && \
yum clean all; \
elif which apk; then \
apk upgrade --no-cache && \
apk add --no-cache procps bzip2-dev snappy-dev python3-dev hiredis-dev zstd-dev; \
apk add --no-cache procps bzip2-dev snappy-dev python3-dev zstd-dev xxhash-dev openssl-dev; \
else \
echo "unsupported os"; \
exit 1; \
fi

ENV ZLIB_MAJOR=1 ZLIB_MINOR=3
ENV ZLIB_MAJOR=1 ZLIB_MINOR=3 ZLIB_PATCH=1

RUN curl https://zlib.net/zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.tar.gz --output zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.tar.gz && \
tar -xvf zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.tar.gz && \
cd zlib-${ZLIB_MAJOR}.${ZLIB_MINOR} && ./configure && make -j`nproc` && make install && \
cd .. && rm -rf zlib-${ZLIB_MAJOR}.${ZLIB_MINOR} zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.tar.gz
RUN curl https://zlib.net/zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH}.tar.gz --output zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH}.tar.gz && \
tar -xvf zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH}.tar.gz && \
cd zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH} && ./configure && make -j`nproc` && make install && \
cd .. && rm -rf zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH} zlib-${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH}.tar.gz

ENV BOOST_MAJOR=1 BOOST_MINOR=83 BOOST_PATCH=0
ENV BOOST_URL="https://boostorg.jfrog.io/artifactory/main/release/${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH}/source/boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}.tar.gz"
Expand All @@ -38,20 +35,20 @@ RUN cd boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH} && \
cd .. && \
rm -rf boost_*

ENV CMAKE_MAJOR=3 CMAKE_MINOR=27 CMAKE_PATCH=7
ENV CMAKE_MAJOR=3 CMAKE_MINOR=30 CMAKE_PATCH=5

RUN curl -sSL https://cmake.org/files/v${CMAKE_MAJOR}.${CMAKE_MINOR}/cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}.${CMAKE_PATCH}.tar.gz | tar -xz && \
cd cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}.${CMAKE_PATCH} && ./bootstrap --parallel=`nproc` -- -DCMAKE_USE_OPENSSL=OFF && make -j`nproc` && make install && \
cd cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}.${CMAKE_PATCH} && ./bootstrap --parallel=`nproc` -- && make -j`nproc` && make install && \
cd .. && rm -rf cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}.${CMAKE_PATCH}

ENV CCACHE_MAJOR=4 CCACHE_MINOR=8 CCACHE_PATCH=3
ENV CCACHE_MAJOR=4 CCACHE_MINOR=10 CCACHE_PATCH=2

RUN \
if [ $AUDITWHEEL_ARCH == "aarch64" ] && [ $AUDITWHEEL_POLICY == "manylinux2014" ]; then \
echo "skiping ccache, not available for this platform"; \
else \
curl -sSL https://github.com/ccache/ccache/archive/refs/tags/v${CCACHE_MAJOR}.${CCACHE_MINOR}.${CCACHE_PATCH}.tar.gz | tar -xz && \
cd ccache-${CCACHE_MAJOR}.${CCACHE_MINOR}.${CCACHE_PATCH} && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j`nproc` && make install && \
cd ccache-${CCACHE_MAJOR}.${CCACHE_MINOR}.${CCACHE_PATCH} && mkdir build && cd build && cmake -D ENABLE_TESTING=OFF -D REDIS_STORAGE_BACKEND=OFF -D CMAKE_BUILD_TYPE=Release .. && make -j`nproc` && make install && \
cd ../.. && rm -rf ccache-${CCACHE_MAJOR}.${CCACHE_MINOR}.${CCACHE_PATCH}; \
fi

Expand All @@ -60,4 +57,4 @@ RUN ln -s /usr/local/bin/ccache /usr/local/bin/gcc && \
ln -s /usr/local/bin/ccache /usr/local/bin/cc && \
ln -s /usr/local/bin/ccache /usr/local/bin/c++ && \
ln -s /usr/local/bin/ccache /usr/local/bin/clang && \
ln -s /usr/local/bin/ccache /usr/local/bin/clang++
ln -s /usr/local/bin/ccache /usr/local/bin/clang++
4 changes: 2 additions & 2 deletions docker/manylinux-builder/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set -euxo pipefail

docker build . \
-f Dockerfile \
--build-arg base_image="quay.io/pypa/manylinux2014_x86_64" \
--build-arg base_image="quay.io/pypa/manylinux_2_28_x86_64" \
-t keyvidev/manylinux-builder-x86_64

docker build . \
-f Dockerfile \
--build-arg base_image="quay.io/pypa/manylinux2014_aarch64" \
--build-arg base_image="quay.io/pypa/manylinux_2_28_aarch64" \
-t keyvidev/manylinux-builder-aarch64

docker build . \
Expand Down
Loading