Skip to content

Commit 7db3fea

Browse files
Merge pull request #95 from developmentseed/develop
release 2.1.0
2 parents 3b222b5 + a5a5102 commit 7db3fea

File tree

12 files changed

+129
-42
lines changed

12 files changed

+129
-42
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
cd ..
5151
# deploy public Lambda layers
5252
pip install awscli
53-
for region in us-east-1 us-west-2 eu-central-1
53+
for region in us-east-1 us-west-2 eu-central-1 eu-west-2 eu-north-1
5454
do
5555
LVERSION="$(aws lambda publish-layer-version --region ${region} \
5656
--layer-name geolambda --license-info 'MIT' \

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
### Added
10+
- Added deployments to `eu-west-2` and `eu-north-1`
11+
12+
### Fixed
13+
- README updates regarding versions
14+
15+
### Changed
16+
- Keep symlinks when zipping, resulting in smaller deploy package
17+
- Python Lambda Layers no longer need the base GeoLambda layer in addition to the python layer
18+
- Manually compile sqlite3 used in Proj, GDAL, nghttp2
19+
- GDAL 3.2.1
20+
- Proj 7.2.1
21+
- GEOS 3.8.1
22+
- GeoTIFF 1.5.1
23+
- HDF4 4.2.15
24+
- HDF5 1.10.7
25+
- NetCDF 4.7.4
26+
- Nghttp2 1.41.0
27+
- OpenJPEG 2.4.0
28+
- libJPEG Turbo 2.4.0
29+
- Curl 7.73.0
30+
- Webp 1.1.0
31+
- Zstd 1.4.5
32+
- OpenSSL 1.1.1
33+
- In python layer:
34+
- Python 3.7.4 -> 3.7.9
35+
- rasterio 1.1.0 -> 1.2.0
36+
- shapely 1.6.4.post2 -> 1.7.1
37+
- pyproj 2.4.0 -> 3.0.0.post1
38+
39+
### Removed
40+
- GDAL Elasticsearch driver
41+
942

1043
## [v2.0.0] - 2019-10-25
1144

@@ -85,6 +118,7 @@ Package Versions
85118
- GDAL_VERSION=2.3.1
86119

87120
[Unreleased]: https://github.com/sat-utils/sat-stac/compare/master...develop
121+
[v2.1.0]: https://github.com/developmentseed/geolambda/compare/2.0.0...2.1.0
88122
[v2.0.0]: https://github.com/developmentseed/geolambda/compare/1.2.0...2.0.0
89123
[v1.2.0]: https://github.com/developmentseed/geolambda/compare/1.1.0...1.2.0
90124
[v1.1.0]: https://github.com/developmentseed/geolambda/compare/1.0.0...1.1.0

Dockerfile

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ LABEL authors="Matthew Hanson <matt.a.hanson@gmail.com>"
66
# install system libraries
77
RUN \
88
yum makecache fast; \
9-
yum install -y wget libpng-devel nasm; \
9+
yum install -y wget libpng-devel nasm rsync; \
1010
yum install -y bash-completion --enablerepo=epel; \
1111
yum clean all; \
1212
yum autoremove
1313

1414
# versions of packages
1515
ENV \
16-
GDAL_VERSION=3.0.1 \
17-
PROJ_VERSION=6.2.0 \
18-
GEOS_VERSION=3.8.0 \
19-
GEOTIFF_VERSION=1.5.1 \
20-
HDF4_VERSION=4.2.14 \
21-
HDF5_VERSION=1.10.5 \
22-
NETCDF_VERSION=4.7.1 \
23-
NGHTTP2_VERSION=1.39.2 \
24-
OPENJPEG_VERSION=2.3.1 \
25-
CURL_VERSION=7.66.0 \
26-
LIBJPEG_TURBO_VERSION=2.0.3 \
16+
GDAL_VERSION=3.2.1 \
17+
PROJ_VERSION=7.2.1 \
18+
GEOS_VERSION=3.8.1 \
19+
GEOTIFF_VERSION=1.6.0 \
20+
HDF4_VERSION=4.2.15 \
21+
HDF5_VERSION=1.10.7 \
22+
NETCDF_VERSION=4.7.4 \
23+
NGHTTP2_VERSION=1.41.0 \
24+
OPENJPEG_VERSION=2.4.0 \
25+
LIBJPEG_TURBO_VERSION=2.0.6 \
26+
CURL_VERSION=7.73.0 \
2727
PKGCONFIG_VERSION=0.29.2 \
2828
SZIP_VERSION=2.1.1 \
29-
WEBP_VERSION=1.0.3 \
30-
ZSTD_VERSION=1.4.3 \
31-
OPENSSL_VERSION=1.0.2
29+
WEBP_VERSION=1.1.0 \
30+
ZSTD_VERSION=1.4.5 \
31+
OPENSSL_VERSION=1.1.1
3232

