-
Notifications
You must be signed in to change notification settings - Fork 43
aws build deployment package
KimJeongChul edited this page Apr 24, 2019
·
1 revision
- Started t2.micro EC2 instance
- Tried the commands
sudo yum -y update
sudo yum -y upgrade
sudo yum -y groupinstall "Development Tools"
sudo yum -y install blas --enablerepo=epel
sudo yum -y install lapack --enablerepo=epel
sudo yum -y install Cython --enablerepo=epel
sudo yum install python27-devel python27-pip gcc
- Created the virtual environment:
virtualenv ~/env
source ~/env/bin/activate
- Installed the packages:
pip install [LIBRARY]
- Remove unnecessary file
cd ~/env/lib64/python2.7/dist-packages
rm -rf setuptools* wheel* pip* pkg*
find . -type d -name "tests" -exec rm -rf {} +
find -name "*.so" | xargs strip
find -name "*.so.*" | xargs strip
find . -name \*.pyc -delete
- Zip example
cd ~/env/lib64/python2.7/dist-packages
zip -r9 ~/[LIBRARY].zip
zip -g [LIBRARY].zip lambda_function.py
- Update your code
aws lambda update-function-code --function-name [FUNCTION-ARN] --zip-file fileb://[LIBRARY].zip