Skip to content

Commit 320e278

Browse files
committed
try
1 parent 52b99a0 commit 320e278

File tree

1 file changed

+78
-4
lines changed

1 file changed

+78
-4
lines changed

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

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ on:
2424
type: string
2525

2626
jobs:
27-
java-lambda-layer-performance-test-cleanup:
27+
java-lambda-layer-performance-test:
2828
runs-on: ubuntu-latest
2929
permissions:
3030
id-token: write
31-
contents: read
31+
contents: read
3232

3333
env:
3434
NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }}
@@ -56,11 +56,85 @@ jobs:
5656
- name: Setup Terraform
5757
uses: hashicorp/setup-terraform@v2
5858

59+
- name: Build and Deploy Lambda Layer
60+
run: |
61+
cd aws-otel-java-instrumentation/lambda-layer
62+
chmod +x build-layer.sh
63+
./build-layer.sh
64+
65+
LAYER_VERSION_ARN=$(aws lambda publish-layer-version \
66+
--layer-name AWSOpenTelemetryDistroJava \
67+
--zip-file fileb://build/distributions/aws-opentelemetry-java-layer.zip \
68+
--compatible-runtimes "java11" "java17" "java21" \
69+
--compatible-architectures "x86_64" "arm64" \
70+
--query 'LayerVersionArn' \
71+
--output text)
72+
73+
echo "LAYER_VERSION_ARN=$LAYER_VERSION_ARN" >> $GITHUB_ENV
74+
echo "Published layer ARN $LAYER_VERSION_ARN"
75+
76+
- name: Build and Deploy Sample Application with Lambda Layer
77+
run: |
78+
cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda
79+
gradle clean build
80+
gradle createLambdaZip
81+
82+
cd terraform
83+
terraform init
84+
terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }}"
85+
86+
# - name: Checkout current repository
87+
# uses: actions/checkout@v4
88+
# with:
89+
# path: current-repo
90+
91+
# - name: Run Cold Start Iterations for Base Lambda + Lambda Layer
92+
# run: |
93+
# cd current-repo
94+
# chmod +x lambda-layer-perf-test/lambda-layer-run.sh
95+
# ./lambda-layer-perf-test/lambda-layer-run.sh false aws-opentelemetry-distro-java
96+
97+
# - name: Remove Application Signals Lambda Layer
98+
# run: |
99+
# echo "Removing Lambda layer..."
100+
101+
# OUTPUT=$(aws lambda update-function-configuration \
102+
# --function-name aws-opentelemetry-distro-java \
103+
# --layers [])
104+
105+
# echo "Lambda configuration:"
106+
# echo "$OUTPUT"
107+
108+
# LAYERS=$(echo "$OUTPUT" | jq -r '.Layers | length')
109+
110+
# if [ "$LAYERS" -ne 0 ]; then
111+
# echo "::error::Found $LAYERS layer(s) still attached to the function"
112+
# echo "::error::Layer details:"
113+
# echo "$OUTPUT" | jq -r '.Layers'
114+
# exit 1
115+
# else
116+
# echo "✅ Layers successfully removed"
117+
# fi
118+
119+
# - name: Run Cold Start Iterations for Base Lambda
120+
# run: |
121+
# cd current-repo
122+
# chmod +x lambda-layer-perf-test/lambda-layer-run.sh
123+
# ./lambda-layer-perf-test/lambda-layer-run.sh true aws-opentelemetry-distro-java
124+
125+
# - name: Upload test results
126+
# uses: actions/upload-artifact@v4
127+
# with:
128+
# name: java-performance-test-results
129+
# path: |
130+
# no_layer_results.txt
131+
# layer_results.txt
132+
# retention-days: 90
133+
59134
- name: Cleanup Terraform Resources
60135
if: success() || failure() || cancelled()
61136
run: |
62137
cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda/terraform
63138
echo "Starting Terraform cleanup..."
64139
terraform init
65-
terraform destroy -auto-approve
66-
140+
terraform destroy -auto-approve

0 commit comments

Comments
 (0)