Skip to content

chore: merge features support into develop - #9454

Merged
licjun merged 1 commit into
developfrom
features-202611192207
Nov 19, 2026
Merged

licjun merged 1 commit into
developfrom
features-202611192207

Conversation

@licjun

@licjun licjun commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add support of for customer managed runtime

Support functions with Runtime: custom and RuntimeConfig in sam build
and in sam local invoke, start-api and start-lambda.

- sam build builds the code for the runtime that Metadata.BuildMethod
  names (a runtime name or makefile), the same way a layer is built.
  --use-container picks that runtime's build image; makefile needs
  --build-image.
- Local invoke runs the function on the image named with
  --invoke-image, or else resolves it from RuntimeConfig
  (GetRuntimeAlias, then GetRuntimeVersion's ResolvedUri) with the
  lambda-core client, in the RuntimeArn's region. The runtime starts
  from the image's ENTRYPOINT with the handler as its argument, or
  /var/runtime/bootstrap when the image sets none, as Lambda does.
- --debug-port uses the debug settings of the runtime that BuildMethod
  names, and warns when a debugged runtime image never starts.
- Clear errors for a missing RuntimeConfig, a missing or empty field,
  a RuntimeConfig that is not a mapping, and unresolved intrinsics.
- Track CustomerManagedRuntime usage in telemetry. Only fixed event
  values are sent: no runtime ARN, alias or image URI.
- Bump boto3/botocore[crt] to 1.44.5 and awscrt to 0.38.0; the
  lambda-core client needs boto3 1.44.3 or later.
@licjun
licjun requested a review from a team as a code owner November 19, 2026 22:51
@github-actions github-actions Bot added area/local/start-api sam local start-api command area/build sam build command area/local/invoke sam local invoke command area/local/start-invoke area/schema JSON schema file pr/internal labels Nov 19, 2026
@aws-sam-tooling-bot

Copy link
Copy Markdown

🧪 Hands-on test: No problems observed in 8 scenarios

Commit 3278b65 · build LambdaToolingHandsOn-Docker:05db54a5-5945-4aaa-bff0-452cf4a35a80. The plan's scenarios ran on an isolated build host; a problem is reported only if it reproduced at least twice. Passing scenarios show only that these checks behaved as expected, not that the change is correct.

Scenarios

Scenario Planned check Result Runner's note
S1 Main build path: Runtime: custom with Metadata.BuildMethod set to the sandbox's Python version builds with python-pip a… ✅ pass Head: samdev build (SAM_CLI_DEV=1 entry point) exits 0, 'Build Succeeded', no Traceback. Function (Runtime: custom, BuildMethod python3.11) and RegularFunction (python3.11) both built with PythonPipB…
S2 Error paths the PR adds for Runtime: custom builds: no BuildMethod, a BuildMethod that is not a runtime name or makefil… ✅ pass Head: all three builds exit 1 with 'Build Failed' and the expected messages: missing BuildMethod -> "Runtime 'custom' requires Metadata.BuildMethod ..."; esbuild -> "Metadata.BuildMethod 'esbuild' is…
S3 Runtime: custom with BuildMethod makefile builds natively through the function's Makefile build-Function target. ✅ pass Head: makefile build exits 0, 'Build Succeeded', no Traceback. Log shows CustomMakeBuilder:MakeBuild running the build-Function target (cp, pip install, rm bin). Artifact has main.py, requirements.tx…
S4 Main invoke path: sam local invoke of a Runtime: custom function with --invoke-image, in both the global and the per-fu… ✅ pass Head: global and per-function --invoke-image invokes of CmrFunction both exit 0 with {"statusCode": 200, body message 'Hello world customer managed runtime'}; stderr shows value1/value2/value3, no Tr…
S5 A runtime image that starts only from its own ENTRYPOINT and has no /var/runtime/bootstrap: the local invoke must run t… ✅ pass docker build of the own-ENTRYPOINT image succeeded. sam local invoke with --invoke-image sam-test-cmr-own-entrypoint:v1 --skip-pull-image exits 0 with statusCode 200 and the expected message; no Runt…
S6 RuntimeConfig error paths in runtime_resolver.py when no --invoke-image is given and no AWS credentials exist: a valid … ✅ pass Run with all AWS credential env vars unset, config/credentials files pointed at /nonexistent, HOME redirected, EC2 metadata disabled and AWS_ENDPOINT_URL set to unreachable 127.0.0.1:9 so no real AWS…
S7 A Runtime: custom function with a local layer goes through the layer image path, where the image version comes from the… ✅ pass Head: invoke of Runtime: custom function with a local layer and --invoke-image public.ecr.aws/lambda/python:3.13 exits 0, stdout "from-layer". Layer image built as samcli/lambda-custom:32ac985690b0-x…
S8 Run the unit tests the PR adds or changes, covering the resolver, image, container, workflow config, app builder, build… ✅ pass Head unit tests: docker/lambdafn/architecture/telemetry set 456 passed; build_module/build_context/local_lambda/function_provider set 543 passed. 0 failed, 0 errors.
Runner's notes in full
  • S1: Head: samdev build (SAM_CLI_DEV=1 entry point) exits 0, 'Build Succeeded', no Traceback. Function (Runtime: custom, BuildMethod python3.11) and RegularFunction (python3.11) both built with PythonPipBuilder; each contains main.py, requirements.txt and requests/. Built template keeps Runtime: custom with RuntimeArn/RuntimeAlias. Base: exit 1, "Error: 'custom' runtime is not supported".
  • S2: Head: all three builds exit 1 with 'Build Failed' and the expected messages: missing BuildMethod -> "Runtime 'custom' requires Metadata.BuildMethod ..."; esbuild -> "Metadata.BuildMethod 'esbuild' is not supported for Runtime 'custom' ..."; makefile + --use-container -> "... has no default build image for --use-container. Supply one with --build-image". Docker container count stayed 0, no Traceback. Base: all three fail with "'custom' runtime is not supported".
  • S3: Head: makefile build exits 0, 'Build Succeeded', no Traceback. Log shows CustomMakeBuilder:MakeBuild running the build-Function target (cp, pip install, rm bin). Artifact has main.py, requirements.txt, requests/ and no bin/. Base: exit 1, "'custom' runtime is not supported". The head log's exit code 1 comes from the trailing 'grep -c Traceback' printing 0, not from the build.
  • S4: Head: global and per-function --invoke-image invokes of CmrFunction both exit 0 with {"statusCode": 200, body message 'Hello world customer managed runtime'}; stderr shows value1/value2/value3, no Traceback. Regular python3.13 function also exits 0 with the same JSON. Images present: public.ecr.aws/lambda/python:3.13, :32ac985690b0-rapid-x86_64 (matches sha256 of the URI, first 12 hex) and :3.13-rapid-x86_64. Base: CmrFunction invokes exit 1 with 'Unsupported Lambda runtime: custom'. Base's regular invoke hit HandlerNotFound only because base main.py lacks the handler the PR adds.
  • S5: docker build of the own-ENTRYPOINT image succeeded. sam local invoke with --invoke-image sam-test-cmr-own-entrypoint:v1 --skip-pull-image exits 0 with statusCode 200 and the expected message; no Runtime.InvalidEntrypoint or Traceback in stderr. Image list shows sam-test-cmr-own-entrypoint:v1 and sam-test-cmr-own-entrypoint:2eea35a46ffd-rapid-x86_64.
  • S6: Run with all AWS credential env vars unset, config/credentials files pointed at /nonexistent, HOME redirected, EC2 metadata disabled and AWS_ENDPOINT_URL set to unreachable 127.0.0.1:9 so no real AWS or metadata endpoint could be contacted. All four cases exit 1, empty stdout, no container started, no Traceback. Messages: cfg -> 'Resolving the runtime image for RuntimeConfig requires AWS credentials...'; none -> '...the function has no RuntimeConfig...'; import -> '...must be literal values or template parameters...'; noalias -> 'RuntimeConfig is missing RuntimeAlias.' boto3 1.44.5 / botocore 1.44.7 created the lambda-core client without an unknown-service error.
  • S7: Head: invoke of Runtime: custom function with a local layer and --invoke-image public.ecr.aws/lambda/python:3.13 exits 0, stdout "from-layer". Layer image built as samcli/lambda-custom:32ac985690b0-x86_64-. No Traceback, ImportModuleError or tag/version error.

🤖 Automated hands-on test — not a review approval · model claude-opus-5.5 · Kiro kiro-cli 2.33.1 · build LambdaToolingHandsOn-Docker:05db54a5-5945-4aaa-bff0-452cf4a35a80 · commit 3278b65

History (1)
Commit Result When (UTC) Build
3278b65 No problems observed 2026-11-19 23:06 LambdaToolingHandsOn-Docker:05db54a5-5945-4aaa-bff0-452cf4a35a80

@vicheey vicheey changed the title chore: merge private features into develop chore: merge features support into develop Nov 19, 2026
@licjun
licjun added this pull request to the merge queue Nov 19, 2026
Merged via the queue into develop with commit 22b0d61 Nov 19, 2026
58 checks passed
@licjun
licjun deleted the features-202611192207 branch November 19, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build sam build command area/local/invoke sam local invoke command area/local/start-api sam local start-api command area/local/start-invoke area/schema JSON schema file pr/internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants