jaymon / herd Goto Github PK
View Code? Open in Web Editor NEWQuickly and easily create AWS lambda python functions and make them available from a url
Quickly and easily create AWS lambda python functions and make them available from a url
The moved versions should be considered the canonical version from 7-8-2020 onwards:
utils.NormalizeDict
was moved into datatypesutils.EnvironParser
was moved to captain 4.0.0+utils.Extra
was moved to captain 4.0.0+When this is updated to use captain 4.0.0 and datatypes then you can remove the versions and tests that are in herd
It would be cool to have a command that can create a new lambda function, so you could do something like:
$ herd function-write /path/to/filename.py
And it would create a skeleton lambda file, something like:
def handler(event, context):
"""This is the description of the lambda function that will be in amazon"""
return {
'statusCode': 200,
'body': {},
"isBase64Encoded": False,
"headers": {}
}
https://github.com/aws/chalice - Python Serverless Microframework for AWS.
I'm shocked I hadn't seen this before
Turns out, Python modules with .so
libraries installed via pip will probably not work when ran on Lambda. This makes sense but it is also annoying, there are even repos designed to handle this problem by swapping out the original version with a precompiled for lambda version. But relying on 3rd party repos that haven't been updated in years doesn't seem like a viable solution for me.
I can get into the manylinux wheels but I think this is only a partial solution that works with some packages on not others (more research would be needed), this is something Zappa does when figuring out dependencies.
I think the solution that might be the least complicated would be to spin up an EC2 box using the same Amazon Linux that Lambda uses, which is currently:
arn:aws:lambda:::awslayer:AmazonLinux1803
Then basically copy over the lambda function file and any local dependencies and then install the other dependencies using pip onto the box, then compile all the dependencies and pull the zip file back down. Then destroy the box. You could even locally cache the dependencies so you wouldn't have to always spin up a new EC2 box every time they deployed (if the dependencies or versions haven't changed).
This solution has a bunch of moving parts but I don't think any of them are that complex or error prone. Biggest issue will be running the remote commands on the EC2 box, I think something like fabric would be overkill, so I would need to look into other solutions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.