Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support Java21 in Lambda #9685

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

Closed
wants to merge 4 commits into from
Closed

Conversation

eddumelendez
Copy link
Contributor

@eddumelendez eddumelendez commented Nov 18, 2023

Motivation

Java 21 was released in September, and today amazon added support
for it.

Changes

Add java21 as a runtime.

Java 21 was released in September, and today amazon added support
for it.
Copy link
Contributor

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@localstack-bot
Copy link
Contributor

localstack-bot commented Nov 18, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@eddumelendez
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@joe4dev joe4dev mentioned this pull request Nov 22, 2023
2 tasks
@joe4dev
Copy link
Member

joe4dev commented Nov 22, 2023

Hi @eddumelendez and thank you very much for this initiative 👏👏👏.

Some comments:

  • The API stubs in the __init__.py are automatically generated by our framework AWS Server Framework (ASF) and should not be edited manually. We have a nice blog post that summarizes ASF and snapshot-based parity testing: https://blog.localstack.cloud/2022-08-04-parity-explained/
  • The snapshots also need to be auto-generated and should never be edited manually. Updating the snapshots consistencly is key for parity.
  • We have experienced inconsistencies around runtime updates in the past (even ourselves) leading to bugfixes (e.g., related to layers validating compatible runtimes) after adding a new runtime.
  • We also have another community PR for adding the new NodeJS 20 runtime Add NodeJS 20 support for Lambda #9659. Adding all new runtimes in one go makes it easier to update the snapshots at once.

Therefore, we decided to improve the organization of runtimes to allow easier and faster updates in the future. We have prepared this PR #9697

I hope this is ok for you @eddumelendez. I can add you as a co-author once I merge the PR for proper credits 🥇 .
I will add a review with feedback anyway to point out some of the challenges but feel free to ignore it.

We are looking forward to supporting new runtimes much faster in the future 🚀

Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @eddumelendez for this initiative 👏👏👏
The SnapStart is a nice catch 👍

As mentioned in the previous comment, we re-organized the runtime. I added some comments to highlight some of the changes. Feel free to checkout the full changelog in our PR adding all the new runtimes at once here: #9697

}
SNAP_START_SUPPORTED_RUNTIMES = [Runtime.java11, Runtime.java17]
SNAP_START_SUPPORTED_RUNTIMES = [Runtime.java11, Runtime.java17, Runtime.java21]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch 👍 that reminded me about SnapStart when re-organizing the Lambda runtimes.

@@ -5046,7 +5046,7 @@ def test_layer_policy_lifecycle(

class TestLambdaSnapStart:
@markers.aws.validated
@pytest.mark.parametrize("runtime", [Runtime.java11, Runtime.java17])
@pytest.mark.parametrize("runtime", [Runtime.java11, Runtime.java17, Runtime.java21])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad you noticed this 👍
I consolidated this in the runtimes re-work for easier maintainability

@@ -12521,6 +12521,150 @@
}
}
},
"tests/aws/services/lambda_/test_lambda_api.py::TestLambdaSnapStart::test_snapstart_lifecycle[java21]": {
"recorded-date": "02-05-2023, 18:15:11",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshots always need to be generated automatically as explained under Parity Testing. They must never be edited manually. Hence, the date from spring cannot be correct here.

This great blog post is the best introduction: https://blog.localstack.cloud/2022-08-04-parity-explained/

@@ -233,6 +233,7 @@ class Runtime(str):
python3_11 = "python3.11"
nodejs20_x = "nodejs20.x"
provided_al2023 = "provided.al2023"
java21 = "java21"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be auto-generated through AWS Server Framework (ASF)

@joe4dev
Copy link
Member

joe4dev commented Nov 23, 2023

The latest image is already out and the next tagged patch release will be published very soon (ETA: tomorrow).
Therefore, let's close this PR superseded by #9697

@eddumelendez Congratulations on your first LocalStack contribution 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants