From 970acf11e8f50a709b1dab31e97f3992e610e545 Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 11:42:18 +0700 Subject: [PATCH 01/25] Added build and deploy for non-linux user --- example/Dockerfile | 8 ++++++++ example/README.md | 13 +++++++++++++ example/build.sh | 13 +++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 example/Dockerfile diff --git a/example/Dockerfile b/example/Dockerfile new file mode 100644 index 0000000..a37093e --- /dev/null +++ b/example/Dockerfile @@ -0,0 +1,8 @@ +# docker build -t lambdanative . +# docker run --rm -v $(pwd)/publish:/app/out lambdanative + +FROM microsoft/dotnet:2.1-sdk AS publish +WORKDIR /app +ADD . ./ +RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y +ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-o", "out", "-r", "linux-x64"] diff --git a/example/README.md b/example/README.md index bd32de4..c4d7940 100644 --- a/example/README.md +++ b/example/README.md @@ -123,6 +123,19 @@ Here are instructions on how to compile the example project on Ubuntu using EC2. You now have a native executable file named `bootstrap`. +# Compiling with Docker (For Non-Linux User) + +* Create Docker image +```bash +docker build -t lambdanative . +``` +* Run script to compile +```bash +sh build.sh +``` + +And we have `package.zip` in folder `publish` for ready to deploy + # Deployment Now that you have a native executable named `bootstrap`, you can deploy it to AWS Lambda. It's important that the file is named `bootstrap` as this is a convention that lets AWS Lambda know which file to execute. diff --git a/example/build.sh b/example/build.sh index 3054e23..baeeb9f 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,6 +1,11 @@ #!/bin/bash -dotnet publish -r linux-x64 -c release -cp bin/release/netcoreapp*/linux-x64/native/* bootstrap -# zip package.zip bootstrap -# aws s3 cp package.zip s3:///package.zip +rm -f $(pwd)/publish/bootstrap +rm -f $(pwd)/publish/package.zip + +docker run --rm -v $(pwd)/publish:/app/out lambdanative +cd publish +cp LambdaNative.Example bootstrap +zip package.zip bootstrap + +# aws s3 cp package.zip s3:///package.zip \ No newline at end of file From 6cab222e1cc0f12c579d10a86d7aae3699e3c66c Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 16:26:05 +0700 Subject: [PATCH 02/25] Fixed docker build, not copy file to container --- example/Dockerfile | 7 +++---- example/build.sh | 16 +++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/example/Dockerfile b/example/Dockerfile index a37093e..d23fb31 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -1,8 +1,7 @@ # docker build -t lambdanative . -# docker run --rm -v $(pwd)/publish:/app/out lambdanative +# docker run --rm -v $(pwd):/app lambdanative -FROM microsoft/dotnet:2.1-sdk AS publish +FROM microsoft/dotnet:2.2-sdk AS build-env WORKDIR /app -ADD . ./ RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y -ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-o", "out", "-r", "linux-x64"] +ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-r", "linux-x64"] \ No newline at end of file diff --git a/example/build.sh b/example/build.sh index baeeb9f..6f03aef 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,11 +1,13 @@ #!/bin/bash -rm -f $(pwd)/publish/bootstrap -rm -f $(pwd)/publish/package.zip +# +# SHOULD BUILD IMAGE BEFORE +# docker build -t lambdanative . +# -docker run --rm -v $(pwd)/publish:/app/out lambdanative -cd publish -cp LambdaNative.Example bootstrap +rm -f $(pwd)/bootstrap +rm -f $(pwd)/package.zip +docker run --rm -v $(pwd):/app lambdanative +cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap zip package.zip bootstrap - -# aws s3 cp package.zip s3:///package.zip \ No newline at end of file +# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file From 9a85b24baeeb4854a247da00b641ece2780e25b6 Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 17:48:32 +0700 Subject: [PATCH 03/25] Added more library --- example/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/Dockerfile b/example/Dockerfile index d23fb31..a3411a6 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -3,5 +3,5 @@ FROM microsoft/dotnet:2.2-sdk AS build-env WORKDIR /app -RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y +RUN apt-get update && apt-get install cmake clang-3.9 libicu-dev uuid-dev libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-r", "linux-x64"] \ No newline at end of file From edd39f7a746a4a77ccd5c5f09b0a953bf6181063 Mon Sep 17 00:00:00 2001 From: iFew Date: Mon, 22 Apr 2019 14:06:56 +0700 Subject: [PATCH 04/25] Added build script for Docker build --- example/README.md | 2 +- example/build-docker.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 example/build-docker.sh diff --git a/example/README.md b/example/README.md index c4d7940..2a382d1 100644 --- a/example/README.md +++ b/example/README.md @@ -127,7 +127,7 @@ You now have a native executable file named `bootstrap`. * Create Docker image ```bash -docker build -t lambdanative . +sh build-docker.sh ``` * Run script to compile ```bash diff --git a/example/build-docker.sh b/example/build-docker.sh new file mode 100755 index 0000000..4e2817f --- /dev/null +++ b/example/build-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build -t lambdanative . \ No newline at end of file From 0ab97e1f2f19dcaf0c16c83a7b72c23397db7ec4 Mon Sep 17 00:00:00 2001 From: iFew Date: Mon, 22 Apr 2019 14:10:03 +0700 Subject: [PATCH 05/25] Added note for user have existed docker image --- example/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/README.md b/example/README.md index 2a382d1..c2d498e 100644 --- a/example/README.md +++ b/example/README.md @@ -136,6 +136,8 @@ sh build.sh And we have `package.zip` in folder `publish` for ready to deploy +If your source code changed, you can run only "build.sh" for generate native file + # Deployment Now that you have a native executable named `bootstrap`, you can deploy it to AWS Lambda. It's important that the file is named `bootstrap` as this is a convention that lets AWS Lambda know which file to execute. From 8de6e1de687a741b18e5fcb3d87de4b646167ae0 Mon Sep 17 00:00:00 2001 From: iFew Date: Wed, 24 Apr 2019 15:16:54 +0700 Subject: [PATCH 06/25] Added script build by Docker and rollback build by script --- example/build-docker.sh | 12 +++++++++++- example/build.sh | 15 ++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/example/build-docker.sh b/example/build-docker.sh index 4e2817f..6f03aef 100755 --- a/example/build-docker.sh +++ b/example/build-docker.sh @@ -1,3 +1,13 @@ #!/bin/bash -docker build -t lambdanative . \ No newline at end of file +# +# SHOULD BUILD IMAGE BEFORE +# docker build -t lambdanative . +# + +rm -f $(pwd)/bootstrap +rm -f $(pwd)/package.zip +docker run --rm -v $(pwd):/app lambdanative +cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap +zip package.zip bootstrap +# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file diff --git a/example/build.sh b/example/build.sh index 6f03aef..e238b73 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,13 +1,6 @@ #!/bin/bash -# -# SHOULD BUILD IMAGE BEFORE -# docker build -t lambdanative . -# - -rm -f $(pwd)/bootstrap -rm -f $(pwd)/package.zip -docker run --rm -v $(pwd):/app lambdanative -cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap -zip package.zip bootstrap -# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file +dotnet publish -r linux-x64 -c release +cp bin/release/netcoreapp*/linux-x64/native/* bootstrap +# zip package.zip bootstrap +# aws s3 cp package.zip s3:///package.zip \ No newline at end of file From 83e7bc3cd208d60f8cf51ef56ba7af661cd85f00 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 13 Nov 2019 19:02:12 +0700 Subject: [PATCH 07/25] Update .NET Core version --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index be6957e..3cd92d1 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.1.503" + "version": "2.2.402" } } \ No newline at end of file From 46319850ec02b21a6573f837b651a9cc5a7dd741 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 13 Nov 2019 19:02:32 +0700 Subject: [PATCH 08/25] Change sample information --- src/LambdaNative.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LambdaNative.csproj b/src/LambdaNative.csproj index 44b4c5a..28f6d20 100644 --- a/src/LambdaNative.csproj +++ b/src/LambdaNative.csproj @@ -5,9 +5,9 @@ netstandard2.0 1.0.0 LambdaNative - Zac Charles + iFew and Benz Make .NET AWS Lambda functions start 10x faster using LambdaNative - LambdaNative + iFew.LambdaNative aws,lambda,native,performance https://github.com/zaccharles/lambda-native https://raw.githubusercontent.com/zaccharles/lambda-native/master/assets/logo.png From 5e40a69c696df881e9cc0cc28defee6abe679d87 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 13 Nov 2019 19:02:58 +0700 Subject: [PATCH 09/25] Added timeout httpclient for solved lambda connection timeout 100sec --- src/LambdaNative.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LambdaNative.cs b/src/LambdaNative.cs index 6bb4ced..2cd15a7 100644 --- a/src/LambdaNative.cs +++ b/src/LambdaNative.cs @@ -29,7 +29,10 @@ public static class LambdaNative private static void Run(IHandlerRunner runner) { - ILambdaRuntime runtime = new LambdaRuntime(new SystemEnvironment(), new SystemDateTime(), new HttpClient()); + HttpClient httpClient = new HttpClient(); + httpClient.Timeout = TimeSpan.FromMinutes(10); + + ILambdaRuntime runtime = new LambdaRuntime(new SystemEnvironment(), new SystemDateTime(), httpClient); ILambdaBootstrap bootstrap = new LambdaBootstrap(runtime, runner); bootstrap.Initialize(); From 4cbdc0dad20d1cd838e6924abed0f18e7f466a4a Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 11:42:18 +0700 Subject: [PATCH 10/25] Added build and deploy for non-linux user --- example/Dockerfile | 8 ++++++++ example/README.md | 13 +++++++++++++ example/build.sh | 13 +++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 example/Dockerfile diff --git a/example/Dockerfile b/example/Dockerfile new file mode 100644 index 0000000..a37093e --- /dev/null +++ b/example/Dockerfile @@ -0,0 +1,8 @@ +# docker build -t lambdanative . +# docker run --rm -v $(pwd)/publish:/app/out lambdanative + +FROM microsoft/dotnet:2.1-sdk AS publish +WORKDIR /app +ADD . ./ +RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y +ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-o", "out", "-r", "linux-x64"] diff --git a/example/README.md b/example/README.md index bd32de4..c4d7940 100644 --- a/example/README.md +++ b/example/README.md @@ -123,6 +123,19 @@ Here are instructions on how to compile the example project on Ubuntu using EC2. You now have a native executable file named `bootstrap`. +# Compiling with Docker (For Non-Linux User) + +* Create Docker image +```bash +docker build -t lambdanative . +``` +* Run script to compile +```bash +sh build.sh +``` + +And we have `package.zip` in folder `publish` for ready to deploy + # Deployment Now that you have a native executable named `bootstrap`, you can deploy it to AWS Lambda. It's important that the file is named `bootstrap` as this is a convention that lets AWS Lambda know which file to execute. diff --git a/example/build.sh b/example/build.sh index 3054e23..baeeb9f 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,6 +1,11 @@ #!/bin/bash -dotnet publish -r linux-x64 -c release -cp bin/release/netcoreapp*/linux-x64/native/* bootstrap -# zip package.zip bootstrap -# aws s3 cp package.zip s3:///package.zip +rm -f $(pwd)/publish/bootstrap +rm -f $(pwd)/publish/package.zip + +docker run --rm -v $(pwd)/publish:/app/out lambdanative +cd publish +cp LambdaNative.Example bootstrap +zip package.zip bootstrap + +# aws s3 cp package.zip s3:///package.zip \ No newline at end of file From 4aee5d58410a7e3bd2ebcf6d9c3edd4a0416b1f3 Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 16:26:05 +0700 Subject: [PATCH 11/25] Fixed docker build, not copy file to container --- example/Dockerfile | 7 +++---- example/build.sh | 16 +++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/example/Dockerfile b/example/Dockerfile index a37093e..d23fb31 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -1,8 +1,7 @@ # docker build -t lambdanative . -# docker run --rm -v $(pwd)/publish:/app/out lambdanative +# docker run --rm -v $(pwd):/app lambdanative -FROM microsoft/dotnet:2.1-sdk AS publish +FROM microsoft/dotnet:2.2-sdk AS build-env WORKDIR /app -ADD . ./ RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y -ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-o", "out", "-r", "linux-x64"] +ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-r", "linux-x64"] \ No newline at end of file diff --git a/example/build.sh b/example/build.sh index baeeb9f..6f03aef 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,11 +1,13 @@ #!/bin/bash -rm -f $(pwd)/publish/bootstrap -rm -f $(pwd)/publish/package.zip +# +# SHOULD BUILD IMAGE BEFORE +# docker build -t lambdanative . +# -docker run --rm -v $(pwd)/publish:/app/out lambdanative -cd publish -cp LambdaNative.Example bootstrap +rm -f $(pwd)/bootstrap +rm -f $(pwd)/package.zip +docker run --rm -v $(pwd):/app lambdanative +cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap zip package.zip bootstrap - -# aws s3 cp package.zip s3:///package.zip \ No newline at end of file +# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file From e62eca9d97370c2ed30448395ec4d6abc59e3425 Mon Sep 17 00:00:00 2001 From: iFew Date: Fri, 19 Apr 2019 17:48:32 +0700 Subject: [PATCH 12/25] Added more library --- example/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/Dockerfile b/example/Dockerfile index d23fb31..a3411a6 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -3,5 +3,5 @@ FROM microsoft/dotnet:2.2-sdk AS build-env WORKDIR /app -RUN apt-get update && apt-get install clang-3.9 libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y +RUN apt-get update && apt-get install cmake clang-3.9 libicu-dev uuid-dev libcurl4-openssl-dev zlib1g-dev libkrb5-dev -y ENTRYPOINT ["dotnet", "publish", "-c", "Release", "-r", "linux-x64"] \ No newline at end of file From f014694266897cd5f3312115ba9fac3537085ef0 Mon Sep 17 00:00:00 2001 From: iFew Date: Mon, 22 Apr 2019 14:06:56 +0700 Subject: [PATCH 13/25] Added build script for Docker build --- example/README.md | 2 +- example/build-docker.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 example/build-docker.sh diff --git a/example/README.md b/example/README.md index c4d7940..2a382d1 100644 --- a/example/README.md +++ b/example/README.md @@ -127,7 +127,7 @@ You now have a native executable file named `bootstrap`. * Create Docker image ```bash -docker build -t lambdanative . +sh build-docker.sh ``` * Run script to compile ```bash diff --git a/example/build-docker.sh b/example/build-docker.sh new file mode 100755 index 0000000..4e2817f --- /dev/null +++ b/example/build-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build -t lambdanative . \ No newline at end of file From 22c2200115bd5cb651735b820cc66645c87298c4 Mon Sep 17 00:00:00 2001 From: iFew Date: Mon, 22 Apr 2019 14:10:03 +0700 Subject: [PATCH 14/25] Added note for user have existed docker image --- example/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/README.md b/example/README.md index 2a382d1..c2d498e 100644 --- a/example/README.md +++ b/example/README.md @@ -136,6 +136,8 @@ sh build.sh And we have `package.zip` in folder `publish` for ready to deploy +If your source code changed, you can run only "build.sh" for generate native file + # Deployment Now that you have a native executable named `bootstrap`, you can deploy it to AWS Lambda. It's important that the file is named `bootstrap` as this is a convention that lets AWS Lambda know which file to execute. From 136574a0d2958161510ab370d362a17292ee5795 Mon Sep 17 00:00:00 2001 From: iFew Date: Wed, 24 Apr 2019 15:16:54 +0700 Subject: [PATCH 15/25] Added script build by Docker and rollback build by script --- example/build-docker.sh | 12 +++++++++++- example/build.sh | 15 ++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/example/build-docker.sh b/example/build-docker.sh index 4e2817f..6f03aef 100755 --- a/example/build-docker.sh +++ b/example/build-docker.sh @@ -1,3 +1,13 @@ #!/bin/bash -docker build -t lambdanative . \ No newline at end of file +# +# SHOULD BUILD IMAGE BEFORE +# docker build -t lambdanative . +# + +rm -f $(pwd)/bootstrap +rm -f $(pwd)/package.zip +docker run --rm -v $(pwd):/app lambdanative +cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap +zip package.zip bootstrap +# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file diff --git a/example/build.sh b/example/build.sh index 6f03aef..e238b73 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,13 +1,6 @@ #!/bin/bash -# -# SHOULD BUILD IMAGE BEFORE -# docker build -t lambdanative . -# - -rm -f $(pwd)/bootstrap -rm -f $(pwd)/package.zip -docker run --rm -v $(pwd):/app lambdanative -cp bin/Release/netcoreapp2.1/linux-x64/native/LambdaNative.Example bootstrap -zip package.zip bootstrap -# aws s3 cp package.zip s3://backend-layer [--profile [PROFILE-NAME]] \ No newline at end of file +dotnet publish -r linux-x64 -c release +cp bin/release/netcoreapp*/linux-x64/native/* bootstrap +# zip package.zip bootstrap +# aws s3 cp package.zip s3:///package.zip \ No newline at end of file From 4c9b6e7a21ef3e0a029d4812d2470a08cc5ac9c7 Mon Sep 17 00:00:00 2001 From: ifew Date: Wed, 13 Nov 2019 23:18:07 +0700 Subject: [PATCH 16/25] Fixed for solve AWS Lambda Connection timeout 100ms --- src/LambdaNative.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LambdaNative.cs b/src/LambdaNative.cs index 6bb4ced..1a25ed6 100644 --- a/src/LambdaNative.cs +++ b/src/LambdaNative.cs @@ -29,7 +29,10 @@ public static class LambdaNative private static void Run(IHandlerRunner runner) { - ILambdaRuntime runtime = new LambdaRuntime(new SystemEnvironment(), new SystemDateTime(), new HttpClient()); + HttpClient httpClient = new HttpClient(); + httpClient.Timeout = TimeSpan.FromMinutes(30); + + ILambdaRuntime runtime = new LambdaRuntime(new SystemEnvironment(), new SystemDateTime(), httpClient); ILambdaBootstrap bootstrap = new LambdaBootstrap(runtime, runner); bootstrap.Initialize(); From 7c0924063267fd517645d4bafe694783653edc04 Mon Sep 17 00:00:00 2001 From: ifew Date: Wed, 13 Nov 2019 23:20:43 +0700 Subject: [PATCH 17/25] Updated to .NET Core 2.2 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index be6957e..3cd92d1 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.1.503" + "version": "2.2.402" } } \ No newline at end of file From d881d5715d3589c7e6591f6bd98aab97fe1a8b8f Mon Sep 17 00:00:00 2001 From: ifew Date: Thu, 14 Nov 2019 00:14:33 +0700 Subject: [PATCH 18/25] Publish package to Nuget --- README.md | 2 +- src/LambdaNative.csproj | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b9a3a11..4c44336 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Make .NET AWS Lambda functions start 10x faster using LambdaNative. [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) [![Build status](https://ci.appveyor.com/api/projects/status/5x6prdi6oeonxbm7/branch/master?svg=true)](https://ci.appveyor.com/project/zaccharles/lambda-native/branch/master) -[![nuget](https://img.shields.io/nuget/v/LambdaNative.svg)](https://www.nuget.org/packages/LambdaNative/) +[![nuget](https://img.shields.io/nuget/v/iFew.LambdaNative.svg)](https://www.nuget.org/packages/iFew.LambdaNative/) # Usage diff --git a/src/LambdaNative.csproj b/src/LambdaNative.csproj index 44b4c5a..e146bb2 100644 --- a/src/LambdaNative.csproj +++ b/src/LambdaNative.csproj @@ -1,19 +1,19 @@ - 1.0.0.0 + 1.0.2.0 netstandard2.0 - 1.0.0 - LambdaNative - Zac Charles - Make .NET AWS Lambda functions start 10x faster using LambdaNative - LambdaNative + 1.0.2 + iFew.LambdaNative + iFew + Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on LambdaNative by zaccharles) + iFew.LambdaNative aws,lambda,native,performance - https://github.com/zaccharles/lambda-native - https://raw.githubusercontent.com/zaccharles/lambda-native/master/assets/logo.png - https://github.com/zaccharles/lambda-native/blob/master/LICENSE + https://github.com/ifew/lambda-native + https://raw.githubusercontent.com/ifew/lambda-native/master/assets/logo.png + https://github.com/ifew/lambda-native/blob/master/LICENSE git - https://github.com/zaccharles/lambda-native + https://github.com/ifew/lambda-native From 0d82d6a953ca158e21c86fa5cca41828fdd6acac Mon Sep 17 00:00:00 2001 From: ifew Date: Thu, 14 Nov 2019 00:21:40 +0700 Subject: [PATCH 19/25] Updated readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c44336..6e3e7e0 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ![](assets/logo-small.png) LambdaNative -Make .NET AWS Lambda functions start 10x faster using LambdaNative. +Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on [lambda-native](https://github.com/zaccharles/lambda-native) by @zaccharles) -[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) -[![Build status](https://ci.appveyor.com/api/projects/status/5x6prdi6oeonxbm7/branch/master?svg=true)](https://ci.appveyor.com/project/zaccharles/lambda-native/branch/master) + +[![Build status](https://ci.appveyor.com/api/projects/status/i8h933ig07xin5r7/branch/master?svg=true)](https://ci.appveyor.com/project/ifew/lambda-native/branch/master) [![nuget](https://img.shields.io/nuget/v/iFew.LambdaNative.svg)](https://www.nuget.org/packages/iFew.LambdaNative/) @@ -28,13 +28,13 @@ For more information and comparisons, please read [this Medium post](https://med ## Prerequisites - * [.NET Core SDK 2.1.503](https://dotnet.microsoft.com/download/dotnet-core/2.1) + * [.NET Core SDK 2.2.402](https://dotnet.microsoft.com/download/dotnet-core/2.2) ## Building Clone repository ```bash -> git clone https://github.com/zaccharles/lambda-native.git +> git clone https://github.com/ifew/lambda-native.git ``` Restore NuGet packages From 829fd6f4798c71ed183ebdf956d848a1c26c4296 Mon Sep 17 00:00:00 2001 From: ifew Date: Thu, 14 Nov 2019 00:29:14 +0700 Subject: [PATCH 20/25] Added name Benz --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e3e7e0..5d64e62 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ![](assets/logo-small.png) LambdaNative Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on [lambda-native](https://github.com/zaccharles/lambda-native) by @zaccharles) - + +Found this solution: Suratchanan Kraidech [![Build status](https://ci.appveyor.com/api/projects/status/i8h933ig07xin5r7/branch/master?svg=true)](https://ci.appveyor.com/project/ifew/lambda-native/branch/master) [![nuget](https://img.shields.io/nuget/v/iFew.LambdaNative.svg)](https://www.nuget.org/packages/iFew.LambdaNative/) From 842978f35ab517a2a685427cf3e765e6a6f42425 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 14 Nov 2019 10:06:48 +0700 Subject: [PATCH 21/25] Reference 12 Hours from AWS Custom Runtime Support --- src/LambdaNative.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LambdaNative.cs b/src/LambdaNative.cs index 1a25ed6..4a625f3 100644 --- a/src/LambdaNative.cs +++ b/src/LambdaNative.cs @@ -29,8 +29,11 @@ public static class LambdaNative private static void Run(IHandlerRunner runner) { + // The Lambda container freezes the process at a point where an HTTP request is in progress. + // We need to make sure we don't timeout waiting for the next invocation. + // Reference 12 Hours from AWS Custom Runtime Support HttpClient httpClient = new HttpClient(); - httpClient.Timeout = TimeSpan.FromMinutes(30); + httpClient.Timeout = TimeSpan.FromHours(12); ILambdaRuntime runtime = new LambdaRuntime(new SystemEnvironment(), new SystemDateTime(), httpClient); ILambdaBootstrap bootstrap = new LambdaBootstrap(runtime, runner); From e83bd1de17fe60097d59c55cdd7218f92fe6e07f Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 14 Nov 2019 10:11:19 +0700 Subject: [PATCH 22/25] Changed Package Name --- README.md | 13 +++++++++---- src/LambdaNative.csproj | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 77655aa..e2d9473 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ # ![](assets/logo-small.png) LambdaNative -Make .NET AWS Lambda functions start 10x faster using LambdaNative. - -[![Build status](https://ci.appveyor.com/api/projects/status/5x6prdi6oeonxbm7/branch/master?svg=true)](https://ci.appveyor.com/project/zaccharles/lambda-native/branch/master) -[![nuget](https://img.shields.io/nuget/v/LambdaNative.svg)](https://www.nuget.org/packages/LambdaNative/) +Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on LambdaNative by zaccharles) +[![Build status](https://ci.appveyor.com/api/projects/status/i8h933ig07xin5r7/branch/master?svg=true)](https://ci.appveyor.com/project/ifew/lambda-native/branch/master) +[![nuget](https://img.shields.io/nuget/v/LambdaNative.svg)](https://www.nuget.org/packages/LambdaNativeCustom/) + +# Changed Log +**Fixed AWS Lambda Connection Timeout** +After the invocating first time (Cold Start) and then waiting for 100 seconds its get error message because of AWS Lambda has default connection timeout at 100 seconds (reference https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-retry-timeout-sdk/) +Found this solution: Suratchanan Kraidech + # Usage To use LambdaNative in your own project, please see the README in the [example](example) directory. diff --git a/src/LambdaNative.csproj b/src/LambdaNative.csproj index e146bb2..d5c2a43 100644 --- a/src/LambdaNative.csproj +++ b/src/LambdaNative.csproj @@ -1,13 +1,13 @@ - 1.0.2.0 + 1.0.0.0 netstandard2.0 - 1.0.2 - iFew.LambdaNative + 1.0.0 + LambdaNativeCustom iFew Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on LambdaNative by zaccharles) - iFew.LambdaNative + LambdaNativeCustom aws,lambda,native,performance https://github.com/ifew/lambda-native https://raw.githubusercontent.com/ifew/lambda-native/master/assets/logo.png From f18ae1ee7bac290e42ea10509fc1af57143e632f Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 14 Nov 2019 10:21:25 +0700 Subject: [PATCH 23/25] Update Readme --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2d9473..90d420a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom fo [![Build status](https://ci.appveyor.com/api/projects/status/i8h933ig07xin5r7/branch/master?svg=true)](https://ci.appveyor.com/project/ifew/lambda-native/branch/master) [![nuget](https://img.shields.io/nuget/v/LambdaNative.svg)](https://www.nuget.org/packages/LambdaNativeCustom/) -# Changed Log -**Fixed AWS Lambda Connection Timeout** +# Change Log + +##### Fixed AWS Lambda Connection Timeout + After the invocating first time (Cold Start) and then waiting for 100 seconds its get error message because of AWS Lambda has default connection timeout at 100 seconds (reference https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-retry-timeout-sdk/) Found this solution: Suratchanan Kraidech @@ -32,13 +34,13 @@ For more information and comparisons, please read [this Medium post](https://med ## Prerequisites - * [.NET Core SDK 2.1.503](https://dotnet.microsoft.com/download/dotnet-core/2.1) + * [.NET Core SDK 2.2.402](https://dotnet.microsoft.com/download/dotnet-core/2.2) ## Building Clone repository ```bash -> git clone https://github.com/zaccharles/lambda-native.git +> git clone https://github.com/ifew/lambda-native.git ``` Restore NuGet packages From b5aa83aea9bf70853524025518e248621ae1a2c7 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 14 Nov 2019 10:22:20 +0700 Subject: [PATCH 24/25] Update Readme --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e2d9473..cebcec2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # ![](assets/logo-small.png) LambdaNative -Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on LambdaNative by zaccharles) +Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom for solved AWS Lambda connection timeout (Based on [LambdaNative](https://github.com/zaccharles/lambda-native) by @zaccharles) [![Build status](https://ci.appveyor.com/api/projects/status/i8h933ig07xin5r7/branch/master?svg=true)](https://ci.appveyor.com/project/ifew/lambda-native/branch/master) [![nuget](https://img.shields.io/nuget/v/LambdaNative.svg)](https://www.nuget.org/packages/LambdaNativeCustom/) -# Changed Log -**Fixed AWS Lambda Connection Timeout** +# Change Log + +##### Fixed AWS Lambda Connection Timeout + After the invocating first time (Cold Start) and then waiting for 100 seconds its get error message because of AWS Lambda has default connection timeout at 100 seconds (reference https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-retry-timeout-sdk/) Found this solution: Suratchanan Kraidech @@ -32,13 +34,13 @@ For more information and comparisons, please read [this Medium post](https://med ## Prerequisites - * [.NET Core SDK 2.1.503](https://dotnet.microsoft.com/download/dotnet-core/2.1) + * [.NET Core SDK 2.2.402](https://dotnet.microsoft.com/download/dotnet-core/2.2) ## Building Clone repository ```bash -> git clone https://github.com/zaccharles/lambda-native.git +> git clone https://github.com/ifew/lambda-native.git ``` Restore NuGet packages From b586de51379a7729087f7a23e85c9db802db4629 Mon Sep 17 00:00:00 2001 From: iFew Date: Thu, 14 Nov 2019 10:23:59 +0700 Subject: [PATCH 25/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cebcec2..3b5d8cb 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Make .NET AWS Lambda functions start 10x faster using LambdaNative and custom fo # Change Log -##### Fixed AWS Lambda Connection Timeout +#### Fixed AWS Lambda Connection Timeout After the invocating first time (Cold Start) and then waiting for 100 seconds its get error message because of AWS Lambda has default connection timeout at 100 seconds (reference https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-retry-timeout-sdk/)