Skip to content

Commit 3e96e20

Browse files
committed
add support for python 3.12 and 3.13
1 parent 11973d9 commit 3e96e20

File tree

6 files changed

+57
-30
lines changed

6 files changed

+57
-30
lines changed

.github/workflows/ci.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,31 @@ jobs:
119119
/local/scripts/create-layer.sh
120120
python scripts/deploy.py ${{ env.GDAL_VERSION_TAG }} --deploy
121121
122-
- name: Build Runtime and Push
122+
- name: Build Runtime and Push Python <=3.11 with yum
123123
run: |
124124
runtimes='3.9 3.10 3.11'
125125
for runtime in ${runtimes}; do
126126
docker build \
127127
--platform=linux/amd64 \
128128
--build-arg GDAL_VERSION_TAG=${{ env.GDAL_VERSION_TAG }} \
129129
--build-arg RUNTIME_VERSION=${runtime} \
130+
--build-arg NUMPY_VERSION=1.25 \
131+
--build-arg PKG_INSTALLER=yum \
132+
-f dockerfiles/runtimes/python \
133+
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime} .
134+
docker push ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime}
135+
done
136+
137+
- name: Build Runtime and Push Python >= 3.12 with dnf
138+
run: |
139+
runtimes='3.12 3.13'
140+
for runtime in ${runtimes}; do
141+
docker build \
142+
--platform=linux/amd64 \
143+
--build-arg GDAL_VERSION_TAG=${{ env.GDAL_VERSION_TAG }} \
144+
--build-arg RUNTIME_VERSION=${runtime} \
145+
--build-arg NUMPY_VERSION=1.26 \
146+
--build-arg PKG_INSTALLER=dnf \
130147
-f dockerfiles/runtimes/python \
131148
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime} .
132149
docker push ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime}

CHANGES.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
- Add support for Python 3.12 and 3.13
6+
- Update deploy.py script compatible runtimes list to currently-available runtimes
17

28
## 2024-02-02.patch1
39

@@ -6,9 +12,9 @@
612
## 2024-02-02
713

