Accenture / serverless-ephemeral

This is a Serverless Framework plugin that helps bundling any stateless zipped library to AWS Lambda.
67 stars 15 forks source link

pip to install another package? #17

Closed braco closed 6 years ago

braco commented 6 years ago

What's the expected way to install an additional python library? pandas in this case.

A little confused by the documentation, is it suggesting that another container needs to be created from scratch?

Or this format?

  - url: https://xxxxx.s3.amazonaws.com/boto3.zip
        nocache: true
alexleonescalera commented 6 years ago

The url option only works if you have a zip with all the necessary Python files already prebuilt. That means that you would have to pip install panda manually and zip all the necessary Python files.

I would recommend creating your own Docker container that installs that library, extending your Dockerfile from the existing (serephem-venv)[https://hub.docker.com/r/alexleonescalera/serephem-venv/] image. That way, serephem will take care of building including the necessary files every time.

You can just copy/paste/modify the Docker example for the image-processor. It uses Python Pillow image library, so you can just make the necessary replacements in the build.sh file.

braco commented 6 years ago

Thanks Alex!