Skip to content

Commit 94e3d99

Browse files
authored
CI: Update CI to include ubuntu 22.04; drop deprecated macos 10.15 (#9)
1 parent 7b08d69 commit 94e3d99

File tree

9 files changed

+213
-49
lines changed

9 files changed

+213
-49
lines changed

.github/workflows/build_wheels.yml

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
os: ["ubuntu-20.04", "macos-10.15"]
33+
os: ["ubuntu-22.04", "ubuntu-20.04", "macos-12"]
3434
platform: ["x86_64"]
35-
python-version: ["3.8", "3.9", "3.10"]
35+
python-version: ["3.8", "3.9", "3.10", "3.11"]
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v2
39+
uses: actions/checkout@v3
4040

4141
- name: Checkout submodules
4242
run: |
@@ -57,7 +57,7 @@ jobs:
5757
vendor/zip-archive
5858
5959
- name: Set up Python
60-
uses: actions/setup-python@v2
60+
uses: actions/setup-python@v4
6161
with:
6262
python-version: ${{ matrix.python-version }}
6363

@@ -98,7 +98,7 @@ jobs:
9898
run: ccache --clear --set-config cache_dir=~/.ccache
9999

100100
- name: Cache ccache
101-
uses: actions/cache@v2
101+
uses: actions/cache@v3
102102
env:
103103
cache-name: ccache-v1
104104
with:
@@ -114,7 +114,28 @@ jobs:
114114
ccache --max-size=2G --set-config cache_dir=~/.ccache
115115
ccache --show-stats --set-config cache_dir=~/.ccache
116116
117-
- name: Build package
117+
- name: Set platform tag for Ubuntu 22.04
118+
if: matrix.os == 'ubuntu-22.04'
119+
run: echo "PLATFORM_TAG=ubuntu22_04_x86_64" >> $GITHUB_ENV
120+
121+
- name: Set platform tag for Ubuntu 20.04
122+
if: matrix.os == 'ubuntu-20.04'
123+
run: echo "PLATFORM_TAG=ubuntu20_04_x86_64">> $GITHUB_ENV
124+
125+
- name: Build package for Ubuntu
126+
if: runner.os == 'Linux'
127+
env:
128+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
129+
run: |
130+
sudo mkdir -p $BUILD_TEMP_DIR
131+
sudo chown -R $(id -u):$(id -g) $BUILD_TEMP_DIR
132+
pip install wheel
133+
python setup.py bdist_wheel --plat-name=$PLATFORM_TAG
134+
echo "List wheels"
135+
ls ./dist
136+
137+
- name: Build package for MacOS
138+
if: runner.os == 'macOS'
118139
env:
119140
CMAKE_CXX_COMPILER_LAUNCHER: ccache
120141
run: |
@@ -123,7 +144,7 @@ jobs:
123144
pip install wheel
124145
python setup.py bdist_wheel
125146
126-
- uses: actions/upload-artifact@v2
147+
- uses: actions/upload-artifact@v3
127148
with:
128149
path: ./dist/*.whl
129150

@@ -134,19 +155,36 @@ jobs:
134155
strategy:
135156
fail-fast: false
136157
matrix:
137-
os: ["ubuntu-20.04", "macos-10.15", "macos-11"]
138-
python-version: ["3.8", "3.9", "3.10"]
158+
os: ["ubuntu-22.04", "ubuntu-20.04", "macos-12", "macos-11"]
159+
python-version: ["3.8", "3.9", "3.10", "3.11"]
160+
env:
161+
PYTHON_VERSION: ${{ matrix.python-version }}
139162

140163
steps:
141-
- name: Checkout
142-
uses: actions/checkout@v2
164+
- name: Install Ubuntu 22.04 runtime dependencies
165+
if: matrix.os == 'ubuntu-22.04'
166+
run: |
167+
sudo apt-get update
168+
sudo apt-get -y install \
169+
libicu70 \
170+
libcurl4 \
171+
libjpeg-turbo8 \
172+
libpng16-16 \
173+
libprotobuf23 \
174+
libuv1 \
175+
libx11-6 \
176+
libegl1 \
177+
libopengl0 \
178+
xvfb
179+
echo "PLATFORM_TAG=ubuntu22_04_x86_64" >> $GITHUB_ENV
143180
144-
- name: Install Linux runtime dependencies
145-
if: runner.os == 'Linux'
181+
- name: Install Ubuntu 20.04 runtime dependencies
182+
if: matrix.os == 'ubuntu-20.04'
146183
run: |
147184
sudo apt-get update
148185
sudo apt-get -y install \
149186
libicu66 \
187+
libcurl4 \
150188
libjpeg-turbo8 \
151189
libpng16-16 \
152190
libprotobuf17 \
@@ -155,37 +193,43 @@ jobs:
155193
libegl1 \
156194
libopengl0 \
157195
xvfb
196+
echo "PLATFORM_TAG=ubuntu20_04_x86_64" >> $GITHUB_ENV
158197
159198
- name: Set up Python
160-
uses: actions/setup-python@v2
199+
uses: actions/setup-python@v4
161200
with:
162201
python-version: ${{ matrix.python-version }}
163202

164203
- name: Download wheels from artifacts
165-
uses: actions/download-artifact@v2
204+
uses: actions/download-artifact@v3
166205
with:
167206
path: wheelhouse
168207

169-
- name: Install dependencies and pymgl wheel
208+
- name: Install dependencies
170209
shell: bash
171210
run: |
211+
echo "PYTHON_SITE_PACKAGES=$pythonLocation/lib/python$PYTHON_VERSION/site-packages" >> $GITHUB_ENV
172212
python -m pip install pytest Pillow numpy pixelmatch python-dotenv
173-
python -m pip install --find-links wheelhouse/artifact pymgl
174-
python -m pip list
175213
176-
- name: Run Linux tests
214+
- name: Install and test wheels on Ubuntu
177215
if: runner.os == 'Linux'
178216
run: |
179-
cd ..
217+
python -m pip install --find-links wheelhouse/artifact --platform $PLATFORM_TAG --target $PYTHON_SITE_PACKAGES --no-deps --upgrade pymgl
218+
python -m pip list
219+
python -m pip list --path $PYTHON_SITE_PACKAGES
180220
xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +render -noreset" \
181221
python -m pytest --pyargs pymgl -v
182222
183-
- name: Run MacOS tests
223+
- name: Install and test wheels on MacOS
184224
if: runner.os == 'macOS'
185225
run: |
226+
python -m pip install --find-links wheelhouse/artifact pymgl
227+
python -m pip list
186228
cd ..
187229
python -m pytest --pyargs pymgl -v
188230
231+
# NOTE: publish is limited to MacOS wheels because Linux wheels are not accepted
232+
# for only Ubuntu, must be manylinux
189233
publish:
190234
name: Publish to GitHub / PyPI
191235
needs: [test-wheels]
@@ -194,7 +238,7 @@ jobs:
194238
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
195239

196240
steps:
197-
- uses: actions/download-artifact@v2
241+
- uses: actions/download-artifact@v3
198242
with:
199243
name: artifact
200244
path: wheels

.github/workflows/test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: ["ubuntu-20.04", "macos-11", "macos-10.15"]
20+
os:
21+
- "ubuntu-22.04"
22+
- "ubuntu-20.04"
23+
- "macos-12"
24+
- "macos-11"
2125
platform: ["x86_64"]
22-
python-version: ["3.8", "3.9", "3.10"]
26+
python-version: ["3.8", "3.9", "3.10", "3.11"]
2327

2428
steps:
2529
- name: Checkout repository
26-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
2731

2832
- name: Checkout submodules
2933
run: |
@@ -44,7 +48,7 @@ jobs:
4448
vendor/zip-archive
4549
4650
- name: Set up Python
47-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v4
4852
with:
4953
python-version: ${{ matrix.python-version }}
5054

@@ -85,7 +89,7 @@ jobs:
8589
run: ccache --clear --set-config cache_dir=~/.ccache
8690

8791
- name: Cache ccache
88-
uses: actions/cache@v2
92+
uses: actions/cache@v3
8993
env:
9094
cache-name: ccache-v1
9195
with:

README.md

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,44 @@ python -m pip install pytest Pillow numpy pixelmatch python-dotenv
3636
python -m pytest --pyargs pymgl -v
3737
```
3838

39-
#### Ubuntu 20.04
39+
#### Ubuntu 22.04 & 20.04
4040

4141
Due to the complexity of building manylinux wheels that include OpenGL and
42-
successfully compile `maplibre-gl-native`, wheels are only available for Ubuntu 20.04.
42+
successfully compile `maplibre-gl-native`, wheels are only available for
43+
Ubuntu 22.04 and 20.04.
4344

4445
Wheels are available on the release page in Github. Download and install from there.
4546

4647
Something like:
4748

4849
```bash
49-
pip install https://github.com/brendan-ward/pymgl/releases/download/<release>/pymgl-<release>-<Python version>-<Python version>-linux_x86_64.whl
50+
pip install https://github.com/brendan-ward/pymgl/releases/download/<release>/pymgl-<release>-<Python version>-<Python version>-ubuntu<Ubuntu version>_x86_64.whl
5051
```
5152

5253
You also need to install the following runtime dependencies:
5354

55+
**Ubuntu 22.04:**
56+
57+
```bash
58+
apt-get install
59+
libicu70 \
60+
libcurl4 \
61+
libjpeg-turbo8 \
62+
libpng16-16 \
63+
libprotobuf23 \
64+
libuv1 \
65+
libx11-6 \
66+
libegl1 \
67+
libopengl0 \
68+
xvfb
69+
```
70+
71+
**Ubuntu 20.04:**
72+
5473
```bash
5574
apt-get install
5675
libicu66 \
76+
libcurl4 \
5777
libjpeg-turbo8 \
5878
libpng16-16 \
5979
libprotobuf17 \
@@ -313,7 +333,7 @@ via `homebrew`:
313333
- cmake
314334
- ninja
315335

316-
#### Developing on Linux (Ubuntu 20.04) requires the following binary libraries:
336+
#### Developing on Ubuntu 22.04 or 20.04 requires the following binary libraries:
317337

318338
- cmake
319339
- ninja-build
@@ -330,7 +350,61 @@ via `homebrew`:
330350

331351
To run on Linux, XVFB must also be running; otherwise the process will segfault.
332352

333-
See `docker/Dockerfile` for more information.
353+
See [`docker/README.md`](./docker/README.md) for more information.
354+
355+
#### Developing on other Linux versions
356+
357+
See `.github/workflows/build_wheels.yml` for the overall structure for building
358+
and testing on Linux. You will most likely need to adapt the names of the
359+
packages to the package manager for your version of Linux.
360+
361+
##### Debian Bullseye
362+
363+
We've heard (#7) that it is possible to successfully build and operate PyMGL
364+
on Debian Bullseye with the following dependencies:
365+
366+
Build:
367+
368+
```bash
369+
apt-get -y install \
370+
curl \
371+
build-essential \
372+
cmake \
373+
ccache \
374+
ninja-build \
375+
pkg-config \
376+
libcurl4-openssl-dev \
377+
libicu-dev \
378+
libturbojpeg0-dev \
379+
libpng-dev \
380+
libprotobuf-dev \
381+
libuv1-dev \
382+
libx11-dev \
383+
libegl-dev \
384+
libopengl-dev \
385+
xvfb \
386+
libjpeg-dev \
387+
libsqlite3-dev \
388+
libopengl0 \
389+
git
390+
```
391+
392+
Runtime:
393+
394+
```bash
395+
apt install --no-install-recommends -y \
396+
xvfb \
397+
xauth \
398+
curl \
399+
libicu67 \
400+
libjpeg-turbo-progs \
401+
libpng16-16 \
402+
libprotobuf23 \
403+
libuv1 \
404+
libx11-6 \
405+
libegl1 \
406+
libopengl0
407+
```
334408

335409
### PyBind11
336410

docker/Dockerfile.dev renamed to docker/Dockerfile.ubuntu20.04

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:20.04
33
WORKDIR /app
44

55
ENV DISPLAY :99
6+
ENV DEBIAN_FRONTEND noninteractive
7+
ENV PYTHONMALLOC malloc
8+
ENV BUILD_TEMP_DIR /tmp/build
69

710
RUN apt-get update && \
811
apt-get -y install software-properties-common && \
@@ -15,8 +18,10 @@ RUN apt-get update && \
1518
ccache \
1619
ninja-build \
1720
pkg-config \
18-
python3.9 \
19-
python3.9-dev \
21+
# install python 3.9
22+
python3 \
23+
python3-dev \
24+
python3-pip \
2025
# required dependencies
2126
libcurl4-openssl-dev \
2227
libicu-dev \
@@ -31,13 +36,7 @@ RUN apt-get update && \
3136
xvfb \
3237
# debugging utilities
3338
valgrind && \
34-
# install pip for python3.9
35-
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
36-
python3.9 get-pip.py && \
3739
/usr/sbin/update-ccache-symlinks
3840

3941
# Install python test deps
40-
RUN pip3.9 install pytest pytest-benchmark pytest-valgrind python-dotenv Pillow numpy pixelmatch requests
41-
42-
ENV BUILD_TEMP_DIR /tmp/build
43-
ENV PYTHONMALLOC malloc
42+
RUN python3 -m pip install pytest pytest-benchmark pytest-valgrind python-dotenv Pillow numpy pixelmatch requests

0 commit comments

Comments
 (0)