Skip to content

Commit 64ef2e9

Browse files
authored
Merge branch 'main' into genesis-js-release-test
2 parents 2328a35 + e25c304 commit 64ef2e9

File tree

6 files changed

+151
-16
lines changed

6 files changed

+151
-16
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
## SPDX-License-Identifier: Apache-2.0
3+
4+
name: Java Lambda Layer Performance Test Cleanup
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
test_runs:
9+
description: 'Number of test runs to perform'
10+
required: true
11+
default: 20
12+
type: number
13+
14+
java_version:
15+
description: 'The Java version to run the test'
16+
required: true
17+
default: '17'
18+
type: string
19+
20+
ADOT-Java-Branch:
21+
description: 'ADOT Java branch to use'
22+
required: true
23+
default: 'release/v2.11.x'
24+
type: string
25+
26+
jobs:
27+
java-lambda-layer-performance-test:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
contents: read
32+
33+
env:
34+
NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }}
35+
36+
steps:
37+
- name: Configure AWS Credentials
38+
uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
41+
aws-region: us-east-1
42+
43+
- name: Setup Terraform
44+
uses: hashicorp/setup-terraform@v2
45+
46+
- name: Cleanup Terraform Resources
47+
if: success() || failure() || cancelled()
48+
run: |
49+
cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda/terraform
50+
echo "Starting Terraform cleanup..."
51+
terraform init
52+
terraform destroy -auto-approve
53+

.github/workflows/java-lambda-layer-perf-test.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
description: 'The Java version to run the test'
1616
required: true
1717
default: '17'
18+
type: string
19+
20+
ADOT-Java-Branch:
21+
description: 'ADOT Java branch to use'
22+
required: true
23+
default: 'release/v2.11.x'
1824
type: string
1925

2026
jobs:
@@ -32,15 +38,21 @@ jobs:
3238
uses: aws-actions/configure-aws-credentials@v4
3339
with:
3440
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
35-
aws-region: us-east-1
41+
aws-region: us-east-1
3642

3743
- name: Checkout aws-otel-java-instrumentation
3844
uses: actions/checkout@v4
3945
with:
4046
repository: aws-observability/aws-otel-java-instrumentation
41-
ref: release/v1.33.x
47+
ref: ${{ github.event.inputs.ADOT-Java-Branch }}
4248
path: aws-otel-java-instrumentation
4349

50+
- name: Log branch and commit info
51+
run: |
52+
cd aws-otel-java-instrumentation
53+
echo "ADOT Java Branch: ${{ github.event.inputs.ADOT-Java-Branch }}"
54+
echo "ADOT Java Commit Hash: $(git rev-parse HEAD)"
55+
4456
- name: Setup Terraform
4557
uses: hashicorp/setup-terraform@v2
4658

@@ -71,6 +83,13 @@ jobs:
7183
terraform init
7284
terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }}"
7385
86+
# Re-authenticate to refresh credentials (important!)
87+
- name: Refresh AWS Credentials
88+
uses: aws-actions/configure-aws-credentials@v4
89+
with:
90+
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
91+
aws-region: us-east-1
92+
7493
- name: Checkout current repository
7594
uses: actions/checkout@v4
7695
with:
@@ -119,6 +138,14 @@ jobs:
119138
layer_results.txt
120139
retention-days: 90
121140

141+
# Always re-authenticate to refresh credentials before cleanup
142+
- name: Refresh AWS Credentials before cleanup
143+
if: success() || failure() || cancelled()
144+
uses: aws-actions/configure-aws-credentials@v4
145+
with:
146+
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
147+
aws-region: us-east-1
148+
122149
- name: Cleanup Terraform Resources
123150
if: success() || failure() || cancelled()
124151
run: |

.github/workflows/java-sample-app-ecr-deploy.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# This workflow is for building and uploading the Java sample application to ECR.
55
# Java 11 will be built and uploaded to all regions to be used by the canary while
6-
# other versions (8, 17, 21, 22) will be uploaded to us-east-1 for the purpose of
6+
# other versions (8, 17, 21, 23) will be uploaded to us-east-1 for the purpose of
77
# testing ADOT Java
88
name: Sample App Deployment - Java ECR
99
on:
@@ -51,6 +51,11 @@ jobs:
5151
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
5252
aws-region: ${{ matrix.aws-region }}
5353

