OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Utilizing Python script with large number of dependencies in a Lambda Function

  • Thread starter Thread starter Brian Perker
  • Start date Start date
B

Brian Perker

Guest
I am attempting to execute a program using an AWS Lambda function with layers and triggers in AWS GovCloud. However, I am facing a memory error during the process of uploading a ZIP file containing the Python environment with the necessary modules and imports.

Key Points:

Environment Setup: The Python environment file was created using Docker and then copied from the Docker image to my local machine. File Size Issue: The resulting file size of the environment exceeds the accepted limit for Lambda layers. Module Separation

Attempt: I tried to separate the required modules, but even with only OpenCV included, I still encountered memory issues. AWS GovCloud Constraints: Operating within AWS GovCloud adds complexity, as many Python imports are not pre-included. Challenge: Finding a solution to implement Lambda functions with complex programs and numerous dependencies in AWS GovCloud, given the constraints on file size and memory

Environment Creation:

Created the Python environment file using Docker. Copied the environment from the Docker image to my local machine.

File Size Issue:

The resulting file size of the environment exceeded the accepted limit for Lambda layers.

Module Separation Attempt:

Attempted to separate the required modules to reduce the file size. Created a ZIP file containing only the OpenCV module. Despite this effort, I still encountered memory issues during the upload. What I Expected:

Expectation:

Expected the ZIP file containing the Python environment and necessary modules to upload successfully to AWS Lambda layers without exceeding the size limit.

Function Execution:

Expected the Lambda function to execute the program correctly with all required dependencies in place.
<p>I am attempting to execute a program using an AWS Lambda function with layers and triggers in AWS GovCloud. However, I am facing a memory error during the process of uploading a ZIP file containing the Python environment with the necessary modules and imports.</p>
<p>Key Points:</p>
<p>Environment Setup: The Python environment file was created using Docker and then copied from the Docker image to my local machine.
File Size Issue: The resulting file size of the environment exceeds the accepted limit for Lambda layers.
Module Separation</p>
<p>Attempt: I tried to separate the required modules, but even with only OpenCV included, I still encountered memory issues.
AWS GovCloud Constraints: Operating within AWS GovCloud adds complexity, as many Python imports are not pre-included.
Challenge: Finding a solution to implement Lambda functions with complex programs and numerous dependencies in AWS GovCloud, given the constraints on file size and memory</p>
<p>Environment Creation:</p>
<p>Created the Python environment file using Docker.
Copied the environment from the Docker image to my local machine.</p>
<p>File Size Issue:</p>
<p>The resulting file size of the environment exceeded the accepted limit for Lambda layers.</p>
<p>Module Separation Attempt:</p>
<p>Attempted to separate the required modules to reduce the file size.
Created a ZIP file containing only the OpenCV module.
Despite this effort, I still encountered memory issues during the upload.
What I Expected:</p>
<p>Expectation:</p>
<p>Expected the ZIP file containing the Python environment and necessary modules to upload successfully to AWS Lambda layers without exceeding the size limit.</p>
<p>Function Execution:</p>
<p>Expected the Lambda function to execute the program correctly with all required dependencies in place.</p>
 

Latest posts

M
Replies
0
Views
1
Meliodas Dragon
M
Top