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

Client library is too large to use with in-browser lambda IDE #106

Closed
nisley opened this issue Jun 5, 2020 · 6 comments · Fixed by #160
Closed

Client library is too large to use with in-browser lambda IDE #106

nisley opened this issue Jun 5, 2020 · 6 comments · Fixed by #160
Labels
enhancement New feature or request
Milestone

Comments

@nisley
Copy link

nisley commented Jun 5, 2020

The AWS Lambda in-line Python IDE:
https://docs.aws.amazon.com/lambda/latest/dg/code-editor.html

stops being functional after the lambda python package gets bigger than 3MB. When I followed the directions to add the influxdb-client library to my lamda I found the library was over 4MB:
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-dependencies

Any way to get the < 1MB in size?

@bednar
Copy link
Contributor

bednar commented Jun 5, 2020

Hi @nate,

We had a similar issue #43 - where we reduced client size to size compatible with AWS Lambda.

The deployment image has a limit to 50MB - https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html, but the Console editor only 3MB.

I will take a look how we can reduce size of client. Meanwhile you could move the influxdb-client into Lambda Layer - https://aws.amazon.com/blogs/aws/new-for-aws-lambda-use-any-programming-language-and-share-common-components/.

Regards

@bednar
Copy link
Contributor

bednar commented Jun 8, 2020

I don't think so that we are able to reduce the size of client under 1MB 😞. The InfluxDB v2 API is too large and only the generated code from a swagger has almost 1MB (influxdb_client/domain, influxdb_client/sevice).

I suppose that we could prepare and maintain public Lambda Layer with influxdb-client.

This Lambda Layer will allows to user use the client together with in-browser lambda IDE.

What do you think? Is it right way?

Regards

@nisley
Copy link
Author

nisley commented Jun 17, 2020

I discussed this with Russ and we think packaging up the client library as a layer as part of the build would be very useful. This article points out several folks that are taking advantage of lambda layers - https://aws.amazon.com/blogs/apn/apn-partners-offer-lambda-layers-and-custom-runtimes/

I do not think every client should be offered as a layer to start with, but I think there is a good case for the NodeJS and Python client libraries.

Because we want to track usage, the user-agent should be set with a name that reflects that the client library is being used in a layer.

If you follow some of the details in offering the layer, we need to provide the ARN. I do not believe we distribute any ARNs today, so we will likely need to coordinate with our SRE team to find the proper home.

@bednar
Copy link
Contributor

bednar commented Jun 17, 2020

@nisley thanks for detail info

@bednar bednar added the enhancement New feature or request label Jun 17, 2020
@nisley
Copy link
Author

nisley commented Jun 23, 2020

I noticed today when investigating layers different companies put out that layers have the same region requirement as lambdas. That means you will need to publish the layer in each region that Lambda supports (or that we want to support) with a corresponding ARN.

@tomklapka tomklapka mentioned this issue Oct 2, 2020
3 tasks
@bednar bednar added this to the 1.13.0 milestone Dec 1, 2020
@bednar
Copy link
Contributor

bednar commented Dec 1, 2020

The docs how to deploy the Python client into AWD Lambda Layer:

https://github.com/influxdata/influxdb-client-python/tree/master/docker/aws_lambda_layer

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

Successfully merging a pull request may close this issue.

2 participants