Skip to content

Allow usage of additional runtimes with the Lambda SnapStart feature enabled #12006

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

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

dfangl
Copy link
Member

@dfangl dfangl commented Dec 9, 2024

Motivation

Recently, AWS announced support for additional runtimes for using SnapStart: https://aws.amazon.com/blogs/aws/aws-lambda-snapstart-for-python-and-net-functions-is-now-generally-available/

However, while investigating this change, it seems that over the API the feature is available for all runtimes, not just the announced ones.

Whether this is a temporary error, or a hint that additional runtimes could get supported in the future, I removed the runtime validation for snapstart creation and updates, and added aws-validated tests for all runtimes to show it is indeed possible to create them.

I did some more investigation, and it seems like SnapStart is even (somewhat) functioning, at least an initial initialization of the function potentially takes place (if you misconfigure the function, it errors out immediately, it does not do so without snapstart enabled).

Changes

  • SnapStart is now available for additional runtimes (CRUD only). As AWS does not raise an error for unsupported ones, we do not do so either.

@dfangl dfangl added the semver: patch Non-breaking changes which can be included in patch releases label Dec 9, 2024
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.

Interesting insights that SnapStart is allowed for all runtimes 💡

def test_snapstart_update_function_configuration(
self, create_lambda_function, snapshot, aws_client, runtime
self, multiruntime_lambda, snapshot, aws_client
Copy link
Member

Choose a reason for hiding this comment

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

multiruntime_lambda 🚀

"EphemeralStorage": {
"Size": 512
},
"FunctionArn": "arn:<partition>:lambda:<region>:111111111111:function:<function-name:1>",
"FunctionName": "<function-name:1>",
"Handler": "cloud.localstack.sample.LambdaHandlerWithLib",
Copy link
Member

Choose a reason for hiding this comment

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

🧹 🥳

Copy link

github-actions bot commented Dec 9, 2024

LocalStack Community integration with Pro

    2 files  ±  0      2 suites  ±0   1h 30m 1s ⏱️ - 21m 55s
2 923 tests  - 914  2 704 ✅  - 817  219 💤  - 97  0 ❌ ±0 
2 925 runs   - 914  2 704 ✅  - 817  221 💤  - 97  0 ❌ ±0 

Results for commit b9ad6eb. ± Comparison against base commit eaf1a15.

This pull request removes 949 and adds 35 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[dotnet6]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[dotnet8]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[java8.al2]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[nodejs16.x]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[nodejs18.x]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[nodejs20.x]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[nodejs22.x]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[provided.al2023]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[provided.al2]
tests.aws.services.lambda_.test_lambda_api.TestLambdaSnapStart ‑ test_snapstart_lifecycle[python3.10]
…

@dfangl dfangl merged commit f6f83d2 into master Dec 10, 2024
34 checks passed
@dfangl dfangl deleted the lambda/new-snapshot-support branch December 10, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants