Skip to content

Instantly share code, notes, and snippets.

@LouisAmon
Created April 21, 2018 11:52
Show Gist options
  • Save LouisAmon/067273f53f62244e5b0cb4ba8b03ba88 to your computer and use it in GitHub Desktop.
Save LouisAmon/067273f53f62244e5b0cb4ba8b03ba88 to your computer and use it in GitHub Desktop.
Building an AWS Lambda package that includes `numpy`, `pandas` & `scipy`
# System dependencies
yum update -y
yum install -y \
binutils \
findutils \
python36
# Create directory for our lambda
mkdir build
pip install -t build numpy pandas scipy
# Check uncompressed file size
du -sh build
# Remove unessential information to lighten the build
find build -name "*.so"|xargs strip
# Check the uncompressed but trimmed size
du -sh build
# Create a zip
cd build && zip -r9 ../lambda_package.zip *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment