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

Installation on AWS Lambda #286

Closed
fergiemcdowall opened this issue May 4, 2016 · 10 comments
Closed

Installation on AWS Lambda #286

fergiemcdowall opened this issue May 4, 2016 · 10 comments

Comments

@fergiemcdowall
Copy link

Has anybody attempted to install leveldown on AWS Lambda? If so how did it go? What is the best strategy for installing the binary?

@bhurlow
Copy link

bhurlow commented May 4, 2016

Does lambda preserve the disk state between invocation? I would imagine Amazon rotates the location of the functions pretty heavily in the background so they're probably 'stateless'

@fergiemcdowall
Copy link
Author

For my use case it is fine if the instances are ephemeral.

I guess another way to formulate the question is: is there a standard way compile and distribute prebuilt binaries for node modules so that you can deploy bundles without npm installing?

@bhurlow
Copy link

bhurlow commented May 5, 2016

http://apex.run/#function-hooks might be helpful

@juliangruber
Copy link
Member

leveldown is installed via prebuilt already, so an npm install on aws should just fetch those

@vweevers
Copy link
Member

I guess another way to formulate the question is: is there a standard way compile and distribute prebuilt binaries for node modules so that you can deploy bundles without npm installing?

We're looking into prebuildify (#482), which would include all prebuilts in the npm package, and therefore in the AWS deployment package.

Short of that, there is no standard way.

@LinusU
Copy link

LinusU commented Jul 11, 2018

@fergiemcdowall you can compile the module inside a docker instance that matches the AWS Lambda runtime, then simply include that in your zip file that you upload to Lamda. That's how I've solved native dependencies in scandium.

@fergiemcdowall
Copy link
Author

@LinusU nice! I will give it a try.

@LinusU
Copy link

LinusU commented Jul 12, 2018

@fergiemcdowall here is the docker file, in JS though 😆, but should be easy to see what it does.

https://github.com/LinusU/scandium/blob/master/lib/dockerfile.js

@vweevers
Copy link
Member

FROM amazonlinux:2017.03

Nice one! Didn't know they had docker images :)

@LinusU
Copy link

LinusU commented Jul 12, 2018

Yeah, it's nice! It's also pinned at 2017.03 since the Lambda documentation says that that is the version that they are running at the moment.

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

No branches or pull requests

5 participants