3333
# Paths to things
3434
ENV \
@@ -37,9 +37,9 @@ ENV \
3737
PREFIX=/usr/local \
3838
GDAL_CONFIG=/usr/local/bin/gdal-config \
3939
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 \
40-
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:/usr/lib64/pkgconfig \
41-
GDAL_DATA=${PREFIX}/share/gdal \
42-
PROJ_LIB=${PREFIX}/share/proj
40+
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig \
41+
GDAL_DATA=/usr/local/share/gdal \
42+
PROJ_LIB=/usr/local/share/proj
4343

4444
# switch to a build directory
4545
WORKDIR /build
@@ -53,14 +53,25 @@ RUN \
5353
make -j ${NPROC} install; \
5454
cd ../; rm -rf pkg-config
5555

56+
# sqlite3 (required by proj)
57+
RUN \
58+
mkdir sqlite3; \
59+
wget -qO- https://www.sqlite.org/2020/sqlite-autoconf-3330000.tar.gz \
60+
| tar xvz -C sqlite3 --strip-components=1; cd sqlite3; \
61+
./configure --prefix=$PREFIX; \
62+
make; make install; \
63+
cd ../; rm -rf sqlite3;
64+
5665
# proj
5766
RUN \
5867
mkdir proj; \
59-
wget -qO- http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz | tar xvz -C proj --strip-components=1; cd proj; \
60-
./configure --prefix=$PREFIX; \
68+
wget -qO- http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz \
69+
| tar xvz -C proj --strip-components=1; cd proj; \
70+
SQLITE3_LIBS="=L$PREFIX/lib -lsqlite3" SQLITE3_INCLUDE_DIRS=$PREFIX/include/proj ./configure --prefix=$PREFIX; \
6171
make -j ${NPROC} install; \
6272
cd ..; rm -rf proj
6373

74+
6475
# nghttp2
6576
RUN \
6677
mkdir nghttp2; \
@@ -194,9 +205,11 @@ RUN \
194205
--with-zstd=${PREFIX} \
195206
--with-jpeg=${PREFIX} \
196207
--with-threads=yes \
208+
--with-sqlite3=$PREFIX \
197209
--with-curl=${PREFIX}/bin/curl-config \
198210
--without-python \
199211
--without-libtool \
212+
--disable-driver-elastic \
200213
--with-geos=$PREFIX/bin/geos-config \
201214
--with-hide-internal-symbols=yes \
202215
CFLAGS="-O2 -Os" CXXFLAGS="-O2 -Os" \

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# GeoLambda: geospatial AWS Lambda Layer
22

3-
The GeoLambda project provides public Docker images and AWS Lambda Layers containing common geospatial native libraries. GeoLambda contains the libraries PROJ.5, GEOS, GeoTIFF, HDF4/5, SZIP, NetCDF, OpenJPEG, WEBP, ZSTD, and GDAL. For some applications you may wish to minimize the size of the libraries by excluding unused libraries, or you may wish to add other libraries. In this case this repository can be used as a template to create your own Docker image or Lambda Layer following the instructions in this README.
3+
The GeoLambda project provides public Docker images and AWS Lambda Layers containing common geospatial native libraries. GeoLambda contains the libraries for GDAL, Proj, GEOS, GeoTIFF, HDF4/5, SZIP, NetCDF, OpenJPEG, WEBP, ZSTD, and others. For some applications you may wish to minimize the size of the libraries by excluding unused libraries, or you may wish to add other libraries. In this case this repository can be used as a template to create your own Docker image or Lambda Layer following the instructions in this README.
44

