Giter Club home page Giter Club logo

Comments (8)

whummer avatar whummer commented on May 14, 2024 2

Thanks for the suggestion, this definitely looks like a neat solution. It might be worthwhile looking into this, especially if/when we start supporting Node/Java lambdas (currently only Python Lambdas are supported), and to support full parity with the AWS environment.

There are some other issues and feature requests which probably have higher priority, but I would be more than happy to accept a pull request that adds an integration with lambci/docker-lambda.

from localstack.

whummer avatar whummer commented on May 14, 2024

An initial version of Docker-based Lambda execution is now available. Can you please try to run the following commands from the repository root:

git pull
docker pull atlassianlabs/localstack
make test-docker

You will notice that the output of the last commands contains a few lines like this:

docker run ... lambci/lambda:python2.7 "handler.handler"
...
docker run ... lambci/lambda:nodejs "handler.handler"

If the test runs successfully, then you should be good to start LocalStack in Docker and run your own custom Lambda function tests against it (only Node.js and Python are currently supported):

make docker-run

Please report back if that works for you (plus your environment details, if it does not work). Thanks.

from localstack.

singledigit avatar singledigit commented on May 14, 2024

I tried this today. I am able to get the lambda to run a simple function

exports.handler = function(event, context, callback){
   callback(null, "works");
}

But am getting an error

init handler error: TypeError
    at exports.handler (/var/task/read.js:2:11)

from localstack.

singledigit avatar singledigit commented on May 14, 2024

ok, scratch that.. I needed to run the 6.10. Proper command for me was...

docker run -v "$PWD":/var/task lambci/lambda:nodejs6.10

from localstack.

whummer avatar whummer commented on May 14, 2024

Thanks @singledigit, support for 6.10 was still missing when you tested it. In the updated version you can now specify nodejs6.10 as your Lambda runtime (see atlassian-archive/localstack@a240285#diff-2dce34f36977e0b6398556134ff5f411R32). Closing this for now, please re-open if there are any more issues.

from localstack.

sylar avatar sylar commented on May 14, 2024

I tried this today... basically I ran docker run -it -p 4567-4580:4567-4580 -p 8080:8080 atlassianlabs/localstack and then tried to pipe in a simple nodejs handler and it immediately blew with an SyntaxError: invalid syntax around a constant, even though i usesd the nodejs6.10 runtime.

const docs = `bla bla ${variable}`

What am i doing wrong?

from localstack.

singledigit avatar singledigit commented on May 14, 2024

So you call lambci directly.

docker run -v "$PWD":/var/task lambci/lambda:nodejs6.10

For that you don't even need local stack. However, you can link into local stack with something like

docker run --link <localstack-container> -v "$PWD":/var/task lambci/lambda:nodejs6.10

That will allow you to connect to the local stack services. I would love to see an example of configuring local stack lambda to call on lambic.

from localstack.

sylar avatar sylar commented on May 14, 2024

i was hoping to use the aws --endpoint-url=http://localhost:4574 lambda create-function cli tool... i'll try your way to check it out

from localstack.

Related Issues (20)

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.