Skip to content

Pv/gdal 3.10 #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
pull_request:

env:
GDAL_VERSION: 3.8.3
GDAL_VERSION_TAG: 3.8
GDAL_VERSION: 3.9.3 # 3.10.2
GDAL_VERSION_TAG: 3.9

jobs:
build:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

- name: Build Runtime and Push Python <=3.11 with yum
run: |
runtimes='3.9 3.10 3.11'
runtimes='3.10 3.11'
for runtime in ${runtimes}; do
docker build \
--platform=linux/amd64 \
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
## Unreleased

- Add support for Python 3.12 and 3.13
- Remove support for Python 3.9
- Update deploy.py script compatible runtimes list to currently-available runtimes
- update versions:
- GDAL: 3.10.2 "Gulf of Mexico"

## 2024-02-02.patch1

Expand Down
60 changes: 39 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<!-- markdownlint-disable MD033 -->
<p align="center">
<img src="https://user-images.githubusercontent.com/10407788/95621320-7b226080-0a3f-11eb-8194-4b55a5555836.png" style="max-width: 800px;" alt="docker-lambda"></a>
Expand All @@ -14,36 +12,47 @@
</p>
<!-- markdownlint-enable -->

# Docker Images
# Docker Lambda

## Docker Images

Based on `public.ecr.aws/lambda/provided:al2` (AmazonLinux 2)

- GDAL 3.8.3
- **ghcr.io/lambgeo/lambda-gdal:3.8** (Fev 2024)
- GDAL 3.10.2
- **ghcr.io/lambgeo/lambda-gdal:3.10.2** (Feb 2025)

Runtimes images:
### Current images

- Python (based on `public.ecr.aws/lambda/python:{version}`)
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.9**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.10**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.11**

**archived**
- **ghcr.io/lambgeo/lambda-gdal:3.6**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.9**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.10**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.11**
- **ghcr.io/lambgeo/lambda-gdal:3.10-python3.9**
- **ghcr.io/lambgeo/lambda-gdal:3.10-python3.10**
- **ghcr.io/lambgeo/lambda-gdal:3.10-python3.11**
- **ghcr.io/lambgeo/lambda-gdal:3.10-python3.12**
- **ghcr.io/lambgeo/lambda-gdal:3.10-python3.13**

## Archived images

- **ghcr.io/lambgeo/lambda-gdal:3.8**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.9**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.10**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.11**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.12**
- **ghcr.io/lambgeo/lambda-gdal:3.8-python3.13**
- **ghcr.io/lambgeo/lambda-gdal:3.6**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.9**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.10**
- **ghcr.io/lambgeo/lambda-gdal:3.6-python3.11**

see: <https://github.com/lambgeo/docker-lambda/pkgs/container/lambda-gdal>

### Creating Lambda packages
## Creating Lambda packages

### Using

#### 1. Create Dockerfile

```Dockerfile
FROM ghcr.io/lambgeo/lambda-gdal:3.8 AS gdal
FROM ghcr.io/lambgeo/lambda-gdal:3.10 AS gdal

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

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

```Dockerfile
FROM ghcr.io/lambgeo/lambda-gdal:3.8-python3.10
Expand Down Expand Up @@ -129,16 +138,15 @@ Other variables:

Starting with gdal3.1 (PROJ 7.1), you can set `PROJ_NETWORK=ON` to use [remote grids](https://proj.org/usage/network.html).


# AWS Lambda Layers
## AWS Lambda Layers

| gdal | amazonlinux version | size (Mb) | unzipped size (Mb) | arn |
| ---- | ------------------- | --------- | ------------------ | ----------------------------------------------------------- |
| 3.8 | 4 | TBD | TBD | arn:aws:lambda:{REGION}:524387336408:layer:gdal38:{VERSION} |

see [/layer.json](/layer.json) for the list of arns

### Find the arn version
### Find the ARN version

```bash
cat layer.json| jq '.[] | select(.region == "us-west-2")'
Expand Down Expand Up @@ -278,3 +286,13 @@ package.zip
- **GDAL_DATA:** /opt/share/gdal
- **PROJ_LIB:** /opt/share/proj
- lambda handler: `handler.handler`

## Building locally for testing

To run the image build locally, execute the script `scripts/build.sh` with
three arguments of (1) the GDAL version, (2) the runtime platform, and (3)
the version of the runtime platform:

```commandline
./scripts/build.sh 3.10.2 python 3.13
```
6 changes: 3 additions & 3 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ RUN yum update -y && \
yum clean all && \
rm -rf /var/cache/yum /var/lib/yum/history

ENV PREFIX /opt
ENV PREFIX=/opt

WORKDIR /opt

ENV LD_LIBRARY_PATH $PREFIX/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH

# pkg-config
ENV PKGCONFIG_VERSION=0.29.2
Expand Down Expand Up @@ -404,7 +404,7 @@ RUN for i in $PREFIX/lib/*.so; do patchelf --force-rpath --set-rpath '$ORIGIN' $
# Build final image
FROM public.ecr.aws/lambda/provided:al2 AS runner

ENV PREFIX /opt
ENV PREFIX=/opt
COPY --from=builder /opt/lib/ $PREFIX/lib/
COPY --from=builder /opt/include/ $PREFIX/include/
COPY --from=builder /opt/share/ $PREFIX/share/
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/runtimes/nodejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ENV \
# When building rasterio, setup.py will get libs directoy from gdal-config
# $ gdal-config --libs
# -L/opt/lib -lgdal
ENV PREFIX /opt
ENV PREFIX=/opt

COPY --from=gdal /opt/lib/ $PREFIX/lib/
COPY --from=gdal /opt/include/ $PREFIX/include/
Expand Down
5 changes: 4 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash

set -Eeuo pipefail
# set -x # print each command before executing

GDAL_VERSION=$1
GDAL_VERSION_TAG=${GDAL_VERSION%.*}
Expand Down
1 change: 0 additions & 1 deletion scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"python3.12",
"python3.11",
"python3.10",
"python3.9",
"java21",
"java17",
"java11",
Expand Down
Loading