Git Product home page Git Product logo

herd's People

Contributors

jaymon avatar

Watchers

 avatar  avatar  avatar

herd's Issues

Some Util classes have been moved into other modules

The moved versions should be considered the canonical version from 7-8-2020 onwards:

  • utils.NormalizeDict was moved into datatypes
  • utils.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

skeleton command line creator

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": {}
    }

Shared library packages

The problem

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.

Proposed Solution

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.

Search

Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.