Skip to content

Commit

Permalink
update for gdal 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Nov 28, 2023
1 parent a967c8f commit 5822a4a
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.ref, 'tags') && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Github
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -111,15 +111,15 @@ jobs:
-v ${{ github.workspace }}:/local \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }} \
/local/scripts/create-layer.sh
python scripts/deploy.py ${{ env.GDAL_VERSION }} --deploy
python scripts/deploy.py ${{ env.GDAL_VERSION_TAG }} --deploy
- name: Build Runtime and Push
run: |
runtimes='3.9 3.10 3.11'
for runtime in ${runtimes}; do
docker build \
--platform=linux/amd64 \
--build-arg GDAL_VERSION=${{ env.GDAL_VERSION }} \
--build-arg GDAL_VERSION=${{ env.GDAL_VERSION_TAG }} \
--build-arg RUNTIME_VERSION=${runtime} \
-f dockerfiles/runtimes/python \
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ env.GDAL_VERSION_TAG }}-python${runtime} .
Expand Down
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

## Next

- add `yum update` and `yum clean all` to base image (https://github.com/lambgeo/docker-lambda/pull/64)

- add `yum update` and `yum clean all` to base image (author @philvarner, https://github.com/lambgeo/docker-lambda/pull/64)
- update to GDAL 3.8.0 (author @philvarner, https://github.com/lambgeo/docker-lambda/pull/65)

## 2023-10-23

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



35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

# GDAL-based Docker Image for AWS Lambda

<!-- 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>
</p>
<p align="center">
<em>AWS Lambda (Amazonlinux) like Docker images with GDAL.</em>
<b>Amazonlinux Docker images and AWS Lambda layers with GDAL.</b>
</p>
<p align="center">
<a href="https://github.com/lambgeo/docker-lambda/actions?query=workflow%3ACI" target="_blank">
Expand All @@ -15,30 +14,36 @@
</p>
<!-- markdownlint-enable -->

## Docker Images
# Docker Images

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

- GDAL 3.6
- **ghcr.io/lambgeo/lambda-gdal:3.6** (Apr 2023)
- GDAL 3.8.0
- **ghcr.io/lambgeo/lambda-gdal:3.8** (Nov 2023)

Runtimes 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**

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.6 as gdal
FROM ghcr.io/lambgeo/lambda-gdal:3.8 as gdal

# We use the official AWS Lambda image
FROM public.ecr.aws/lambda/{RUNTIME: python|node|go...}:{RUNTIME version}
Expand Down Expand Up @@ -67,7 +72,7 @@ RUN cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *
If you are working with **python3.9|3.10|3.11**, you can use lambgeo pre-build docker images:

```Dockerfile
FROM ghcr.io/lambgeo/lambda-gdal:3.6-python3.10
FROM ghcr.io/lambgeo/lambda-gdal:3.8-python3.10

ENV PACKAGE_PREFIX=/var/task

Expand Down Expand Up @@ -124,13 +129,12 @@ 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.6 | 2 | 26.8 | 76.1 | arn:aws:lambda:{REGION}:524387336408:layer:gdal36:{VERSION} |
| 3.8 | 1 | TBD | TBD | arn:aws:lambda:{REGION}:524387336408:layer:gdal38:{VERSION} |

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

Expand All @@ -143,7 +147,7 @@ cat layer.json| jq '.[] | select(.region == "us-west-2")'
"layers": [
{
"name": "gdal36",
"arn": "arn:aws:lambda:us-west-2:524387336408:layer:gdal36:2",
"arn": "arn:aws:lambda:us-west-2:524387336408:layer:gdal38:1",
"version": 2
}
]
Expand All @@ -154,6 +158,7 @@ cat layer.json| jq '.[] | select(.region == "us-west-2")'

| gdal | amazonlinux version | size (Mb) | unzipped size (Mb) | arn |
| ---- | ------------------- | --------- | ------------------ | --------------------------------------------------------------- |
| 3.6 | 2 | 26.8 | 76.1 | arn:aws:lambda:{REGION}:524387336408:layer:gdal36:{VERSION} |
| 3.5 | 2 | 30.5 | 73.4 | arn:aws:lambda:{REGION}:524387336408:layer:gdal35:{VERSION} |
| 3.3 | 2 | 27.7 | 67.3 | arn:aws:lambda:{REGION}:524387336408:layer:gdal33-al2:{VERSION} |
| 3.2 | 2 | 26.7 | 64.6 | arn:aws:lambda:{REGION}:524387336408:layer:gdal32-al2:{VERSION} |
Expand Down Expand Up @@ -200,7 +205,7 @@ package.zip

**AWS Lambda Config:**

- arn: `arn:aws:lambda:us-east-1:524387336408:layer:gdal36:1` (example)
- arn: `arn:aws:lambda:us-east-1:524387336408:layer:gdal38:1` (example)
- env:
- **GDAL_DATA:** /opt/share/gdal
- **PROJ_LIB:** /opt/share/proj
Expand All @@ -213,7 +218,7 @@ If your lambda handler needs more dependencies you'll have to use the exact same
##### Create a Dockerfile

```dockerfile
FROM ghcr.io/lambgeo/lambda-gdal:3.6 as gdal
FROM ghcr.io/lambgeo/lambda-gdal:3.8 as gdal

# This example assume that you are creating a lambda package for python 3.10
FROM public.ecr.aws/lambda/python:3.10
Expand Down Expand Up @@ -268,7 +273,7 @@ package.zip

**AWS Lambda Config:**

- arn: `arn:aws:lambda:us-east-1:524387336408:layer:gdal36:1` (example)
- arn: `arn:aws:lambda:us-east-1:524387336408:layer:gdal38:1` (example)
- env:
- **GDAL_DATA:** /opt/share/gdal
- **PROJ_LIB:** /opt/share/proj
Expand Down
82 changes: 81 additions & 1 deletion archived_layers.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
},
{
"name": "gdal35",
"arn": "arn:aws:lambda:ap-northeast-1:524387336408:layer:gdal35:2",
"arn": "arn:aws:lambda:ap-northeast-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ap-northeast-1:524387336408:layer:gdal36:2",
"version": 2
}
]
Expand Down Expand Up @@ -86,6 +91,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:ap-northeast-2:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ap-northeast-2:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -131,6 +141,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:ap-south-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ap-south-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -176,6 +191,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:ap-southeast-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ap-southeast-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -221,6 +241,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:ap-southeast-2:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ap-southeast-2:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -266,6 +291,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:ca-central-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:ca-central-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -311,6 +341,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:eu-central-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:eu-central-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -356,6 +391,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:eu-north-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:eu-north-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -401,6 +441,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:eu-west-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:eu-west-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -446,6 +491,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:eu-west-2:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:eu-west-2:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -491,6 +541,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:eu-west-3:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:eu-west-3:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -536,6 +591,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:sa-east-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:sa-east-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -581,6 +641,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:us-east-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -626,6 +691,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:us-east-2:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:us-east-2:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -671,6 +741,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:us-west-1:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:us-west-1:524387336408:layer:gdal36:2",
"version": 2
}
]
},
Expand Down Expand Up @@ -716,6 +791,11 @@
"name": "gdal35",
"arn": "arn:aws:lambda:us-west-2:524387336408:layer:gdal35:3",
"version": 3
},
{
"name": "gdal36",
"arn": "arn:aws:lambda:us-west-2:524387336408:layer:gdal36:2",
"version": 2
}
]
}
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"python3.8",
"python3.9",
"python3.10",
"python3.11",
"dotnet6",
"dotnetcore3.1",
"ruby2.7",
Expand Down
3 changes: 2 additions & 1 deletion scripts/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
# "gdal32-al2", # archive
# "gdal33-al2", # archive
# "gdal35", # archive
"gdal36",
# "gdal36", # archive
"gdal38",
]


Expand Down

0 comments on commit 5822a4a

Please sign in to comment.