Code Monkey home page Code Monkey logo

Comments (12)

mhart avatar mhart commented on June 24, 2024 6

@jplock yep, it absolutely is – as it says in the README Java exists on the images, so you can run things manually yourself – I just haven't written a Java test runner yet.

I'll comment here when I have πŸ‘

from docker-lambda.

mhart avatar mhart commented on June 24, 2024 3

@timve – I've actually been working on a Java runner myself – I should've updated this issue. It's slightly separate from your approach I think in that I use the production runner jar, but I just swap out the class in the jar that communicates with the native library with a mock class.

Hopefully I'll have time in the next week to push something up – and I'll check out your solution too.

Thanks!

from docker-lambda.

utkuturunc avatar utkuturunc commented on June 24, 2024 1

My goal is to use the following plugin in order to simulate scala microservices. As far as I understood, I need the runners.

https://github.com/serverless-community-labs/serverless-plugin-simulate

from docker-lambda.

utkuturunc avatar utkuturunc commented on June 24, 2024

I have three questions.

Has there been any progress on this?
Will it be possible to test Scala apps?
How could I help implementing Java support?

from docker-lambda.

mhart avatar mhart commented on June 24, 2024

No progress – creating a Java runner is a different challenge to the others because it's not a dynamic target.

You can run Java (and hence Scala) in any of the images – the binaries and libraries exist on the base image, there's just no mock Lambda runner.

Creating a mock Lambda runner would involve replicating what has been done in the other languages (Python, Node.js) – essentially keeping as much as possible of the in-built Lambda runner and just swapping out the core invoker with a mock implementation.

from docker-lambda.

mhart avatar mhart commented on June 24, 2024

Probably – yep. Not entirely sure how they use docker-lambda but I imagine they're relying on the mock runners.

from docker-lambda.

timve avatar timve commented on June 24, 2024

I have been working on adding java8 support to docker lambda, see master...timve:java8 for the diff. It basically consists of two java processes:

  • a starter that sets up the environment and starts a separate JVM process where the lambda is invoked
  • an executor that sets up the context and can invoke the lambda

I would have liked to have used the actual lambda runner code from AWS in order to come closer to the real deal, but I run into issues with the native part of it.

The two main todo's are:

  • mimic the AWS lambda in unpacking jar / zip archive before running
  • setup remote debugging support (actually works, but requires the -Xshare:on option to be disabled)

It is not tested yet, the example java lambda code runs but I have not tested more complex scenarios yet.

Is this something that you would consider to add to docker-lambda ?

from docker-lambda.

timve avatar timve commented on June 24, 2024

@mhart Ah, sounds good, swapping out the native part with a mock sounds a bit closer to the real environment compared to my solution.
Interested to see what you have come up with, let me know if you require any help.

from docker-lambda.

mhart avatar mhart commented on June 24, 2024

@timve finally got time to pushing my stuff up: #48

The example there in the PR description should work currently (lambci/lambda:java8 is up on Docker hub)

from docker-lambda.

timve avatar timve commented on June 24, 2024

@mhart Thanks, neat little trick swapping out the LambdaRuntime class in the jar ;-). I will try give it a spin in the next couple of days.

from docker-lambda.

mhart avatar mhart commented on June 24, 2024

@timve yeah, now if only it were as easy for .NET DLLs – then I could support the dotnetcore1.0 runtime too! πŸ˜‰

from docker-lambda.

pallavi2146-zz avatar pallavi2146-zz commented on June 24, 2024

Right now container(lambci/lambda:java8) running in my machine. Wants to debug in intellij idea. how can i do that. Kindly help me.

from docker-lambda.

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.