Skip to content

Commit ca73c1b

Browse files
committed
pin cibuildwheel images and manage them with dependabot
1 parent 1269361 commit ca73c1b

File tree

12 files changed

+255
-101
lines changed

12 files changed

+255
-101
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8+
# Docker images for cibuildwheel
9+
- package-ecosystem: "docker"
10+
directories:
11+
- "/docker/manylinux-builder-aarch64"
12+
- "/docker/manylinux-builder-x86_64"
13+
- "/docker/musllinux-builder-aarch64"
14+
- "/docker/musllinux-builder-x86_64"
15+
schedule:
16+
interval: "weekly"
17+
groups:
18+
docker:
19+
patterns:
20+
- "*"

.github/workflows/python-dockerimages-cibuildwheel.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches: [ master, release-* ]
66
paths:
7-
- 'docker/*/Dockerfile'
7+
- 'docker/**'
88
- '.github/workflows/python-dockerimages-cibuildwheel.yml'
99
pull_request:
1010
branches: [ master ]
1111
paths:
12-
- 'docker/*/Dockerfile'
12+
- 'docker/**'
1313
- '.github/workflows/python-dockerimages-cibuildwheel.yml'
1414
workflow_dispatch:
1515

@@ -39,22 +39,12 @@ jobs:
3939
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV
4040
echo "ARCH=x86_64" >> $GITHUB_ENV
4141
if: matrix.os == 'ubuntu-24.04'
42-
- name: Sets env for manylinux
43-
run: |
44-
echo "BASE_IMAGE=quay.io/pypa/manylinux_2_28_${{ env.ARCH }}" >> $GITHUB_ENV
45-
if: matrix.base_image == 'many'
46-
- name: Sets env for musllinux
47-
run: |
48-
echo "BASE_IMAGE=quay.io/pypa/musllinux_1_2_${{ env.ARCH }}" >> $GITHUB_ENV
49-
if: matrix.base_image == 'musl'
5042
- name: Build and push ${{ matrix.base_image }}-${{ env.ARCH }} docker image
5143
uses: docker/build-push-action@v6
5244
with:
53-
context: docker/manylinux-builder
45+
context: docker/${{ matrix.base_image }}linux-builder-${{ env.ARCH }}
5446
cache-from: type=gha
5547
cache-to: type=gha,mode=max
5648
platforms: ${{ env.PLATFORM }}
5749
push: ${{ github.event_name == 'push' }}
58-
build-args: |
59-
base_image=${{ env.BASE_IMAGE }}
6050
tags: keyvidev/${{ matrix.base_image }}linux-builder-${{ env.ARCH }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM quay.io/pypa/manylinux_2_28_aarch64@sha256:202a1466ef81720b304986cdb98a057def76135259642ff011218a4eef4ae55e
2+
3+
RUN \
4+
yum -y update && \
5+
yum clean all && \
6+
yum -y install bzip2-devel snappy-devel xxhash-devel libzstd-devel python3-devel openssl-devel && \
7+
yum clean all;
8+
9+
COPY ../scripts/ /scripts/
10+
WORKDIR /scripts
11+
12+
RUN ./install_zlib.sh
13+
RUN ./install_boost.sh
14+
RUN ./install_cmake.sh
15+
RUN ./install_ccache.sh
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM quay.io/pypa/manylinux_2_28_x86_64@sha256:ef34ac42712ea34065f9036ec72b09b465a6da9e80f94d819a67399957229296
2+
3+
RUN \
4+
yum -y update && \
5+
yum clean all && \
6+
yum -y install bzip2-devel snappy-devel xxhash-devel libzstd-devel python3-devel openssl-devel && \
7+
yum clean all;
8+
9+
COPY ../scripts/ /scripts/
10+
WORKDIR /scripts
11+
12+
RUN ./install_zlib.sh
13+
RUN ./install_boost.sh
14+
RUN ./install_cmake.sh
15+
RUN ./install_ccache.sh

docker/manylinux-builder/Dockerfile

Lines changed: 0 additions & 60 deletions
This file was deleted.

docker/manylinux-builder/build_and_push.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM quay.io/pypa/musllinux_1_2_aarch64@sha256:5ebf27586ed7e77f54b41a3c4cecd8e271e62b2d30917a951f2e3b80201774e8
2+
3+
RUN \
4+
apk upgrade --no-cache && \
5+
apk add --no-cache procps bzip2-dev snappy-dev python3-dev zstd-dev xxhash-dev openssl-dev;
6+
7+
COPY ../scripts/ /scripts/
8+
WORKDIR /scripts
9+
10+
RUN ./install_zlib.sh
11+
RUN ./install_boost.sh
12+
RUN ./install_cmake.sh
13+
RUN ./install_ccache.sh
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM quay.io/pypa/musllinux_1_2_x86_64@sha256:c5071dd790d06f34e8ef0a36310988d6a1ad77d3b743ba1495e09529145833d0
2+
3+
RUN \
4+
apk upgrade --no-cache && \
5+
apk add --no-cache procps bzip2-dev snappy-dev python3-dev zstd-dev xxhash-dev openssl-dev;
6+
7+
COPY ../scripts/ /scripts/
8+
WORKDIR /scripts
9+
10+
RUN ./install_zlib.sh
11+
RUN ./install_boost.sh
12+
RUN ./install_cmake.sh
13+
RUN ./install_ccache.sh

docker/scripts/install_boost.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
BOOST_MAJOR=1
5+
BOOST_MINOR=88
6+
BOOST_PATCH=0
7+
8+
BOOST_URL="https://archives.boost.io/release/${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH}/source/boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}.tar.gz"
9+
BOOST_FALLBACK_URL="https://sourceforge.net/projects/boost/files/boost/${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH}/boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}.tar.gz"
10+
BOOST_DIR="boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}"
11+
12+
echo "Downloading Boost from ${BOOST_URL} (fallback: ${BOOST_FALLBACK_URL})"
13+
14+
if curl -fsSL "${BOOST_URL}" -o boost.tar.gz; then
15+
echo "Downloaded Boost successfully."
16+
else
17+
echo "Primary download failed. Switching to fallback..."
18+
curl -fsSL "${BOOST_FALLBACK_URL}" -o boost.tar.gz
19+
fi
20+
21+
echo "Extracting boost.tar.gz ..."
22+
tar xzf boost.tar.gz
23+
24+
cd "${BOOST_DIR}"
25+
26+
echo "Bootstrapping Boost..."
27+
./bootstrap.sh --without-libraries=graph_parallel,python
28+
29+
# Use nproc if available, otherwise default to 1
30+
if command -v nproc >/dev/null 2>&1; then
31+
JOBS=$(nproc)
32+
else
33+
JOBS=1
34+
fi
35+
36+
echo "Building and installing Boost with ${JOBS} jobs..."
37+
./b2 -j"${JOBS}" -d0 --prefix=/usr/local/ install
38+
39+
cd ..
40+
rm -rf "boost_*" boost.tar.gz
41+
42+
echo "Boost ${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH} installed successfully."

docker/scripts/install_ccache.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
CCACHE_MAJOR=4
5+
CCACHE_MINOR=11
6+
CCACHE_PATCH=3
7+
8+
CCACHE_VERSION="${CCACHE_MAJOR}.${CCACHE_MINOR}.${CCACHE_PATCH}"
9+
CCACHE_TAR="ccache-${CCACHE_VERSION}.tar.gz"
10+
CCACHE_DIR="ccache-${CCACHE_VERSION}"
11+
CCACHE_URL="https://github.com/ccache/ccache/archive/refs/tags/v${CCACHE_VERSION}.tar.gz"
12+
13+
# --- Helpers ---
14+
if command -v nproc >/dev/null 2>&1; then
15+
JOBS=$(nproc)
16+
else
17+
JOBS=1
18+
fi
19+
20+
# --- Download & Extract ---
21+
echo "Downloading ccache ${CCACHE_VERSION} from ${CCACHE_URL}"
22+
curl -fsSL "${CCACHE_URL}" -o "${CCACHE_TAR}"
23+
24+
echo "Extracting ${CCACHE_TAR}..."
25+
tar -xzf "${CCACHE_TAR}"
26+
27+
# --- Build & Install ---
28+
cd "${CCACHE_DIR}"
29+
mkdir build
30+
cd build
31+
32+
echo "Configuring ccache..."
33+
cmake -D ENABLE_TESTING=OFF \
34+
-D REDIS_STORAGE_BACKEND=OFF \
35+
-D CMAKE_BUILD_TYPE=Release ..
36+
37+
echo "Building with ${JOBS} jobs..."
38+
make -j"${JOBS}"
39+
40+
echo "Installing ccache..."
41+
make install
42+
43+
# --- Cleanup ---
44+
cd ../..
45+
rm -rf "${CCACHE_DIR}" "${CCACHE_TAR}"
46+
47+
# --- Symlinks ---
48+
echo "Creating compiler symlinks for ccache..."
49+
for bin in gcc g++ cc c++ clang clang++; do
50+
if [ ! -e "/usr/local/bin/$bin" ]; then
51+
ln -s /usr/local/bin/ccache "/usr/local/bin/$bin" || true
52+
fi
53+
done
54+
55+
echo "ccache ${CCACHE_VERSION} installed successfully."

0 commit comments

Comments
 (0)