From 15c3e1f34dbe438fae9e1ad10f9ccde8fb899e1c Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 5 Jan 2026 17:02:41 +0000 Subject: [PATCH 1/4] feat: preemptively add dotnet10 to benchmarks --- README.md | 2 ++ manifest.json | 20 +++++++++++++ s3-uploader/runtimes/dotnet10/Dockerfile | 12 ++++++++ s3-uploader/runtimes/dotnet10/build.sh | 8 ++++++ s3-uploader/runtimes/dotnet10/src/Function.cs | 13 +++++++++ .../runtimes/dotnet10/src/LambdaPerf.csproj | 13 +++++++++ .../runtimes/dotnet10/src/appsettings.json | 1 + .../src/aws-lambda-tools-defaults.json | 5 ++++ .../Dockerfile | 15 ++++++++++ .../dotnet10_aot_on_provided_al2023/build.sh | 20 +++++++++++++ .../src/Function.cs | 28 +++++++++++++++++++ .../src/LambdaPerf.csproj | 26 +++++++++++++++++ .../src/aws-lambda-tools-defaults.json | 9 ++++++ 13 files changed, 172 insertions(+) create mode 100644 s3-uploader/runtimes/dotnet10/Dockerfile create mode 100644 s3-uploader/runtimes/dotnet10/build.sh create mode 100644 s3-uploader/runtimes/dotnet10/src/Function.cs create mode 100644 s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj create mode 100644 s3-uploader/runtimes/dotnet10/src/appsettings.json create mode 100644 s3-uploader/runtimes/dotnet10/src/aws-lambda-tools-defaults.json create mode 100644 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/Dockerfile create mode 100644 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh create mode 100644 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/Function.cs create mode 100644 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj create mode 100644 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json diff --git a/README.md b/README.md index f390b89d71..a1dddd87cb 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ An ultra simple hello-world function has been written in each AWS supported runt - `python3.14` - `dotnet6` - `dotnet8` +- `dotnet10` - `java11` - `java17` - `java21` @@ -53,6 +54,7 @@ in addition to the following custom runtimes: - `dotnet8 aot` on `provided.al2` - `dotnet8 aot` on `provided.al2023` - `dotnet9 aot` on `provided.al2023` +- `dotnet10 aot` on `provided.al2023` - `quarkus native` on `provided.al2` - `graalvm java17` on `provided.al2` - `graalvm java21` on `provided.al2023` diff --git a/manifest.json b/manifest.json index e3485eafb7..04ce957e90 100644 --- a/manifest.json +++ b/manifest.json @@ -151,6 +151,26 @@ "baseImage": "public.ecr.aws/lambda/provided:al2023" } }, + { + "displayName": "dotnet10", + "runtime": "dotnet10", + "handler": "LambdaPerf::LambdaPerf.Function::Handler", + "path": "dotnet10", + "architectures": ["x86_64", "arm64"], + "image": { + "baseImage": "public.ecr.aws/lambda/dotnet:10" + } + }, + { + "displayName": "dotnet10 aot (prov.al2023)", + "runtime": "provided.al2023", + "handler": "bootstrap", + "path": "dotnet10_aot_on_provided_al2023", + "architectures": ["x86_64", "arm64"], + "image": { + "baseImage": "public.ecr.aws/lambda/provided:al2023" + } + }, { "displayName": "java11", "runtime": "java11", diff --git a/s3-uploader/runtimes/dotnet10/Dockerfile b/s3-uploader/runtimes/dotnet10/Dockerfile new file mode 100644 index 0000000000..08c8a47787 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder +ARG ARCH +RUN apt-get update +RUN apt-get install -y zip +RUN dotnet tool install -g Amazon.Lambda.Tools +WORKDIR /tmp +COPY src . +RUN export PATH="$PATH:/root/.dotnet/tools" && dotnet lambda package -farch ${ARCH} --configuration Release --framework net10.0 --output-package /tmp/code.zip + +FROM scratch +COPY --from=builder /tmp/code.zip / +ENTRYPOINT ["/code.zip"] \ No newline at end of file diff --git a/s3-uploader/runtimes/dotnet10/build.sh b/s3-uploader/runtimes/dotnet10/build.sh new file mode 100644 index 0000000000..df756da057 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/build.sh @@ -0,0 +1,8 @@ +DIR_NAME="./runtimes/$1" +ARCH=$2 + +rm ${DIR_NAME}/code_${ARCH}.zip 2> /dev/null + +docker build ${DIR_NAME} --build-arg ARCH=${ARCH} -t maxday/dotnet10 +dockerId=$(docker create maxday/dotnet10) +docker cp $dockerId:/code.zip ${DIR_NAME}/code_${ARCH}.zip \ No newline at end of file diff --git a/s3-uploader/runtimes/dotnet10/src/Function.cs b/s3-uploader/runtimes/dotnet10/src/Function.cs new file mode 100644 index 0000000000..8c2d0d6ea6 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/src/Function.cs @@ -0,0 +1,13 @@ +using Amazon.Lambda.Core; + +[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] +namespace LambdaPerf +{ + public class Function + { + public object Handler() + { + return new { statusCode = 200 }; + } + } +} \ No newline at end of file diff --git a/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj b/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj new file mode 100644 index 0000000000..aef689017d --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj @@ -0,0 +1,13 @@ + + + net10.0 + true + Lambda + true + true + + + + + + diff --git a/s3-uploader/runtimes/dotnet10/src/appsettings.json b/s3-uploader/runtimes/dotnet10/src/appsettings.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/src/appsettings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/s3-uploader/runtimes/dotnet10/src/aws-lambda-tools-defaults.json b/s3-uploader/runtimes/dotnet10/src/aws-lambda-tools-defaults.json new file mode 100644 index 0000000000..8e8cb00c4c --- /dev/null +++ b/s3-uploader/runtimes/dotnet10/src/aws-lambda-tools-defaults.json @@ -0,0 +1,5 @@ +{ + "configuration": "Release", + "framework": "net10.0", + "function-runtime": "dotnet10" +} \ No newline at end of file diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/Dockerfile b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/Dockerfile new file mode 100644 index 0000000000..86fbe36e01 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/Dockerfile @@ -0,0 +1,15 @@ +ARG IMAGE_TAG +FROM $IMAGE_TAG/amazonlinux:2023 AS builder +ARG ARCH +WORKDIR /tmp +COPY src . +RUN yum update -y && yum install -y clang zlib-devel krb5-devel openssl-devel zip gzip tar wget +RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && chmod +x ./dotnet-install.sh && ./dotnet-install.sh --channel 10.0 +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 +ENV SSL_CERT_FILE=/tmp/noop +RUN /root/.dotnet/dotnet publish --configuration Release --arch $ARCH --output /tmp/publish +RUN zip -j /tmp/code.zip /tmp/publish/bootstrap + +FROM scratch +COPY --from=builder /tmp/code.zip / +ENTRYPOINT ["/code.zip"] diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh new file mode 100644 index 0000000000..ba8f73b2a8 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh @@ -0,0 +1,20 @@ +DIR_NAME="./runtimes/$1" + +if [ $2 = "x86_64" ]; then + ARCH="x64" + IMAGE_TAG="amd64" + PLATFORM="linux/amd64" +elif [ $2 = "arm64" ]; then + ARCH="arm64" + IMAGE_TAG="arm64v8" + PLATFORM="linux/arm64" +else + echo "The process architecture $2 is set incorrectly. The value can only be either x86_64 or arm64." + exit 1 +fi + +rm ${DIR_NAME}/code_${2}.zip 2> /dev/null + +docker build --platform ${PLATFORM} ${DIR_NAME} --build-arg ARCH=${ARCH} --build-arg IMAGE_TAG=${IMAGE_TAG} -t maxday/dotnet10_on_provided_al2023_${2} +dockerId=$(docker create maxday/dotnet10_on_provided_al2023_${2}) +docker cp $dockerId:/code.zip ${DIR_NAME}/code_${2}.zip diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/Function.cs b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/Function.cs new file mode 100644 index 0000000000..b2f36dd24d --- /dev/null +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/Function.cs @@ -0,0 +1,28 @@ +using Amazon.Lambda.RuntimeSupport; +using Amazon.Lambda.Serialization.SystemTextJson; +using System.Text.Json.Serialization; + +namespace LambdaPerf; + +public class Function +{ + private static async Task Main() + { + await LambdaBootstrapBuilder.Create(FunctionHandler, new SourceGeneratorLambdaJsonSerializer()) + .Build() + .RunAsync(); + } + + public static StatusResponse FunctionHandler() + { + return new StatusResponse(StatusCode: 200); + } +} + +public record StatusResponse(int StatusCode); + +[JsonSerializable(typeof(StatusResponse))] +[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] +public partial class LambdaFunctionJsonSerializerContext : JsonSerializerContext +{ +} diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj new file mode 100644 index 0000000000..822a3c03d6 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj @@ -0,0 +1,26 @@ + + + + Lambda + Exe + bootstrap + net10.0 + enable + enable + true + true + false + true + Speed + true + + + + + + + + + + + diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json new file mode 100644 index 0000000000..7715d69ce0 --- /dev/null +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json @@ -0,0 +1,9 @@ +{ + "configuration": "Release", + "environment-variables" : "SSL_CERT_FILE=/tmp/noop", + "framework": "net10.0", + "function-runtime": "provided.al2023", + "function-memory-size": 256, + "function-timeout": 30, + "function-handler": "bootstrap" +} From dc38500abb1fd0f645a011b713ee131d50e91a34 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 5 Jan 2026 17:07:27 +0000 Subject: [PATCH 2/4] chore: make script executable --- s3-uploader/runtimes/dotnet10/build.sh | 0 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 s3-uploader/runtimes/dotnet10/build.sh mode change 100644 => 100755 s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh diff --git a/s3-uploader/runtimes/dotnet10/build.sh b/s3-uploader/runtimes/dotnet10/build.sh old mode 100644 new mode 100755 diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/build.sh old mode 100644 new mode 100755 From 57e0e188049ab242f15320a6aeae67f75ab197a5 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 5 Jan 2026 17:31:07 +0000 Subject: [PATCH 3/4] fix: use correct Microsoft packages for aot --- .../dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj index 822a3c03d6..2289505d61 100644 --- a/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj +++ b/s3-uploader/runtimes/dotnet10_aot_on_provided_al2023/src/LambdaPerf.csproj @@ -1,4 +1,4 @@ - + Lambda @@ -19,8 +19,8 @@ - - + + From b7f36dcad1f3d57f0ea3b2c1cc7aff5bc78b97cc Mon Sep 17 00:00:00 2001 From: Samuel Cox Date: Sat, 10 Jan 2026 18:41:57 +0000 Subject: [PATCH 4/4] chore: update to latest amazon packages for dotnet10 --- s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj b/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj index aef689017d..e2501de41f 100644 --- a/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj +++ b/s3-uploader/runtimes/dotnet10/src/LambdaPerf.csproj @@ -7,7 +7,7 @@ true - - + +