5-
This repository also contains additional images and layers for specific runtimes. Using them as a Layer assumes the use of the basee GeoLambda layer.
5+
This repository also contains additional images and layers for specific runtimes. Using them as a Layer assumes the use of the base GeoLambda layer.
66

77
- [Python](python/README.md)
88

@@ -16,6 +16,7 @@ While GeoLambda was initially intended for AWS Lambda it is also useful as a bas
1616
| 1.1.0 | 2.4.1 | |
1717
| 1.2.0 | 2.4.2 | Separate Python (3.7.4) image and Lambda Layer added |
1818
| 2.0.0 | 3.0.1 | libgeotiff 1.5.1, proj 6.2.0 |
19+
| 2.1.0 | 3.2.1 | libgeotiff 1.6.0, proj 7.2.1, openjpeg 2.4.0, Python layer 3.7.9 |
1920

2021
#### Environment variables
2122

@@ -26,7 +27,30 @@ When using GeoLambda some environment variables need to be set. These are set in
2627

2728
### Lambda Layers
2829

29-
If you just wish to use the publicly available Lambda layers you will need the ARN for the layer in the same region as your Lambda function. Currently, GeoLambda layers are available in `us-east-1`, `us-west-2`, and `eu-central-1`. If you want to use it in another region please file an issue or you can also create your own layer using this repository (see instructions below on 'Create a new version').
30+
If you just wish to use the publicly available Lambda layers you will need the ARN for the layer in the same region as your Lambda function. Currently, the latest GeoLambda layers are deployed in `us-east-1`, `us-west-2`, `eu-central-1`, `eu-west-2`, and `eu-north-1`. If you want to use it in another region please file an issue or you can also create your own layer using this repository (see instructions below on 'Create a new version').
31+
32+
#### v2.1.0
33+
34+
| Region | ARN |
35+
| ------ | --- |
36+
| us-east-1 | arn:aws:lambda:us-east-1:552188055668:layer:geolambda:4 |
37+
| us-west-2 | arn:aws:lambda:us-west-2:552188055668:layer:geolambda:4 |
38+
| eu-central-1 | arn:aws:lambda:eu-central-1:552188055668:layer:geolambda:4 |
39+
| eu-west-2 | |
40+
| eu-north-1 | |
41+
42+
#### v2.1.0-python
43+
44+
See the [GeoLambda Python README](python/README.md). The Python Lambda Layer includes the libraries `numpy`, `rasterio`, `GDAL`, `pyproj`, and `shapely`, plus everything in the standard GeoLambda layer. Note this is a change from v2.0.0 where both Layers needed to be included in a Lambda.
45+
46+
| Region | ARN |
47+
| ------ | --- |
48+
| us-east-1 | arn:aws:lambda:us-east-1:552188055668:layer:geolambda-python:3 |
49+
| us-west-2 | arn:aws:lambda:us-west-2:552188055668:layer:geolambda-python:3 |
50+
| eu-central-1 | arn:aws:lambda:eu-central-1:552188055668:layer:geolambda-python:3 |
51+
| eu-west-2 | |
52+
| eu-north-1 | |
53+
3054

3155
#### v2.0.0
3256

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

bin/package.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# directory used for deployment
44
export DEPLOY_DIR=lambda
55

6-
echo Creating deploy package
7-
86
# make deployment directory and add lambda handler
97
mkdir -p $DEPLOY_DIR/lib
108

@@ -21,4 +19,4 @@ rsync -ax $PREFIX/share/proj $DEPLOY_DIR/share/
2119

2220
# zip up deploy package
2321
cd $DEPLOY_DIR
24-
zip -ruq ../lambda-deploy.zip ./
22+
zip --symlinks -ruq ../lambda-deploy.zip ./

build-and-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
VERSION=$(cat VERSION)
4+
PYVERSION=$(cat python/PYVERSION)
45

