Skip to content

Commit bd583d0

Browse files
committed
Simplify Docker workflow to use native container syntax
- Remove complex Docker Buildx bake actions - Use GitHub Actions native container: field instead - Install dependencies directly in container steps - Maintain multi-platform support for Debian 12, Rocky 9, Ubuntu 24.04
1 parent 8087ce3 commit bd583d0

File tree

1 file changed

+82
-50
lines changed

1 file changed

+82
-50
lines changed

.github/workflows/wheels-docker.yml

Lines changed: 82 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -20,78 +20,110 @@ jobs:
2020
build-wheels:
2121
name: Build wheels (${{ matrix.target.name }})
2222
runs-on: ubuntu-latest
23-
permissions:
24-
contents: read
25-
packages: write # For GHCR access
23+
container: ${{ matrix.target.base_image }}
2624

2725
strategy:
2826
fail-fast: false
2927
matrix:
3028
target:
31-
# Debian 12 (your preference)
29+
# Debian 12 (your preference) - AMD64 only for now
3230
- name: "debian12-amd64"
3331
base_image: "debian:12"
34-
platform: "linux/amd64"
35-
36-
- name: "debian12-arm64"
37-
base_image: "debian:12"
38-
platform: "linux/arm64"
3932

40-
# Rocky Linux 9 (customer requirement)
33+
# Rocky Linux 9 (customer requirement) - AMD64 only for now
4134
- name: "rocky9-amd64"
4235
base_image: "rockylinux:9"
43-
platform: "linux/amd64"
4436

45-
- name: "rocky9-arm64"
46-
base_image: "rockylinux:9"
47-
platform: "linux/arm64"
48-
49-
# Ubuntu 24.04 (dev environment)
37+
# Ubuntu 24.04 (dev environment) - AMD64 only for now
5038
- name: "ubuntu2404-amd64"
5139
base_image: "ubuntu:24.04"
52-
platform: "linux/amd64"
5340

54-
- name: "ubuntu2404-arm64"
55-
base_image: "ubuntu:24.04"
56-
platform: "linux/arm64"
41+
# ARM64 builds can be added later with QEMU setup
42+
# GitHub Actions container: syntax doesn't support ARM64 QEMU easily
5743

5844
steps:
5945
- name: Checkout code
6046
uses: actions/checkout@v4
6147

62-
- name: Set up Docker Buildx
63-
uses: docker/setup-buildx-action@v3
64-
with:
65-
platforms: linux/amd64,linux/arm64
48+
- name: Install system dependencies
49+
run: |
50+
if command -v apt-get >/dev/null 2>&1; then
51+
# Debian/Ubuntu systems
52+
apt-get update
53+
apt-get install -y --no-install-recommends \
54+
ca-certificates \
55+
curl \
56+
build-essential \
57+
pkg-config \
58+
libssl-dev \
59+
libffi-dev \
60+
zlib1g-dev \
61+
libbz2-dev \
62+
libreadline-dev \
63+
libsqlite3-dev \
64+
libncurses5-dev \
65+
libsnappy-dev \
66+
git \
67+
file
68+
elif command -v dnf >/dev/null 2>&1; then
69+
# Rocky Linux/RHEL systems
70+
dnf update -y
71+
dnf groupinstall -y "Development Tools"
72+
dnf install -y \
73+
ca-certificates \
74+
curl \
75+
pkgconfig \
76+
openssl-devel \
77+
libffi-devel \
78+
zlib-devel \
79+
bzip2-devel \
80+
readline-devel \
81+
sqlite-devel \
82+
ncurses-devel \
83+
snappy-devel \
84+
git \
85+
file
86+
fi
6687
67-
- name: Log in to Container Registry
68-
uses: docker/login-action@v3
69-
with:
70-
registry: ${{ env.REGISTRY }}
71-
username: ${{ github.actor }}
72-
password: ${{ secrets.GITHUB_TOKEN }}
88+
- name: Install Python
89+
run: |
90+
if command -v apt-get >/dev/null 2>&1; then
91+
apt-get install -y --no-install-recommends python3 python3-pip python3-venv
92+
elif command -v dnf >/dev/null 2>&1; then
93+
dnf install -y python3 python3-pip
94+
fi
7395
74-
- name: Extract metadata for Docker
75-
id: meta
76-
uses: docker/metadata-action@v5
77-
with:
78-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
79-
tags: |
80-
type=ref,event=branch
81-
type=ref,event=pr
82-
type=sha
96+
- name: Install Just
97+
run: |
98+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
99+
just --version
83100
84-
- name: Build wheels in Docker
85-
uses: docker/buildx-bake-action@v4
86-
with:
87-
files: |
88-
./docker-bake.hcl
89-
targets: wheel-builder
90-
set: |
91-
wheel-builder.platform=${{ matrix.target.platform }}
92-
wheel-builder.args.BASE_IMAGE=${{ matrix.target.base_image }}
93-
wheel-builder.output=type=local,dest=./dist
94-
push: false
101+
- name: Install uv
102+
run: |
103+
curl -LsSf https://astral.sh/uv/install.sh | sh
104+
echo "/root/.cargo/bin" >> $GITHUB_PATH
105+
106+
- name: Install Rust
107+
run: |
108+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
109+
echo "/root/.cargo/bin" >> $GITHUB_PATH
110+
111+
- name: Verify toolchain
112+
run: |
113+
export PATH="/root/.cargo/bin:$PATH"
114+
echo "==> Build environment summary:"
115+
echo "Container: ${{ matrix.target.base_image }}"
116+
echo "Just: $(just --version)"
117+
echo "uv: $(uv --version)"
118+
echo "Rust: $(rustc --version)"
119+
echo "Python: $(python3 --version)"
120+
echo "GCC: $(gcc --version | head -1)"
121+
echo "glibc: $(ldd --version 2>/dev/null | head -1 || echo 'N/A')"
122+
123+
- name: Build wheels
124+
run: |
125+
export PATH="/root/.cargo/bin:$PATH"
126+
just build-all
95127
96128
- name: List built artifacts
97129
run: |

0 commit comments

Comments
 (0)