From de0996e93597252c33d796b27b8defa9a3c3dfaa Mon Sep 17 00:00:00 2001 From: liustve Date: Thu, 10 Apr 2025 19:59:15 +0000 Subject: [PATCH 1/2] test --- .../dotnet-lambda-layer-perf-test.yml | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/dotnet-lambda-layer-perf-test.yml diff --git a/.github/workflows/dotnet-lambda-layer-perf-test.yml b/.github/workflows/dotnet-lambda-layer-perf-test.yml new file mode 100644 index 000000000..689865c17 --- /dev/null +++ b/.github/workflows/dotnet-lambda-layer-perf-test.yml @@ -0,0 +1,102 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +name: DotNet Lambda Layer Performance Test +on: + push: + branches: + - perf_testing_lambda_layer_dotnet + workflow_dispatch: + inputs: + test_runs: + description: 'Number of test runs to perform' + required: true + default: 20 + type: number + +jobs: + dotnet-lambda-layer-performance-test: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + env: + NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }} + + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + + - name: Checkout aws-otel-dotnet-instrumentation + uses: actions/checkout@v4 + with: + repository: aws-observability/aws-otel-dotnet-instrumentation + path: aws-otel-dotnet-instrumentation + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + + - name: Build and Deploy DotNet Sample App and Lambda Layer + run: | + cd aws-otel-dotnet-instrumentation/sample-applications/lambda-test-apps/SimpleLambdaFunction/ + ./build-and-deploy.sh + + - name: Checkout current repository + uses: actions/checkout@v4 + with: + path: current-repo + + - name: Run Cold Start Iterations for Base Lambda + Lambda Layer + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh false SimpleLambdaFunction + + - name: Remove Application Signals Lambda Layer + run: | + echo "Removing Lambda layer..." + + OUTPUT=$(aws lambda update-function-configuration \ + --function-name SimpleLambdaFunction \ + --layers []) + + echo "Lambda configuration:" + echo "$OUTPUT" + + LAYERS=$(echo "$OUTPUT" | jq -r '.Layers | length') + + if [ "$LAYERS" -ne 0 ]; then + echo "::error::Found $LAYERS layer(s) still attached to the function" + echo "::error::Layer details:" + echo "$OUTPUT" | jq -r '.Layers' + exit 1 + else + echo "✅ Layers successfully removed" + fi + + - name: Run Cold Start Iterations for Base Lambda + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh true SimpleLambdaFunction + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: performance-test-results + path: | + no_layer_results.txt + layer_results.txt + retention-days: 90 + + - name: Cleanup Terraform Resources + if: success() || failure() || cancelled() + run: | + cd aws-otel-dotnet-instrumentation/sample-applications/lambda-test-apps/SimpleLambdaFunction/terraform/lambda + echo "Starting Terraform cleanup..." + terraform init + terraform destroy -auto-approve \ No newline at end of file From 742c7bfde20322d1ee44df7a48b4d50c6f73757d Mon Sep 17 00:00:00 2001 From: liustve Date: Thu, 10 Apr 2025 20:57:31 +0000 Subject: [PATCH 2/2] add automated Lambda Layer performance testing for .net --- .../dotnet-lambda-layer-perf-test.yml | 21 ++++++++++++++----- .../workflows/node-lambda-layer-perf-test.yml | 2 +- .../python-lambda-layer-perf-test.yml | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet-lambda-layer-perf-test.yml b/.github/workflows/dotnet-lambda-layer-perf-test.yml index 689865c17..8ed92a4c0 100644 --- a/.github/workflows/dotnet-lambda-layer-perf-test.yml +++ b/.github/workflows/dotnet-lambda-layer-perf-test.yml @@ -3,9 +3,6 @@ name: DotNet Lambda Layer Performance Test on: - push: - branches: - - perf_testing_lambda_layer_dotnet workflow_dispatch: inputs: test_runs: @@ -13,6 +10,12 @@ on: required: true default: 20 type: number + + dotnet-version: + description: 'dotnet version to use' + required: true + default: '8.0.x' + type: string jobs: dotnet-lambda-layer-performance-test: @@ -37,10 +40,18 @@ jobs: repository: aws-observability/aws-otel-dotnet-instrumentation path: aws-otel-dotnet-instrumentation + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ github.event.inputs.dotnet-version }} + + - name: Setup AWS Lambda Tools + run: dotnet tool install -g Amazon.Lambda.Tools + - name: Setup Terraform uses: hashicorp/setup-terraform@v2 - - name: Build and Deploy DotNet Sample App and Lambda Layer + - name: Build and Deploy .NET Sample App and Lambda Layer run: | cd aws-otel-dotnet-instrumentation/sample-applications/lambda-test-apps/SimpleLambdaFunction/ ./build-and-deploy.sh @@ -87,7 +98,7 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v4 with: - name: performance-test-results + name: dotnet-performance-test-results path: | no_layer_results.txt layer_results.txt diff --git a/.github/workflows/node-lambda-layer-perf-test.yml b/.github/workflows/node-lambda-layer-perf-test.yml index 3955ae20e..c3e355c21 100644 --- a/.github/workflows/node-lambda-layer-perf-test.yml +++ b/.github/workflows/node-lambda-layer-perf-test.yml @@ -104,7 +104,7 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v4 with: - name: performance-test-results + name: js-performance-test-results path: | no_layer_results.txt layer_results.txt diff --git a/.github/workflows/python-lambda-layer-perf-test.yml b/.github/workflows/python-lambda-layer-perf-test.yml index 38d1c259e..9b5fca1c8 100644 --- a/.github/workflows/python-lambda-layer-perf-test.yml +++ b/.github/workflows/python-lambda-layer-perf-test.yml @@ -95,7 +95,7 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v4 with: - name: performance-test-results + name: python-performance-test-results path: | no_layer_results.txt layer_results.txt