-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 17 (Corretto) Runtime #29
Comments
Do we have an estimated date for Java 17 implementation in AWS Lambda ? Our team would really like to enjoy Java features brought between Java 11 and Java 17 in AWS Lambda. We know that we can create Lambda container image for that (https://docs.aws.amazon.com/lambda/latest/dg/images-create.html). But it would be better and more convenient to have Java 17 as a Lambda base image / native runtime. |
I tried adapting the current Java 11 base image to Corretto 17 by just replacing the corresponding
....this file should probably be generatede via the build system to include your own jars as well. It then starts, but then subsequently fails when some agentlib tries to access a module that hasn't been opened.
This can for example be fixed via:
After these two changes the Java 11 base image has been adapted to Corretto 17, or so it seems at least. Next step is deleting some useless crap from the Corretto 17 distribution similar to that old Java 11 directory to get the size down a bit. This is what I ended up with. Opted for using the Java 11 base image for a smaller Dockerfile, with the idea that the other layers are cached near site of use, not sure if that makes sense or not, but hopefully a proper 17 version will come shortly.
|
On top of Corretto 17 support, would the java-17 runtime also use the Graviton processors? |
@dsvensson , putting JDK 17 makes Jigsaw (Java 9 Modules) Mandatory. I noticed that inside the Docker Image there are some AWS Jars which are not yet have |
@wietlol , Java is "Compile once, run anywhere", so i would guess that Gravitron support is implicit. Java11 Runtime already supports Gravitron |
As long as you are aware of the meaning and the goal is just to run 17, it fits the purpose. 11 didn't have modules. For me I just want to use the same JVM in both lambda and ECS deploys for convenience. The instant a new base is ready it's time to ditch the workaround. |
@dsvensson , Jigsaw Modules exist since Java 9. In JDK 17 they became mandatory. Just wanting to use JDK 17 without understanding how it should work is not the way to go. Jigsaw was created for Security purposes, so when you develop a Library Jar, your Internal Classes aren't accessible. |
You are absolutely correct. There was no module requirement. My comment was sloppy, it should have said that modules was not an issue. For my usecase modules add very little value. It will be a nice bonus when everything is aligned, but nothing I personally care about. In my case I was not running on a LTS version before for the rest of the application, and 17 presented that opportunity. When moving to the most recent LTS it just made sense to use the same version everywhere to simplify CI and development experience (arm64 laptops), with the goal of migrating to a supported 17 upstream image at some point in the future. My initial comment achieves just that. Your comments only add off topic useless discussions that I will try to stay out of going forward. Criticism is better received with patches. |
Hey aws team, we're wondering if there's any news on this effort. JDK 18 is coming out in a month and we're hoping to stay on the latest releases as much as possible, as encouraged by the OpenJDK team. |
Google Cloud just announced that Cloud Functions now support Java 17 at preview release level today. It would be great to have even a high-level idea of delivery date for AWS for the same feature! |
Any news on this? It's been quite some time since 17 came out. |
Java 17 support for Lambda is included in our roadmap planning, however due to some uncertain dependencies we don't yet have a timeline that's ready to share. |
@jtuliani I appreciate the transparency very much, but it's still disappointing not to have even a rough ETA. Thank you for the response, regardless. |
FWIW, I have run across this java17 layer project from an apparent serverless solutions architect at AWS. I haven't used it yet, but thought it was relevant, so thought I'd drop it here for discussion. I will circle back with feedback if and when I do end up using it, and it would be great to hear others' experiences too! Regardless, many thanks to @msailes / @marksailes for moving the ball forward! |
This method is also documented on the AWS Blog https://aws.amazon.com/blogs/compute/build-a-custom-java-runtime-for-aws-lambda/ |
Having been inspired by @msailes' excellent java17 layer project, I decided to tackle putting together a Java 17 Lambda custom base image. You can find the source code at aleph0io/aws-lambda-java-base-images, and the public docker images in the ECR public gallery and DockerHub. I have also created a (simple) example lambda function using the base image at aleph0io/example-java-lambda-function to show how to use it. In short, use it just like an official base image. I'm using the custom base image in production, and it works a treat. If anyone else uses it, I would be very keen to hear any feedback at all. In the meantime, it's probably best to consider them experimental. Naturally, once AWS releases the official runtime, everyone should use that, but hopefully this will help in the meantime. I only have an image for Java 17 x86_64 for now, but I hope to also add support for non-LTS versions and at least arm64 architecture soon, too. EDIT: There are now custom lambda base images available for Java 17, 18, and 19 in the ECR public gallery and DockerHub. |
Hi, @jtuliani. We are working on some comparisons of different Lambda runtimes and want to pick Java 17 for research. Will it be released at the end of Q3? Could you share your plans with us if possible, please? |
Missed Java 17 1st birthday by a few days. Happy birthday! 🎂 And Java 19 was released yesterday. But here we are, still stuck with Java 11 official images in Lambda... |
@jtuliani Any news on this? |
I'm using @msailes https://github.com/msailes/lambda-java17-layer project it it seems to work just fine for now for those using sam you need only to copy that projects zip to a bucket
then refer to the layer from your sam template in a layer version, add that layer your lambda and use the AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
Layer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: java-17-runtime
ContentUri: s3://{YOUR_BUCKET_NAME}/layers/java17layer.zip
CompatibleRuntimes:
- provided
Function:
Type: AWS::Serverless::Function
Properties:
CodeUri: path/to/your/app.zip
Handler: com.you.your.Handler
Runtime: provided.al2
Layers:
- !Ref Layer
Architectures:
- arm64 |
@jtuliani Any news on this? |
We are continuing to work on Java 17 support, but don't currently have a timeline we can share. |
Does this new snap start feature explain the delay? |
It wouldn't be appropriate for me to comment on internal scheduling details. However, we do hope you are excited to try SnapStart! |
I’m now more eager for an official java17 runtime since snapstart was announced. I’ve since moved onto java17 with a custom runtime mentioned above. Now it feels like those that are using current java lts version are missing out if only java11 is getting snapstart support. I raised a separate question in the aws java runtime client project if there’s a way to work it in there, in which case I wouldn’t be missing out on what’s going on in java11 runtime aws/aws-lambda-java-libs#380 |
:( Java 17 LTS is out since (14.09.2021) 1 year and 4 months ago and still not supported in lambda. I really wonder what is so difficult to make it happen that there is even not a timeline aws/aws-lambda-java-libs#380 (comment). Microsoft Azure functions is supporting Java 17 Please catch up with state of the art Java support |
We recognize the extended delay in providing Java 17 support in AWS Lambda, and apologize for the inconvenience this has caused. Our plan is to publish a base container images for Java 17 this month, with the managed runtime and tooling support (SAM CLI, CFN, CDK, AWS CLI, console, etc) support to follow. We will provide an ETA for the managed runtime when we publish the container image. |
I think lots of people are happy about the news above. Another question : Will Lambda SnapStart work with this solution ? Anyway, thank you for your efforts to consider Java community. |
Happy to hear it. But also a feeling kinda disappointed as Lambda Java 17 support to my opinion should have already been there. |
My company is starting its migration from 17 to 19 to in prep for the “loom”ing 21 release this year. I’ve got nothing but love for the hard work aws does on these runtimes but I agree with the sentiment above. an official 17 runtime is going is going to feel like todays 11 when java 21 comes along. |
@softprops in case it's useful, I maintain a set of community Lambda base images, including for Java 19, in the ECR public gallery. They're open source, so you can always read or fork, too. I'll add images for Java 20 and 21 as they come out. Good luck with the migration! I can't wait for Project Loom either. |
@nicofabre Yes, the managed runtime for Java 17 will support SnapStart. SnapStart is not currently supported for functions deployed using container images. |
It is exceedingly frustrating that this isn't done yet, and I would think embarrassing for you as 20 is in RC and 21 is in EAB. Is there an update? You seriously need the Raise the Bar on the Java support for Lambda runtimes. |
@jtuliani how is it going so far? Are we still to expect it in a few days time? |
Java17 Preview Base Image is out. Image URI
Check out at https://gallery.ecr.aws/lambda/java |
We have today published a Lambda container base image for Java 17, for both x86_64 and arm64 architectures. Our performance testing has shown a degradation in cold start latency for a subset of functions when using the Java 17 image; while we investigate further we have tagged the Java 17 image as ‘preview’ and it should not be used for production workloads. Instructions for how to use Lambda container base images for Java are given in the ‘Usage’ tab at https://gallery.ecr.aws/lambda/java. This release includes a change to the default tiered compilation setting previously used by the Java 11 base image. With Java 11, Lambda uses the C2 compiler; with the Java 17 Lambda configures tiered compilation to stop at C1 level 1 by default. For more information and why for most functions this will provide an overall performance benefit, see https://aws.amazon.com/blogs/compute/optimizing-aws-lambda-function-performance-for-java/. Customers can enable the previous tiered compilation behavior by setting the We expect to publish updated images suitable for production workloads and managed runtime support for Java 17 within 90 days. |
Is there a way to use the preview Java 17 with snapstart? Or does that require the managed runtime? |
@checketts As yet, SnapStart is only supported for Java managed runtimes, not container images. So you can't use the Java 17 preview image with SnapStart, nor can you use the Java 11 container image. We're aware of customer demand for SnapStart support with container images, but don't have an ETA to share at this time. |
We have today published an updated Java 17 container image which addresses the performance issue in the previously published preview image. This new image is no longer tagged as preview and is suitable for production workloads. We are continuing to work on the Java 17 managed runtime release, which remains on track for delivery by our target date of 2023-05-29 as previously communicated. |
Just saw CDK support for Java 17 launch yesterday with version 2.77.0👀 Looks like we are getting close! Thank you!! |
Support for Java 17 as a managed runtime in AWS Lambda is now GA: https://aws.amazon.com/about-aws/whats-new/2023/04/aws-lambda-java-17 |
Congrats to the AWS team! Huge release. |
As title says
The text was updated successfully, but these errors were encountered: