From 30645fadd2f3e8ae49c682a3f35f51bc63e77d68 Mon Sep 17 00:00:00 2001 From: Rhett Reisman Date: Sat, 27 Jul 2024 13:11:25 -0500 Subject: [PATCH] Update release workflow --- .github/workflows/release-lambda.yml | 1 + Dockerfile | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-lambda.yml b/.github/workflows/release-lambda.yml index 6d13ad3..6621346 100644 --- a/.github/workflows/release-lambda.yml +++ b/.github/workflows/release-lambda.yml @@ -29,6 +29,7 @@ jobs: -f Dockerfile . docker create --name layer_builder lambda-layer-builder:${{ matrix.architecture }} docker cp layer_builder:/tmp/layer.zip layer-${{ matrix.architecture }}.zip + unzip -l layer-${{ matrix.architecture }}.zip | grep -i cffi - name: Get Release id: get_release diff --git a/Dockerfile b/Dockerfile index d21de93..a33b4f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,26 +4,24 @@ FROM public.ecr.aws/lambda/python:3.9 # Set up the work directory WORKDIR /var/task -# Install zip -RUN yum install -y zip - # Copy your application code and requirements.txt into the Docker image COPY . . # Install dependencies and create the layer -RUN pip install --upgrade pip setuptools wheel && \ +RUN yum install -y zip && \ + pip install --upgrade pip setuptools wheel && \ pip install -r requirements.txt && \ pip install . && \ mkdir -p /tmp/python && \ pip install \ - --platform manylinux2014_x86_64 \ + --platform manylinux2014_$(uname -m) \ --implementation cp \ --python-version 3.9 \ --only-binary=:all: --upgrade \ -r requirements.txt -t /tmp/python && \ pip install . -t /tmp/python && \ cd /tmp/python && \ - zip -r9 /tmp/layer.zip . && \ + zip -r9 /tmp/layer.zip . -x '*.pyc' '*.pyo' && \ cd /var/task # Copy the layer.zip to a known location