Black Lives Matter. Please consider donating to Black Girls Code today.

Trying to use serverless libarary and plot.ly doesn't work on AWS

I realize this is tenuously applicable here, but if we can figure this out then presumably more people might be able to use plot.ly. The short version of the problem, is that when I try to push a python plot.ly function up to lambda the size of the required libaries are too large for AWS lambda, which has a 250mb limit.

Here’s the error:

Serverless Error ---------------------------------------

  An error occurred: HelloLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: d4ef3b5a-8c8f-11e8-871a-cbe0ff4d6f5e).

  Stack Trace --------------------------------------------

ServerlessError: An error occurred: HelloLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: d4ef3b5a-8c8f-11e8-871a-cbe0ff4d6f5e).
    at provider.request.then (/Users/nfeger/.nvm/versions/node/v9.5.0/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:112:33)
From previous event:

You can see a super simple example here: https://github.com/nafeger/serverless-plotly-example

That is the smallest serverless example I can figure how to make, and it still cannot generate a chart due to the size of the dependencies.

Again, not necessarily your deal here, but if anyone knows about it, it would be sweet.

Take care,
Nathan

You can try using on our distributed npm package (e.g https://www.npmjs.com/package/plotly.js-dist) instead of fetch our the plotly.js dependencies and devdependencies to AWS.

Is there an analogous version of this for python?

I was actually able to make this work, Just had to figure out how to use zipped requirements and the proper packaging exclusions.