Giter Club home page Giter Club logo

hello-graalvm's Introduction

AWS Lambda + GraalVM Demo

I am trying to get a simple AWS Lambda + GraalVM demo working.

If you clone this project and run mvn package -P native-image you will get a function.zip that you can upload to AWS Lambda as a new function. This function takes in a String as the input and will return the uppercase version of the input.

public class SimpleHandler implements RequestHandler<String,String> {

    @Override
    public String handleRequest(String input, Context context) {
        LambdaLogger logger = context.getLogger();
        logger.log("Function '" + context.getFunctionName() + "' called");
        return input.toUpperCase();
    }

}

If you try and test this through the AWS Console you will get the following error:

/var/task/bootstrap: line 3: ./hello-graalvm: cannot execute binary file
/var/task/bootstrap: line 3: ./hello-graalvm: cannot execute binary file
START RequestId: dcd6569e-9716-47ef-b1c0-106e80aa110a Version: $LATEST
RequestId: dcd6569e-9716-47ef-b1c0-106e80aa110a Error: Runtime exited with error: exit status 126
Runtime.ExitError
END RequestId: dcd6569e-9716-47ef-b1c0-106e80aa110a
REPORT RequestId: dcd6569e-9716-47ef-b1c0-106e80aa110a	Duration: 43.11 ms	Billed Duration: 44 ms	Memory Size: 128 MB	Max Memory Used: 3 MB	

Notes:

  • I wonder if this has to do with the fact that I am running the native build on my local MacBook and the custom runtime is Linux.

hello-graalvm's People

Contributors

danvega avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.