ubaniabalogun/serverless-package-python-functions

Resulting zip files seem to contain _everything_

davidfox-ap opened this issue · 2 comments

Thank you again for your help with my previous issue -- I can only hope you'll be as accommodating with this one. :-)

I have set up my functions as suggested in your documentation:

  stage4ingestion:
    handler: stage4ingestion-handler.stage4ingestion
    environment:
      S3PREFIX: ${file(./serverless.env.yml):${opt:stage}.S3PREFIX}
    package:
      include:
        - stage4ingestion
      artifact: ${self:custom.pkgPyFuncs.buildDir}/${self:service}-${opt:stage}-stage4ingestion.zip

But when I look inside the resulting zip file:

.serverless/stage4ingestion.zip

I see it contains not only the files that were inside the ./stage4ingestion folder, but all of the files and folders at root level -- including the _build directory.

I did not notice this until I had several functions in my deployment and I began seeing 'Array buffer allocation failed' error messages due to file size limitations with Lambda.

Maybe there's something I missed regarding including/excluding files?

Hi @davidfox-ap,
What versions of serverless and the plugin are you using?
Do you have the individual packaging set to true as described below:

service: your service

package: 
 individually: true 

# rest of serverless.yml

Also, can you please share your pkgPyFuncs configuration please?
I'll need more details to help figure out what's going on

I had not updated serverless in a bit. Once I did that I noticed that my functions were once again being packaged individually. Now I'm not sure what happened. I'll close this issue for now and reopen only if I see a reintroduction of this behavior. Thanks for your help.