Skip to content
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

Update image to build for Python 3.8 #8

Merged
merged 8 commits into from
Sep 4, 2021
Merged
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
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM amazonlinux:2018.03
FROM amazon/aws-lambda-python:3.8

# Need to set "ulimit -n" to a small value to stop yum from hanging:
# https://bugzilla.redhat.com/show_bug.cgi?id=1715254#c1
RUN ulimit -n 1024 && yum -y update && yum -y install \
git \
gcc \
python36 \
python36-pip \
python36-devel \
jq \
nano \
unzip \
Expand All @@ -16,12 +13,11 @@ RUN ulimit -n 1024 && yum -y update && yum -y install \

COPY requirements.txt quilt/requirements.txt

RUN python3 -m pip install pip==18.1

# Requirements copied from lambda Python 3.6, but not in base image
# (Plus Cython which is a build-time requirement for numpy)
RUN python3 -m pip install -r quilt/requirements.txt

# Make it possible to build numpy:
# https://github.com/numpy/numpy/issues/14147
ENV CFLAGS=-std=c99

12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Build AWS Lambda deployment packages with Docker

## Update
Amazon now provides images for Lambda runtimes on Docker Hub.
See [amazon/aws-lambda-python](https://hub.docker.com/r/amazon/aws-lambda-python).

## Blog post (includes tips on reducing package size)

[An easier way to build AWS Lambda deployment packages — with Docker instead of EC2](https://blog.quiltdata.com/an-easier-way-to-build-lambda-deployment-packages-with-docker-instead-of-ec2-9050cd486ba8)
Expand All @@ -14,9 +18,13 @@ is clumsy
linked from [this AWS user guide](https://docs.aws.amazon.com/AmazonECR/latest/userguide/amazon_linux_container_image.html))

## [Tags](https://hub.docker.com/r/quiltdata/lambda/tags)
* `build` - introduced to build wheels per [#2](https://github.com/quiltdata/lambda/pull/2). In theory this should not affect how the environment functions, but in practice use image id `823205fae3ed` if you want to be as close to the official lambda environment as possible.
* `build` - introduced to build wheels per [#2](https://github.com/quiltdata/lambda/pull/2).
In theory this should not affect how the environment functions,
but in practice use image id `823205fae3ed`
if you want to be as close to the official lambda environment as possible.
On 9/1/21 the `build` tag has been updated to support the Python3.8 runtime (only).

## Example: Python 3.6 deployment package
## Example: Python 3.8 deployment package

```sh
docker pull quiltdata/lambda
Expand Down
20 changes: 10 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# from `pip freeze` under Python 3.6 lambda image 16-Apr-2020
boto3==1.12.22
botocore==1.15.22
Cython==0.29.21
docutils==0.15.2
jmespath==0.9.5
python-dateutil==2.8.1
s3transfer==0.3.3
six==1.14.0
urllib3==1.25.8
# from `pip freeze` under Python 3.8 lambda image 01-Sep-2021
boto3==1.17.100
botocore==1.20.100
Cython==0.29.24
jmespath==0.10.0
python-dateutil==2.8.2
s3transfer==0.4.2
six==1.16.0
urllib3==1.26.6