Skip to content

Commit 066aff6

Browse files
authored
[DO NOT MERGE] Updated workflow files after E2E tests (#152)
1 parent 75289c6 commit 066aff6

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

.github/workflows/application-signals-e2e-test.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ jobs:
7575
shortsha="$(git rev-parse --short HEAD)"
7676
echo "SHORT_SHA=$shortsha" >> $GITHUB_OUTPUT
7777
shell: bash
78-
78+
7979
- name: Configure AWS credentials for private ECR
8080
uses: aws-actions/configure-aws-credentials@v4
8181
with:
8282
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME}}
8383
aws-region: us-east-1
84-
84+
8585
- name: Login to Amazon private ECR
8686
id: login-ecr
8787
run: |
@@ -163,3 +163,44 @@ jobs:
163163
aws-region: us-east-1
164164
test-cluster-name: 'eks-windows-manual'
165165
caller-workflow-name: 'main-build'
166+
167+
build-lambda-staging-sample-app:
168+
runs-on: ubuntu-latest
169+
steps:
170+
- uses: actions/checkout@v3
171+
172+
- name: Configure AWS Credentials
173+
uses: aws-actions/configure-aws-credentials@v4
174+
with:
175+
role-to-assume: ${{ secrets.STAING_ARTIFACTS_ACCESS_ROLE }}
176+
role-external-id: ApplicationSignalsDotnet
177+
aws-region: us-east-1
178+
179+
- name: Setup .NET
180+
uses: actions/setup-dotnet@v2
181+
with:
182+
dotnet-version: '8.0.x'
183+
184+
- name: Setup .NET Lambda Tools
185+
shell: bash
186+
run: dotnet tool install -g Amazon.Lambda.Tools
187+
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction
188+
189+
- name: Build Lambda Sample App
190+
shell: bash
191+
run: dotnet lambda package -pl ./src/SimpleLambdaFunction
192+
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction
193+
194+
- name: Upload Sample App to S3
195+
shell: bash
196+
run: |
197+
aws s3 cp ./src/SimpleLambdaFunction/bin/Release/net8.0/SimpleLambdaFunction.zip s3://adot-autoinstrumentation-dotnet-staging/function-${{ github.run_id }}.zip
198+
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction
199+
200+
dotnet-lambda-test:
201+
needs: [ build-lambda-staging-sample-app ]
202+
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/dotnet-lambda-test.yml@dotnetLambdaE2E
203+
secrets: inherit
204+
with:
205+
aws-region: us-east-1
206+
caller-workflow-name: 'main-build'

build/Build.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ private static string GetOTelAutoInstrumentationFileName()
144144
var source = RootDirectory / "instrument.sh";
145145
var dest = this.openTelemetryDistributionFolder;
146146
FileSystemTasks.CopyFileToDirectory(source, dest, FileExistsPolicy.Overwrite);
147+
148+
var otelInstrumentSource = RootDirectory / "otel-instrument";
149+
var otelInstrumentDest = this.openTelemetryDistributionFolder;
150+
FileSystemTasks.CopyFileToDirectory(otelInstrumentSource, otelInstrumentDest, FileExistsPolicy.Overwrite);
147151
});
148152

149153
private Target CopyConfiguration => _ => _

otel-instrument

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
. $(dirname "$0")/instrument.sh "$@"

sample-applications/lambda-test-apps/SimpleLambdaFunction/terraform/lambda/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module "test-function" {
2727
layers = compact([aws_lambda_layer_version.sdk_layer.arn])
2828

2929
environment_variables = {
30-
AWS_LAMBDA_EXEC_WRAPPER = "/opt/instrument.sh"
30+
AWS_LAMBDA_EXEC_WRAPPER = "/opt/otel-instrument"
3131
}
3232

3333
tracing_mode = var.tracing_mode

0 commit comments

Comments
 (0)