814
- update versions (author @philvarner, https://github.com/lambgeo/docker-lambda/pull/76):
9-
- GDAL: 3.8.3
10-
- GEOS: 3.12.1
11-
- PROJ: 9.3.1
15+
- GDAL: 3.8.3
16+
- GEOS: 3.12.1
17+
- PROJ: 9.3.1
1218

1319
- fix `libsqlite3` lib links (author @jasongi, https://github.com/lambgeo/docker-lambda/pull/75)
1420

@@ -24,6 +30,3 @@
2430
## 2023-10-23
2531

2632
- update Python 3.11 base image (author @philvarner, https://github.com/lambgeo/docker-lambda/pull/60)
27-
28-
29-

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ see: <https://github.com/lambgeo/docker-lambda/pkgs/container/lambda-gdal>
4343
#### 1. Create Dockerfile
4444

4545
```Dockerfile
46-
FROM ghcr.io/lambgeo/lambda-gdal:3.8 as gdal
46+
FROM ghcr.io/lambgeo/lambda-gdal:3.8 AS gdal
4747

4848
# We use the official AWS Lambda image
4949
FROM public.ecr.aws/lambda/{RUNTIME: python|node|go...}:{RUNTIME version}
@@ -69,7 +69,7 @@ ENV \
6969
RUN cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *
7070
```
7171

72-
If you are working with **python3.9|3.10|3.11**, you can use lambgeo pre-build docker images:
72+
If you are working with **python3.9|3.10|3.11|3.12|3.13**, you can use lambgeo pre-build docker images:
7373

7474
```Dockerfile
7575
FROM ghcr.io/lambgeo/lambda-gdal:3.8-python3.10
@@ -218,7 +218,7 @@ If your lambda handler needs more dependencies you'll have to use the exact same
218218
##### Create a Dockerfile
219219

220220
```dockerfile
221-
FROM ghcr.io/lambgeo/lambda-gdal:3.8 as gdal
221+
FROM ghcr.io/lambgeo/lambda-gdal:3.8 AS gdal
222222

223223
# This example assume that you are creating a lambda package for python 3.10
224224
FROM public.ecr.aws/lambda/python:3.10

dockerfiles/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/lambda/provided:al2 as builder
1+
FROM public.ecr.aws/lambda/provided:al2 AS builder
22

33
LABEL maintainer="lambgeo <[email protected]>"
44

@@ -402,7 +402,7 @@ RUN for i in $PREFIX/bin/*; do patchelf --force-rpath --set-rpath '$ORIGIN/../li
402402
RUN for i in $PREFIX/lib/*.so; do patchelf --force-rpath --set-rpath '$ORIGIN' $i; done
403403

404404
# Build final image
405-
FROM public.ecr.aws/lambda/provided:al2 as runner
405+
FROM public.ecr.aws/lambda/provided:al2 AS runner
406406

407407
ENV PREFIX /opt
408408
COPY --from=builder /opt/lib/ $PREFIX/lib/

dockerfiles/runtimes/python

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
ARG GDAL_VERSION_TAG
2-
ARG RUNTIME_VERSION
1+
ARG GDAL_VERSION_TAG=x
2+
ARG RUNTIME_VERSION=x
33

4-
FROM ghcr.io/lambgeo/lambda-gdal:${GDAL_VERSION_TAG} as gdal
4+
FROM ghcr.io/lambgeo/lambda-gdal:${GDAL_VERSION_TAG} AS gdal
55

66
FROM public.ecr.aws/lambda/python:${RUNTIME_VERSION}
7+
ARG PKG_INSTALLER
8+
ARG NUMPY_VERSION
79

810
LABEL maintainer="lambgeo <[email protected]>"
911

@@ -12,19 +14,19 @@ ENV \
1214
LC_ALL=en_US.UTF-8 \
1315
CFLAGS="--std=c99"
1416

15-
RUN yum install -y gcc gcc-c++ && \
16-
yum clean all && \
17-
rm -rf /var/cache/yum /var/lib/yum/history
17+
RUN ${PKG_INSTALLER} install -y gcc gcc-c++ && \
18+
${PKG_INSTALLER} clean all
1819

1920
RUN \
2021
python -m pip install pip -U \
21-
&& python -m pip install cython numpy==1.25 wheel --no-binary numpy
22+
&& python -m pip install --upgrade setuptools \
23+
&& python -m pip install cython numpy==${NUMPY_VERSION} wheel --no-binary numpy
2224

2325
# The PREFIX should be the same as in gdal{version}:latest
2426
# When building rasterio, setup.py will get libs directoy from gdal-config
2527
# $ gdal-config --libs
2628
# -L/opt/lib -lgdal
27-
ENV PREFIX /opt
29+
ENV PREFIX=/opt
2830

2931
COPY --from=gdal /opt/lib/ $PREFIX/lib/
3032
COPY --from=gdal /opt/include/ $PREFIX/include/
@@ -42,4 +44,4 @@ RUN export GDAL_VERSION=$(gdal-config --version)
4244

4345
RUN mkdir ${PREFIX}/python
4446

45-
ENTRYPOINT bash
47+
ENTRYPOINT [ "bash" ]

scripts/deploy.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@
2626

2727

2828
CompatibleRuntimes_al2 = [
29-
"nodejs12.x",
30-
"nodejs14.x",
31-
"nodejs16.x",
29+
"nodejs22.x",
30+
"nodejs20.x",
31+
"nodejs18.x",
32+
"python3.13",
33+
"python3.12",
34+
"python3.11",
35+
"python3.10",
36+
"python3.9",
37+
"java21",
38+
"java17",
3239
"java11",
3340
"java8.al2",
34-
"python3.8",
35-
"python3.9",
36-
"python3.10",
37-
"python3.11",
41+
"dotnet8",
3842
"dotnet6",
39-
"dotnetcore3.1",
40-
"ruby2.7",
43+
"ruby3.3",
44+
"ruby3.2",
45+
"provided.al2023",
4146
"provided.al2",
4247
]
4348

0 commit comments

Comments
 (0)