Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursively adding directory and its contents to requirements package #542

Open
nathanielrindlaub opened this issue Sep 9, 2020 · 0 comments · May be fixed by #752
Open

Recursively adding directory and its contents to requirements package #542

nathanielrindlaub opened this issue Sep 9, 2020 · 0 comments · May be fixed by #752

Comments

@nathanielrindlaub
Copy link

Hello - first off, this is an awesome plugin and I think it will greatly improve my current clunky build workflow. I just have one question: I see that you can add single files to the final deployment package with the dockerExtraFiles option, but I was curious whether there's an easy way to pull in a directory and all of its contents into the final deployment/requirements package.

Specifically in my case I have a Python Lambda function that utilizes a perl executable called exiftool to parse metadata from images. In my current (very manual) workflow I start up a lambci/lambda docker container in interactive mode, manually download and unzip Exiftool, copy the pieces of it I need into a separate directory, pip install the rest of my dependencies, then zip up the exiftool directory and all of the python packages and finally add my lambda function to the deployment package. My zipped up package ends up looking like this:

├── function.zip
      ├── handler.py
      └── exiftool
           ├── exiftool // exiftool executable 
           └── lib
               └── ...
      └── PIL
           ├── ...
      ... 

How would I go a about replicating that with the serverless-python-requirements plugin? Perhaps I have to write that entire process to a dockerfile and use the dockerFile option in my serverless.yml? If you use a custom dockerfile, are you responsible for instructing Docker to install all other python dependencies from within the Dockerfile or will this plugin still automatically look for a requirements.txt and intall + add them to the deployment package at build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant