rackerlabs / lambda-uploader

Helps package and upload Python lambda functions to AWS
Apache License 2.0
270 stars 56 forks source link

Linked Library Issues #88

Closed mjgorman closed 8 years ago

mjgorman commented 8 years ago

Noticed an issue with modules with linked libraries(PyCrypto for instance), not even using your uploader but I suspect same issues would be present and it might be something cool for you guys to try and solve. If you run this uploader or pip on local OSX box and try and use those dependencies on Lambda it will fail as the ELFs are not linux compatible.

martinb3 commented 8 years ago

Hello! We actually do have a way to do this; there's an option to take an existing virtualenv and re-use it with lambda-uploader. I added this this option specifically for the same problem encountered with PyCrypto -- lambda-uploader --virtualenv=~/.virtualenv/my_custom_virtualenv.

In our case, we build a working virtualenv on Amazon Linux (with the correct PyCrypto binaries), and then bring it back to our local / development machine. Then we reuse that virtualenv using the flag above, uploading it along with our lambda function when doing deployments.

Hope this helps!