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

Building lambda layers with ./build-lambda-layer.sh results in wrong dependencies #26

Open
joshua-haunty opened this issue Oct 18, 2023 · 0 comments

Comments

@joshua-haunty
Copy link

joshua-haunty commented Oct 18, 2023

Hello. I am working on deploying a new lambda layer for the PluginHelper and wanted to deploy just the lambda layers using cdk deploy in the source/shared/infrastructure folder. I am wondering if I am misinterpreting the usage of the ./build-lambda-layer.sh script but found the below issue after using it.

Expected Behavior

Running the ./build-lambda-layer.sh script and copying the MediaReplayEnginePluginHelper zip file created in the lambda_layer_factory folder into source/layers/MediaReplayEnginePluginHelper followed by a cdk deploy in source/shared/infrastructure should result in a working PluginHelper lambda layer pushed to s3 that can be attached to all necessary orchestration plugins / core lambdas.

Actual Behavior

Running the ./build-lambda-layer.sh script and copying the MediaReplayEnginePluginHelper zip file created in the lambda_layer_factory folder into source/layers/MediaReplayEnginePluginHelper followed by a cdk deploy in source/shared/infrastructure pushes a layer to s3 but packages the wrong urllib3 dependency (correctly defined as 'urllib3<2' in setup.py for source/lib/MediaReplaEnginePluginHelper/setup.py) in PluginHelper causing lambda failures.

Steps to Reproduce the Problem

  1. Run ./build-lambda-layer.sh
  2. Copy zips into respective layers/{layer_name} folder
  3. Deploy source/shared/infrastructure via cdk deploy
  4. Create new lambda layer via console and use s3 uri for PluginHelper zip file
  5. Run an event through MRE Orchestration
  6. See errors in "ProbeVideo" lambda stating { "errorMessage": "Unable to import module 'lambda_function': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips [MediaReplayEnginePluginHelper - Good.zip](https://github.com/awslabs/aws-media-replay-engine/files/13032682/MediaReplayEnginePluginHelper.-.Good.zip) 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168", "errorType": "Runtime.ImportModuleError", "stackTrace": [] }

Attachments:

Two zip files are attached showing the layer built via a full deploy using ./build-and-deploy.sh showing the urllib dependency issue.
MediaReplayEnginePluginHelper - Good.zip
MediaReplayEnginePluginHelper - Bad.zip

Specifications

  • Version: 2.7.0
  • Deployment platform: Cloud9
  • Special notes: I am testing some changes to the core so the "Good" zip will not match what is deployed in 2.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant