Skip to content

Feat/use durable functions emulator image#8708

Merged
roger-zhangg merged 21 commits intoaws:developfrom
SilanHe:feat/use-durable-functions-emulator-image
Apr 2, 2026
Merged

Feat/use durable functions emulator image#8708
roger-zhangg merged 21 commits intoaws:developfrom
SilanHe:feat/use-durable-functions-emulator-image

Conversation

@SilanHe
Copy link
Copy Markdown
Contributor

@SilanHe SilanHe commented Feb 26, 2026

Which issue(s) does this change fix?

#8488

Why is this change necessary?

This introduces a fix for the Homebrew linkage issue with the Durable Functions emulator. We are also introducing this so that SAM CLI can receive Durable Functions emulator updates uncoupled with SAM CLI release.

How does it address the issue?

We are automatically vending the emulator via an image published to ECR. See aws/aws-durable-execution-sdk-python-testing#196. Since the arm64 emulator is no longer included as an executable directly in the SAM CLI, this also fixed the issue where Homebrew users of SAM CLI could not emulate durable functions locally without doing some workaround.

What side effects does this change have?

As a bonus, this reduces the SAM CLI size.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added area/local/start-api sam local start-api command area/local/invoke sam local invoke command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 26, 2026
"""
Allow pinning to a specific emulator image tag/version
"""
ENV_EMULATOR_IMAGE_TAG = "DURABLE_EXECUTIONS_EMULATOR_IMAGE_TAG"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

sam local invoke has a --invoke-image parameter, where customers can pass the location of a specific image to be used as the execution base image instead of the default Lambda base image.

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html#ref-sam-cli-local-invoke-options-invoke-image

could explore using this established pattern rather than adding ENV_EMULATOR_IMAGE_TAG?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that is a good idea however due to time constraints I won't have any more capacity to work on this for a while so I'd be happy to have this as a follow up item. I'm guessing I'll have to confer with SAM CLI team for the name of the parameter, updating the docs, etc.

I don't think having it as an environment variable makes it substantially harder to use in the meantime.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally I don't think this should be exposed as a new parameter on the CLI. Our expectation is for the latest image to always be "stable", so it should only be overridden in unexpected cases. The way I see this, having this be overridable at all is like a backdoor, and we shouldn't expect customers to need to use this.

Do you agree?

@SilanHe SilanHe requested review from roger-zhangg and valerena March 2, 2026 17:41
@SilanHe
Copy link
Copy Markdown
Contributor Author

SilanHe commented Mar 2, 2026

I ran integration tests locally

SAM_CLI_DEV=1 pytest tests/integration/local/invoke/test_invoke_durable.py::TestInvokeDurable -vv -s && SAM_CLI_DEV=1 pytest tests/integration/local/start_lambda/test_start_lambda_durable.py::TestStartLambdaDurable -vv -s && SAM_CLI_DEV=1 pytest tests/integration/local/start_api/test_start_api_durable.py::TestStartApiDurable -vv -s

and they all passed

Copy link
Copy Markdown
Contributor

@valerena valerena left a comment

Choose a reason for hiding this comment

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

LGTM. Waiting for the final official image location.

Copy link
Copy Markdown
Member

@bchampp bchampp left a comment

Choose a reason for hiding this comment

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

Nice - I much prefer this approach, 1 blocking comment about the --lambda-endpoint and two minor suggestions.

hsilan added 2 commits March 10, 2026 11:33
…or logs after the container is shut down in case of failures
valerena
valerena previously approved these changes Mar 20, 2026
@SilanHe SilanHe marked this pull request as ready for review March 27, 2026 14:00
@SilanHe SilanHe requested a review from a team as a code owner March 27, 2026 14:00
valerena
valerena previously approved these changes Mar 30, 2026
@SilanHe SilanHe requested review from roger-zhangg and valerena April 1, 2026 22:35
Copy link
Copy Markdown
Member

@roger-zhangg roger-zhangg left a comment

Choose a reason for hiding this comment

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

LGTM

@roger-zhangg roger-zhangg added this pull request to the merge queue Apr 2, 2026
Merged via the queue into aws:develop with commit 4e47788 Apr 2, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/local/invoke sam local invoke command area/local/start-api sam local start-api command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants