Skip to content

Commit 7c65545

Browse files
committed
ci: Added missing docker image for ARMv7 repair, removed self-hosted
1 parent f728e19 commit 7c65545

File tree

8 files changed

+479
-168
lines changed

8 files changed

+479
-168
lines changed

.github/workflows/build-wheels-defined.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -225,33 +225,39 @@ jobs:
225225
needs: get-supported-versions
226226
name: linux aarch32 (armv7)
227227
if: ${{ inputs.os_linux_armv7 }}
228-
runs-on: linux-armv7-self-hosted
228+
runs-on: ubuntu-latest
229229
strategy:
230230
fail-fast: false
231231
matrix:
232232
python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }}
233-
container: python:${{ matrix.python-version }}-bookworm
234233
steps:
234+
- name: Set up QEMU for ARMv7
235+
uses: docker/setup-qemu-action@v3
236+
with:
237+
platforms: linux/arm/v7
238+
235239
- name: Checkout repository
236240
uses: actions/checkout@v4
237241

238-
- name: Get Python version
239-
run: |
240-
python --version
241-
python -m pip install --upgrade pip
242-
243-
- name: Install build dependencies
244-
run: python -m pip install -r build_requirements.txt
245-
246-
- name: Install additional OS dependencies - Linux ARM
247-
run: os_dependencies/linux_arm.sh
248-
249-
- name: Build wheels
242+
- name: Build wheels - ARMv7 (in Docker)
250243
run: |
251-
# Rust directory needs to be included for Linux ARM7
252-
. $HOME/.cargo/env
253-
254-
python build_wheels_from_file.py --requirements ${{ inputs.packages }}
244+
docker run --rm --platform linux/arm/v7 \
245+
-v $(pwd):/work \
246+
-w /work \
247+
-e GH_TOKEN="${GH_TOKEN}" \
248+
-e PIP_NO_CACHE_DIR=1 \
249+
python:${{ matrix.python-version }}-bookworm \
250+
bash -c "
251+
set -e
252+
python --version
253+
# Install pip packages without cache to reduce memory usage
254+
python -m pip install --no-cache-dir --upgrade pip
255+
python -m pip install --no-cache-dir -r build_requirements.txt
256+
bash os_dependencies/linux_arm.sh
257+
# Source Rust environment after installation
258+
. \$HOME/.cargo/env
259+
python build_wheels_from_file.py --requirements '${{ inputs.packages }}'
260+
"
255261
256262
- name: Upload artifacts of downloaded_wheels directory
257263
uses: actions/upload-artifact@v4

.github/workflows/build-wheels-platforms.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,31 @@ jobs:
3131
include:
3232
- os: Windows
3333
runner: windows-latest
34+
arch: windows-x86_64
3435
- os: Linux x86_64
3536
runner: ubuntu-latest
37+
arch: linux-x86_64
3638
- os: macOS Intel
3739
runner: macos-15-intel
40+
arch: macos-x86_64
3841
- os: macOS ARM
3942
runner: macos-latest
43+
arch: macos-arm64
4044
- os: Linux ARM64
4145
runner: ubuntu-24.04-arm
46+
arch: linux-arm64
4247
- os: Linux ARMv7
43-
runner: linux-armv7-self-hosted # Self-hosted ARMv7 runner
44-
CONTAINER: python:${{ needs.get-supported-versions.outputs.oldest_supported_python }}-bookworm
48+
runner: ubuntu-latest
49+
arch: linux-armv7
4550
python-version: ['${{ needs.get-supported-versions.outputs.oldest_supported_python }}']
4651

47-
# Use python container on ARM
48-
container: ${{ matrix.CONTAINER }}
49-
5052
steps:
53+
- name: Set up QEMU for ARMv7
54+
if: matrix.os == 'Linux ARMv7'
55+
uses: docker/setup-qemu-action@v3
56+
with:
57+
platforms: linux/arm/v7
58+
5159
- name: OS info
5260
if: matrix.os != 'Windows'
5361
run: |
@@ -78,17 +86,17 @@ jobs:
7886

7987

8088
- name: Install build dependencies
89+
if: matrix.os != 'Linux ARMv7'
8190
run: |
8291
python -m pip install --upgrade pip
8392
python -m pip install -r build_requirements.txt
8493
85-
8694
- name: Get Tools versions
95+
if: matrix.os != 'Linux ARMv7'
8796
run: |
8897
python --version
8998
pip show pip setuptools
9099
91-
92100
- name: Install additional OS dependencies - Ubuntu
93101
if: matrix.os == 'Linux x86_64'
94102
run: os_dependencies/ubuntu.sh
@@ -97,23 +105,40 @@ jobs:
97105
if: matrix.os == 'macOS ARM' || matrix.os == 'macOS Intel'
98106
run: os_dependencies/macos.sh
99107

100-
- name: Install additional OS dependencies - Linux ARM
101-
if: matrix.os == 'Linux ARMv7' || matrix.os == 'Linux ARM64'
108+
- name: Install additional OS dependencies - Linux ARM64
109+
if: matrix.os == 'Linux ARM64'
102110
run: os_dependencies/linux_arm.sh
103111

104112
- name: Install additional OS dependencies - Windows
105113
if: matrix.os == 'Windows'
106114
run: powershell -ExecutionPolicy Bypass -File os_dependencies/windows.ps1
107115

108-
109-
- name: Build wheels for IDF
110-
if: matrix.os != 'Windows'
116+
- name: Build wheels for IDF - ARMv7 (in Docker)
117+
if: matrix.os == 'Linux ARMv7'
118+
run: |
119+
docker run --rm --platform linux/arm/v7 \
120+
-v $(pwd):/work \
121+
-w /work \
122+
-e MIN_IDF_MAJOR_VERSION=${{ needs.get-supported-versions.outputs.min_idf_major_version }} \
123+
-e MIN_IDF_MINOR_VERSION=${{ needs.get-supported-versions.outputs.min_idf_minor_version }} \
124+
-e GH_TOKEN="${GH_TOKEN}" \
125+
-e PIP_NO_CACHE_DIR=1 \
126+
python:${{ matrix.python-version }}-bookworm \
127+
bash -c "
128+
set -e
129+
python --version
130+
# Install pip packages without cache to reduce memory usage
131+
python -m pip install --no-cache-dir --upgrade pip
132+
python -m pip install --no-cache-dir -r build_requirements.txt
133+
bash os_dependencies/linux_arm.sh
134+
# Source Rust environment after installation
135+
. \$HOME/.cargo/env
136+
python build_wheels.py
137+
"
138+
139+
- name: Build wheels for IDF - Linux/macOS
140+
if: matrix.os != 'Windows' && matrix.os != 'Linux ARMv7'
111141
run: |
112-
# Source Rust environment for ARMv7
113-
if [ "${{ matrix.os }}" = "Linux ARMv7" ]; then
114-
. $HOME/.cargo/env
115-
fi
116-
117142
# Set ARCHFLAGS for macOS to prevent universal2 wheels
118143
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
119144
export ARCHFLAGS="-arch arm64"
@@ -130,14 +155,14 @@ jobs:
130155
- name: Upload artifacts of downloaded_wheels directory
131156
uses: actions/upload-artifact@v4
132157
with:
133-
name: wheels-download-directory-${{ matrix.runner}}-${{ matrix.python-version }}
158+
name: wheels-download-directory-${{ matrix.arch }}-${{ matrix.python-version }}
134159
path: ./downloaded_wheels
135160
retention-days: 1
136161

137162
- name: Upload artifacts of Python version dependent wheels
138163
uses: actions/upload-artifact@v4
139164
with:
140-
name: dependent_requirements_${{ matrix.runner}}
165+
name: dependent_requirements_${{ matrix.arch }}
141166
path: ./dependent_requirements.txt
142167
retention-days: 1
143168

.github/workflows/build-wheels-python-dependent.yml

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
triage:
1717
name: ${{ matrix.os }} - ${{ matrix.python-version }}
1818
runs-on: ${{ matrix.runner }}
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1921
strategy:
2022
fail-fast: false
2123
matrix:
@@ -29,16 +31,22 @@ jobs:
2931
include:
3032
- os: Windows
3133
runner: windows-latest
34+
arch: windows-x86_64
3235
- os: Linux x86_64
3336
runner: ubuntu-latest
37+
arch: linux-x86_64
3438
- os: macOS Intel
3539
runner: macos-15-intel
40+
arch: macos-x86_64
3641
- os: macOS ARM
3742
runner: macos-latest
43+
arch: macos-arm64
3844
- os: Linux ARM64
3945
runner: ubuntu-24.04-arm
46+
arch: linux-arm64
4047
- os: Linux ARMv7
41-
runner: linux-armv7-self-hosted # Self-hosted ARMv7 runner
48+
runner: ubuntu-latest
49+
arch: linux-armv7
4250
python-version: ${{ fromJson(inputs.supported_python_versions) }}
4351
exclude:
4452
# Exclude oldest supported Python since it's already built in the platform builds
@@ -55,28 +63,31 @@ jobs:
5563
- python-version: ${{ inputs.oldest_supported_python }}
5664
os: Linux ARMv7
5765

58-
# Use python container on ARM - dynamically constructed with bookworm (Debian 12)
59-
container: ${{matrix.os == 'Linux ARMv7' && format('python:{0}-bookworm', matrix.python-version) || null}}
60-
6166
steps:
67+
- name: Set up QEMU for ARMv7
68+
if: matrix.os == 'Linux ARMv7'
69+
uses: docker/setup-qemu-action@v3
70+
with:
71+
platforms: linux/arm/v7
72+
6273
- name: Checkout repository
6374
uses: actions/checkout@v4
6475

6576
- name: Setup Python
66-
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
77+
# Skip setting python on ARMv7 (runs in Docker)
6778
if: matrix.os != 'Linux ARMv7'
6879
uses: actions/setup-python@v5
6980
with:
7081
python-version: ${{ matrix.python-version }}
7182

72-
7383
- name: Get Python version
84+
if: matrix.os != 'Linux ARMv7'
7485
run: |
7586
python --version
7687
python -m pip install --upgrade pip
7788
78-
7989
- name: Install dependencies
90+
if: matrix.os != 'Linux ARMv7'
8091
run: python -m pip install -r build_requirements.txt
8192

8293
- name: Install additional OS dependencies - Ubuntu
@@ -87,52 +98,67 @@ jobs:
8798
if: matrix.os == 'macOS ARM' || matrix.os == 'macOS Intel'
8899
run: os_dependencies/macos.sh
89100

90-
91-
- name: Install additional OS dependencies - Linux ARM7
92-
if: matrix.os == 'Linux ARMv7' || matrix.os == 'Linux ARM64'
101+
- name: Install additional OS dependencies - Linux ARM64
102+
if: matrix.os == 'Linux ARM64'
93103
run: os_dependencies/linux_arm.sh
94104

95105
- name: Download artifacts
96106
uses: actions/download-artifact@v4
97107
with:
98-
name: dependent_requirements_${{ matrix.runner}}
99-
path: dependent_requirements_${{ matrix.runner}}
108+
name: dependent_requirements_${{ matrix.arch }}
109+
path: dependent_requirements_${{ matrix.arch }}
100110

101111
- name: Print requirements
102112
if: matrix.os != 'Windows'
103-
run: cat dependent_requirements_${{ matrix.runner}}/dependent_requirements.txt
113+
run: cat dependent_requirements_${{ matrix.arch }}/dependent_requirements.txt
104114

105115
- name: Print requirements - Windows
106116
if: matrix.os == 'Windows'
107-
run: type dependent_requirements_${{ matrix.runner}}\\dependent_requirements.txt
117+
run: type dependent_requirements_${{ matrix.arch }}\\dependent_requirements.txt
108118

109-
- name: Build Python dependent wheels for ${{ matrix.python-version }}
110-
if: matrix.os != 'Windows'
119+
- name: Build Python dependent wheels - ARMv7 (in Docker)
120+
if: matrix.os == 'Linux ARMv7'
121+
run: |
122+
docker run --rm --platform linux/arm/v7 \
123+
-v $(pwd):/work \
124+
-w /work \
125+
-e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 \
126+
-e GH_TOKEN="${GH_TOKEN}" \
127+
-e PIP_NO_CACHE_DIR=1 \
128+
python:${{ matrix.python-version }}-bookworm \
129+
bash -c "
130+
set -e
131+
python --version
132+
# Install pip packages without cache to reduce memory usage
133+
python -m pip install --no-cache-dir --upgrade pip
134+
python -m pip install --no-cache-dir -r build_requirements.txt
135+
bash os_dependencies/linux_arm.sh
136+
# Source Rust environment after installation
137+
. \$HOME/.cargo/env
138+
python build_wheels_from_file.py dependent_requirements_${{ matrix.arch }}
139+
"
140+
141+
- name: Build Python dependent wheels - Linux/macOS
142+
if: matrix.os != 'Windows' && matrix.os != 'Linux ARMv7'
111143
run: |
112-
# Source Rust environment for ARMv7
113-
if [ "${{ matrix.os }}" = "Linux ARMv7" ]; then
114-
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
115-
. $HOME/.cargo/env
116-
fi
117-
118144
# Set ARCHFLAGS for macOS to prevent universal2 wheels
119145
if [ "${{ matrix.os }}" = "macOS ARM" ]; then
120146
export ARCHFLAGS="-arch arm64"
121147
elif [ "${{ matrix.os }}" = "macOS Intel" ]; then
122148
export ARCHFLAGS="-arch x86_64"
123149
fi
124150
125-
python build_wheels_from_file.py dependent_requirements_${{ matrix.runner}}
151+
python build_wheels_from_file.py dependent_requirements_${{ matrix.arch }}
126152
127153
- name: Build Python dependent wheels for ${{ matrix.python-version }} - Windows
128154
if: matrix.os == 'Windows'
129-
run: python build_wheels_from_file.py dependent_requirements_${{ matrix.runner}}
155+
run: python build_wheels_from_file.py dependent_requirements_${{ matrix.arch }}
130156

131157

132158
- name: Upload artifacts
133159
uses: actions/upload-artifact@v4
134160
with:
135-
name: wheels-download-directory-${{ matrix.runner }}-${{ matrix.python-version }}
161+
name: wheels-download-directory-${{ matrix.arch }}-${{ matrix.python-version }}
136162
if-no-files-found: ignore
137163
path: ./downloaded_wheels
138164
retention-days: 1

0 commit comments

Comments
 (0)