56
docker build . -t developmentseed/geolambda:${VERSION}
67
docker run --rm -v $PWD:/home/geolambda -it developmentseed/geolambda:${VERSION} package.sh
@@ -9,4 +10,5 @@ cd python
910
docker build . --build-arg VERSION=${VERSION} -t developmentseed/geolambda:${VERSION}-python
1011
docker run -v ${PWD}:/home/geolambda -t developmentseed/geolambda:${VERSION}-python package-python.sh
1112

12-
docker run --rm -v ${PWD}/lambda:/var/task -v ${PWD}/../lambda:/opt lambci/lambda:python3.7 lambda_function.lambda_handler '{}'
13+
docker run -e GDAL_DATA=/opt/share/gdal -e PROJ_LIB=/opt/share/proj \
14+
--rm -v ${PWD}/lambda:/var/task lambci/lambda:python3.7 lambda_function.lambda_handler '{}'

python/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG VERSION=1.2.0
1+
ARG VERSION=2.1.0
22
FROM developmentseed/geolambda:${VERSION}
33

44
LABEL maintainer="Development Seed <info@developmentseed.org>"
55
LABEL authors="Matthew Hanson <matt.a.hanson@gmail.com>"
66

7-
ARG PYVERSION=3.7.4
7+
ARG PYVERSION=3.7.9
88

99
# install Python
1010
ENV \

python/PYVERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.7.9

python/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ An example Lambda handler is located at [lambda/lambda_function.py](lambda/lambd
1919
Now, use the [Dockerfile](Dockerfile) can be used to create a new Docker image based on any version of GeoLambda with any version of Python by providing the versions as build arguments to `docker run`. This will install the specified version of Python along with any Python packages provided in [requirements.txt](requirements.txt).
2020

2121
```
22-
$ VERSION=1.2.0
23-
$ docker build . --build-arg VERSION=${VERSION} --build-arg PYVERSION=3.7.4 -t <myimage>:latest
22+
$ VERSION=2.1.0
23+
$ docker build . --build-arg VERSION=${VERSION} --build-arg PYVERSION=3.7.9 -t <myimage>:latest
2424
```
2525

26-
If not provided, `VERSION` (the version of GeoLambda to use) will default to `latest` and `PYVERSION` (Python version) will default to `3.7.4`.
26+
If not provided, `VERSION` (the version of GeoLambda to use) will default to `latest` and `PYVERSION` (Python version) will default to `3.7.9`.
2727

2828
**4. Set up development environment and lambda layer zip file**
2929

@@ -39,7 +39,7 @@ This will create geolambda base layer (`lambda-deploy.zip`) file and `/geolambda
3939
$ docker run --rm -v $PWD:/home/geolambda -it developmentseed/geolambda:${VERSION} package.sh
4040
```
4141

42-
This will copy site-packages in /geolambda/python/lambda directory needed for development. Also, it will create a `lambda-layer-deploy.zip` file in the current directory.
42+
This will copy site-packages in /geolambda/python/lambda directory needed for development. Also, it will create a `lambda-deploy.zip` file in the current directory.
4343
Contents of the zip file are following AWS conventions: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path
4444

4545
```
@@ -55,7 +55,8 @@ You can use the [LambCI Docker images](https://github.com/lambci/docker-lambda)
5555
```
5656
# current dir: geolambda/python
5757
58-
$ docker run --rm -v ${PWD}/lambda:/var/task -v ${PWD}/../lambda:/opt lambci/lambda:python3.7 lambda_function.lambda_handler '{}'
58+
$ docker run -e GDAL_DATA=/opt/share/gdal -e PROJ_LIB=/opt/share/proj \
59+
--rm -v ${PWD}/lambda:/var/task lambci/lambda:python3.7 lambda_function.lambda_handler '{}'
5960
```
6061

6162
The last argument is a JSON string that will be passed as the event payload to the handler function.
@@ -68,7 +69,7 @@ Deploy the Lambda layer by using AWS CLI.
6869
$ aws lambda publish-layer-version \
6970
--layer-name geolambda-python \
7071
--description "Python bindings for GDAL" \
71-
--zip-file fileb://lambda-layer-deploy.zip
72+
--zip-file fileb://lambda-deploy.zip
7273
```
7374

7475
### Pre-built images

0 commit comments

Comments
 (0)