54+
- name: Setup Gradle 8.14
55+
uses: gradle/actions/setup-gradle@v4
56+
with:
57+
gradle-version: '8.14'
58+
5459
- name: Build and Upload Main Service Image
5560
working-directory: sample-apps/java/springboot-main-service
5661
run: |
@@ -90,6 +95,11 @@ jobs:
9095
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
9196
aws-region: ${{ matrix.aws-region }}
9297

98+
- name: Setup Gradle 8.14
99+
uses: gradle/actions/setup-gradle@v4
100+
with:
101+
gradle-version: '8.14'
102+
93103
- name: Build and Upload Remote Service Image
94104
working-directory: sample-apps/java/springboot-remote-service
95105
run: |
@@ -100,7 +110,7 @@ jobs:
100110
strategy:
101111
fail-fast: false
102112
matrix:
103-
java-version: [ '8', '17', '21', '22' ]
113+
java-version: [ '8', '17', '21', '23' ]
104114
runs-on: ubuntu-latest
105115
steps:
106116
- uses: actions/checkout@v4
@@ -122,13 +132,18 @@ jobs:
122132
secret-ids: |
123133
JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image
124134
135+
- name: Setup Gradle 8.14
136+
uses: gradle/actions/setup-gradle@v4
137+
with:
138+
gradle-version: '8.14'
139+
125140
- name: Build and Upload Main Service Image
126141
working-directory: sample-apps/java/springboot-main-service
127142
run: |
128143
# For Java 8, springboot must be lower than version 3
129144
# For Java 11,17,21, they are compatible with both springboot version
130-
# For Java 22 and above, springboot must be version 3 or higher
131-
if [ "${{ matrix.java-version }}" = "22" ]; then
145+
# For Java 23 and above, springboot must be version 3 or higher
146+
if [ "${{ matrix.java-version }}" = "23" ]; then
132147
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts
133148
cat build.gradle.kts
134149
fi
@@ -140,7 +155,7 @@ jobs:
140155
strategy:
141156
fail-fast: false
142157
matrix:
143-
java-version: [ '8', '17', '21', '22' ]
158+
java-version: [ '8', '17', '21', '23' ]
144159
runs-on: ubuntu-latest
145160
steps:
146161
- uses: actions/checkout@v4
@@ -162,13 +177,18 @@ jobs:
162177
secret-ids: |
163178
JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image
164179
180+
- name: Setup Gradle 8.14
181+
uses: gradle/actions/setup-gradle@v4
182+
with:
183+
gradle-version: '8.14'
184+
165185
- name: Build and Upload Remote Service Image
166186
working-directory: sample-apps/java/springboot-remote-service
167187
run: |
168188
# For Java 8, springboot must be lower than version 3
169189
# For Java 11,17,21, they are compatible with both springboot version
170-
# For Java 22 and above, springboot must be version 3 or higher
171-
if [ "${{ matrix.java-version }}" = "22" ]; then
190+
# For Java 23 and above, springboot must be version 3 or higher
191+
if [ "${{ matrix.java-version }}" = "23" ]; then
172192
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts
173193
cat build.gradle.kts
174194
fi

.github/workflows/java-sample-app-s3-deploy.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
## SPDX-License-Identifier: Apache-2.0
33

4-
# This workflow is for building and uploading the Java sample application to S3 bucket. Java 11 will be built and uploaded to all regions to be used by the canary while other versions (8, 17, 21, 22)
4+
# This workflow is for building and uploading the Java sample application to S3 bucket. Java 11 will be built and uploaded to all regions to be used by the canary while other versions (8, 17, 21, 23)
55
# will be uploaded to us-east-1 for the purpose of testing ADOT Java
66
name: Sample App Deployment - Java S3
77
on:
@@ -48,6 +48,11 @@ jobs:
4848
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
4949
aws-region: ${{ matrix.aws-region }}
5050

51+
- name: Setup Gradle 8.14
52+
uses: gradle/actions/setup-gradle@v4
53+
with:
54+
gradle-version: '8.14'
55+
5156
- name: Build and Upload Main Jar
5257
working-directory: sample-apps/java/springboot-main-service
5358
run: |
@@ -86,6 +91,11 @@ jobs:
8691
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
8792
aws-region: ${{ matrix.aws-region }}
8893

94+
- name: Setup Gradle 8.14
95+
uses: gradle/actions/setup-gradle@v4
96+
with:
97+
gradle-version: '8.14'
98+
8999
- name: Build and Upload Remote Jar
90100
working-directory: sample-apps/java/springboot-remote-service
91101
run: |
@@ -96,7 +106,7 @@ jobs:
96106
strategy:
97107
fail-fast: false
98108
matrix:
99-
java-version: [ '8', '17', '21', '22' ]
109+
java-version: [ '8', '17', '21', '23' ]
100110
runs-on: ubuntu-latest
101111
steps:
102112
- uses: actions/checkout@v4
@@ -106,6 +116,11 @@ jobs:
106116
java-version: ${{ matrix.java-version }}
107117
check-latest: true
108118

119+
- name: Setup Gradle 8.14
120+
uses: gradle/actions/setup-gradle@v4
121+
with:
122+
gradle-version: '8.14'
123+
109124
- name: Configure AWS Credentials
110125
uses: aws-actions/configure-aws-credentials@v4
111126
with:
@@ -117,8 +132,8 @@ jobs:
117132
run: |
118133
# For Java 8, springboot must be lower than version 3
119134
# For Java 11,17,21, they are compatible with both springboot version
120-
# For Java 22 and above, springboot must be version 3 or higher
121-
if [ "${{ matrix.java-version }}" = "22" ]; then
135+
# For Java 23 and above, springboot must be version 3 or higher
136+
if [ "${{ matrix.java-version }}" = "23" ]; then
122137
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts
123138
cat build.gradle.kts
124139
fi
@@ -130,7 +145,7 @@ jobs:
130145
strategy:
131146
fail-fast: false
132147
matrix:
133-
java-version: [ '8', '17', '21', '22' ]
148+
java-version: [ '8', '17', '21', '23' ]
134149
runs-on: ubuntu-latest
135150
steps:
136151
- uses: actions/checkout@v4
@@ -140,6 +155,11 @@ jobs:
140155
java-version: ${{ matrix.java-version }}
141156
check-latest: true
142157

158+
- name: Setup Gradle 8.14
159+
uses: gradle/actions/setup-gradle@v4
160+
with:
161+
gradle-version: '8.14'
162+
143163
- name: Configure AWS Credentials
144164
uses: aws-actions/configure-aws-credentials@v4
145165
with:
@@ -151,8 +171,8 @@ jobs:
151171
run: |
152172
# For Java 8, springboot must be lower than version 3
153173
# For Java 11,17,21, they are compatible with both springboot version
154-
# For Java 22 and above, springboot must be version 3 or higher
155-
if [ "${{ matrix.java-version }}" = "22" ]; then
174+
# For Java 23 and above, springboot must be version 3 or higher
175+
if [ "${{ matrix.java-version }}" = "23" ]; then
156176
sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts
157177
cat build.gradle.kts
158178
fi
@@ -232,6 +252,11 @@ jobs:
232252
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
233253
aws-region: us-west-2
234254

255+
- name: Setup Gradle 8.14
256+
uses: gradle/actions/setup-gradle@v4
257+
with:
258+
gradle-version: '8.14'
259+
235260
- name: Build and Upload Main JAR
236261
working-directory: sample-apps/java/springboot-main-service
237262
run: |

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# How to Run Lambda Java Performance Test
2+
[Link](docs/lambda-java-perf-test.md)
3+
14
# How to Test E2E Resource Changes
25
This guide will give a step by step instruction on how to test changes made to Java/Python E2E testing resources before pushing a PR.
36
The guide will include the following:

docs/lambda-java-perf-test.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# How to Run Lambda Java Performance Test
2+
The [java-lambda-layer-performance-test](https://github.com/aws-observability/aws-application-signals-test-framework/actions/workflows/java-lambda-layer-perf-test.yml) workflow will check out a branch from the [ADOT Java Agent repo](https://github.com/aws-observability/aws-otel-java-instrumentation) and build a Lambda Java Layer from that branch. Then it will run performance tests with the generated Lambda Java Layer and build the report.
3+
4+
For example, to test a Lambda Layer built from branch "release/v2.11.x":
5+
1. Open the [java-lambda-layer-performance-test](https://github.com/aws-observability/aws-application-signals-test-framework/actions/workflows/java-lambda-layer-perf-test.yml) workflow and click "Run workflow".
6+
2. Use workflow from "Branch: main". Enter "release/v2.11.x" in "ADOT Java branch to use" and click "Run workflow".
7+
3. After the workflow run finishes, the performance testing report can be found in the generated artifacts under "java-performance-test-results".

0 commit comments

Comments
 (0)