Skip to content
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
40 changes: 40 additions & 0 deletions terraform/layers/python3.10/rasterio_no_numpy_1.3.10/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/numpy/*
python/numpy.libs/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/regex/test/*
python/s3transfer/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-dotnet/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-golang/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-maven/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs6/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-python/{{cookiecutter.project_name}}/tests/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-ruby/*
python/setuptools/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/bash-completion/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
23 changes: 23 additions & 0 deletions terraform/layers/python3.10/rasterio_no_numpy_1.3.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM --platform=linux/amd64 ghcr.io/lambgeo/lambda-gdal:3.8-python3.10

ENV NUMPY_VERSION=1.26.4
ENV RASTERIO_VERSION=1.3.10

WORKDIR /opt
RUN mkdir -p python

# Install rasterio from source because the binary pulls in its own GDAL
# subset, and we already have it. Otherwise install binary packages,
# because they tend to be smaller than those you build yourself.
RUN pip install NumPy==${NUMPY_VERSION} rasterio==${RASTERIO_VERSION} --no-binary rasterio -t python

# Reduce size of the C libs
# TODO: Try stripping bin as well?
RUN find lib -name \*.so\* -exec strip {} \;

# Compress all files except those listed in .lambdaignore
RUN yum install -y zip
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -r9q layer.zip python -x && \
cat .lambdaignore | xargs zip -r9q --symlinks layer.zip lib/*.so* share -x && \
zip -r9q --symlinks layer.zip bin/gdal* bin/ogr* bin/geos* bin/nearblack
37 changes: 37 additions & 0 deletions terraform/layers/python3.13/geopandas_0.14.4/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/numpy/*
python/numpy.libs/*
python/pandas/*
python/pandas.libs/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/pytz/*
python/regex/test/*
python/s3transfer/*
python/setuptools/*
python/shapely/*
python/Shapely.libs/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/bash-completion/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
31 changes: 31 additions & 0 deletions terraform/layers/python3.13/geopandas_0.14.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM public.ecr.aws/lambda/python:3.13

ENV NUMPY_VERSION="2.3.3"
ENV SHAPELY_VERSION="2.1.2"
ENV PANDAS_VERSION="2.3.3"
ENV GEOPANDAS_VERSION="0.14.4"

SHELL ["/bin/bash", "-c"]

WORKDIR /opt
RUN mkdir -p python

RUN dnf update -y && \
dnf install -y zip findutils

RUN pip install \
"numpy==${NUMPY_VERSION}" \
"shapely==${SHAPELY_VERSION}" \
"pandas==${PANDAS_VERSION}" \
"geopandas==${GEOPANDAS_VERSION}" \
-t python

# Precompile all python packages and remove .py files
RUN python -m compileall .
RUN find python/ -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-313//'); cp $f $n; done;
RUN find python/ -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
RUN find python/ -type f -a -name '*.py' -print0 | xargs -0 rm -f

# Compress all source codes except files listed in .lambdaignore
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -9qyr layer.zip python -x
37 changes: 37 additions & 0 deletions terraform/layers/python3.13/geopandas_1.1.2/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/numpy/*
python/numpy.libs/*
python/pandas/*
python/pandas.libs/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/pytz/*
python/regex/test/*
python/s3transfer/*
python/setuptools/*
python/shapely/*
python/Shapely.libs/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/bash-completion/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
31 changes: 31 additions & 0 deletions terraform/layers/python3.13/geopandas_1.1.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM public.ecr.aws/lambda/python:3.13

ENV NUMPY_VERSION="2.3.5"
ENV SHAPELY_VERSION="2.1.2"
ENV PANDAS_VERSION="2.3.3"
ENV GEOPANDAS_VERSION="1.1.2"

SHELL ["/bin/bash", "-c"]

WORKDIR /opt
RUN mkdir -p python

RUN dnf update -y && \
dnf install -y zip findutils

RUN pip install \
"numpy==${NUMPY_VERSION}" \
"shapely==${SHAPELY_VERSION}" \
"pandas==${PANDAS_VERSION}" \
"geopandas==${GEOPANDAS_VERSION}" \
-t python

# Precompile all python packages and remove .py files
RUN python -m compileall .
RUN find python/ -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-313//'); cp $f $n; done;
RUN find python/ -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
RUN find python/ -type f -a -name '*.py' -print0 | xargs -0 rm -f

# Compress all source codes except files listed in .lambdaignore
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -9qyr layer.zip python -x
37 changes: 37 additions & 0 deletions terraform/layers/python3.13/mercantile_1.2.1/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/regex/test/*
python/s3transfer/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-dotnet/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-golang/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-maven/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs6/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-python/{{cookiecutter.project_name}}/tests/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-ruby/*
python/setuptools/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
23 changes: 23 additions & 0 deletions terraform/layers/python3.13/mercantile_1.2.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM public.ecr.aws/lambda/python:3.13

ENV MERCANTILE_VERSION=1.2.1

SHELL ["/bin/bash", "-c"]

WORKDIR /opt
RUN mkdir -p python

RUN dnf update -y && \
dnf install -y zip findutils

RUN pip install mercantile==${MERCANTILE_VERSION} -t python

# Precompile all python packages and remove .py files
RUN python -m compileall .
RUN find python/ -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-313//'); cp $f $n; done;
RUN find python/ -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
RUN find python/ -type f -a -name '*.py' -print0 | xargs -0 rm -f

# Compress all source codes except files listed in .lambdaignore
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -9qyr layer.zip python -x
29 changes: 29 additions & 0 deletions terraform/layers/python3.13/numpy_2.3.5/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/regex/test/*
python/s3transfer/*
python/setuptools/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
23 changes: 23 additions & 0 deletions terraform/layers/python3.13/numpy_2.3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM public.ecr.aws/lambda/python:3.13

ENV NUMPY_VERSION="2.3.5"

SHELL ["/bin/bash", "-c"]

WORKDIR /opt
RUN mkdir -p python

RUN dnf update -y && \
dnf install -y zip findutils

RUN pip install "numpy==${NUMPY_VERSION}" -t python

# Precompile all python packages and remove .py files
RUN python -m compileall .
RUN find python/ -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-313//'); cp $f $n; done;
RUN find python/ -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
RUN find python/ -type f -a -name '*.py' -print0 | xargs -0 rm -f

# Compress all source codes except files listed in .lambdaignore
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -9qyr layer.zip python -x
39 changes: 39 additions & 0 deletions terraform/layers/python3.13/pandas_2.3.3/.lambdaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
*-info/*
*/tests/*
python/awscli/examples/*
python/boto3/*
python/botocore/*
python/dateutil/*
python/docker/*
python/docutils/*
python/easy_install/*
python/future/backports/test/*
python/future/moves/test/*
python/future/tests/*
python/jmespath/*
python/jsonschema/tests/*
python/numpy/*
python/numpy.libs/*
python/past/tests/*
python/pip/*
python/pkg_resources/*
python/regex/test/*
python/s3transfer/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-dotnet/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-golang/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-gradle/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-java-maven/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs6/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-python/{{cookiecutter.project_name}}/tests/*
python/samcli/local/init/templates/cookiecutter-aws-sam-hello-ruby/*
python/setuptools/*
python/tzlocal/test_data/*
python/urllib3/*
python/websocket/tests/*
python/wheel/*
share/cryptopp/*
share/doc/*
share/gtk-doc/*
share/libxml2-2.9.10/*
share/man/*
24 changes: 24 additions & 0 deletions terraform/layers/python3.13/pandas_2.3.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM public.ecr.aws/lambda/python:3.13

ENV NUMPY_VERSION="2.3.5"
ENV PANDAS_VERSION="2.3.3"

SHELL ["/bin/bash", "-c"]

WORKDIR /opt
RUN mkdir -p python

RUN dnf update -y && \
dnf install -y zip findutils

RUN pip install "numpy==${NUMPY_VERSION}" "pandas==${PANDAS_VERSION}" -t python

# Precompile all python packages and remove .py files
RUN python -m compileall .
RUN find python/ -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-313//'); cp $f $n; done;
RUN find python/ -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
RUN find python/ -type f -a -name '*.py' -print0 | xargs -0 rm -f

# Compress all source codes except files listed in .lambdaignore
COPY .lambdaignore .
RUN cat .lambdaignore | xargs zip -9qyr layer.zip python -x
Loading