Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Numpy and pandas not usable in Lambda #2

@ebasanez

Description

@ebasanez

As AWS Lambda requires numpy and pandas are compiled in AWS compatible Linux images, and this action uses default GitHub action Ubuntu Linux image, adding numpy and pandas to requirements.txt results in non-compatible versions of those libraries, and the subsequent errors when executing the Lambda code.

This should usually be worked arround by removing both numpy and pandas form requirements.txt of the project and creating and applying an additional layer with compatible versions of the lilbraries. In this case this is not a valid solution, as github action method update_function_layers() only add the newly created layer to the new Lambda function version.

There are several ways to solve this:

  • Execute github action in on AWS compatible Linux image (like lambci/lambda:python-build3.8), by defining a job and runs-on.
  • Allow an optional parameter INPUT_LAMBDA_ADDITIONAL_LAYERS to be used in method update_function_layers() this way:

update_function_layers(){ echo "Using the layer in the function..." aws lambda update-function-configuration --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --layers "${INPUT_LAMBDA_LAYER_ARN}:${LAYER_VERSION} ${INPUT_LAMBDA_ADDITIONAL_LAYERS }" }

  • In the former method, obtain LATEST Lambda function version layers and add those (all but the newly created one) to the new Lambda function version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions