Created
April 21, 2018 11:52
-
-
Save LouisAmon/067273f53f62244e5b0cb4ba8b03ba88 to your computer and use it in GitHub Desktop.
Building an AWS Lambda package that includes `numpy`, `pandas` & `scipy`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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