2323 TEST_ACCOUNT : ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }}
2424 SAMPLE_APP_FRONTEND_SERVICE_JAR : ${{ secrets.APP_SIGNALS_E2E_FE_SA_JAR }}
2525 SAMPLE_APP_REMOTE_SERVICE_JAR : ${{ secrets.APP_SIGNALS_E2E_RE_SA_JAR }}
26- APP_SIGNALS_ADOT_JAR : " https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar"
26+ GET_CW_AGENT_RPM_COMMAND : " wget -O cw-agent.rpm https://amazoncloudwatch-agent-us-east-1.s3.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm"
27+ GET_ADOT_JAR_COMMAND : " aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar"
2728 METRIC_NAMESPACE : AppSignals
2829 LOG_GROUP_NAME : /aws/appsignals/generic
2930
3031jobs :
3132 e2e-ec2-test :
3233 runs-on : ubuntu-latest
3334 steps :
34- - uses : actions/checkout@v4
35+ - name : Get testing resources from aws-application-signals-test-framework
36+ uses : actions/checkout@v4
3537 with :
36- fetch-depth : 0
37-
38- - uses : actions/setup-java@v4
39- with :
40- java-version : 17
41- distribution : temurin
42-
43- - name : Set CW Agent RPM environment variable
44- run : |
45- if [ ${{ env.AWS_DEFAULT_REGION }} == "us-east-1" ]; then
46- echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-us-east-1.s3.amazonaws.com/amazon_linux/amd64/1.300031.0b313/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
47- else
48- echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ env.AWS_DEFAULT_REGION }}.s3.${{ env.AWS_DEFAULT_REGION }}.amazonaws.com/amazon_linux/amd64/1.300031.0b313/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
49- fi
38+ repository : aws-observability/aws-application-signals-test-framework
39+ ref : adot-pending-release
5040
5141 - name : Generate testing id
5242 run : echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
@@ -58,135 +48,73 @@ jobs:
5848 aws-region : ${{ env.AWS_DEFAULT_REGION }}
5949
6050 - uses : actions/download-artifact@v3
61- if : inputs.caller-workflow-name == 'main-build'
6251 with :
6352 name : aws-opentelemetry-agent.jar
6453
6554 - name : Upload main-build adot.jar to s3
66- if : inputs.caller-workflow-name == 'main-build'
67- run : aws s3 cp ./aws-opentelemetry-agent-*-SNAPSHOT.jar s3://main-build-adot-staging-jar/aws-opentelemetry-agent.jar
68-
69- - name : Set Get ADOT.jar command environment variable
70- working-directory : testing/terraform/ec2
71- run : |
72- if [ ${{ inputs.caller-workflow-name }} == "main-build" ]; then
73- echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://main-build-adot-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV
74- else
75- echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar" >> $GITHUB_ENV
76- fi
55+ run : aws s3 cp ./aws-opentelemetry-agent-*-SNAPSHOT.jar s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar
7756
7857 - name : Set up terraform
7958 uses : hashicorp/setup-terraform@v3
8059 with :
8160 terraform_wrapper : false
8261
83- - name : Deploy sample app via terraform and wait for endpoint to come online
84- working-directory : testing/ terraform/ec2
62+ - name : Deploy sample app via terraform
63+ working-directory : terraform/ec2
8564 run : |
8665 terraform init
8766 terraform validate
88-
89- # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online.
90- # There may be occasional failures due to transitivity issues, so try up to 2 times.
91- # deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates
92- # that it failed at some point
93- retry_counter=0
94- max_retry=2
95- while [ $retry_counter -lt $max_retry ]; do
96- echo "Attempt $retry_counter"
97- deployment_failed=0
98- terraform apply -auto-approve \
99- -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
100- -var="test_id=${{ env.TESTING_ID }}" \
101- -var="sample_app_jar=${{ env.SAMPLE_APP_FRONTEND_SERVICE_JAR }}" \
102- -var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
103- -var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
104- -var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" \
105- || deployment_failed=$?
106-
107- if [ $deployment_failed -eq 1 ]; then
108- echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
109- fi
110-
111- # If the deployment_failed is still 0, then the terraform deployment succeeded and now try to connect to the endpoint.
112- # Attempts to connect will be made for up to 10 minutes
113- if [ $deployment_failed -eq 0 ]; then
114- echo "Attempting to connect to the endpoint"
115- sample_app_endpoint=http://$(terraform output sample_app_main_service_public_dns):8080
116- attempt_counter=0
117- max_attempts=60
118- until $(curl --output /dev/null --silent --head --fail $(echo "$sample_app_endpoint" | tr -d '"')); do
119- if [ ${attempt_counter} -eq ${max_attempts} ];then
120- echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
121- deployment_failed=1
122- break
123- fi
124-
125- printf '.'
126- attempt_counter=$(($attempt_counter+1))
127- sleep 10
128- done
129- fi
130-
131- # If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
132- # resources created from terraform and try again.
133- if [ $deployment_failed -eq 1 ]; then
134- echo "Destroying terraform"
135- terraform destroy -auto-approve \
136- -var="test_id=${{ env.TESTING_ID }}"
137-
138- retry_counter=$(($retry_counter+1))
139- else
140- # If deployment succeeded, then exit the loop
141- break
142- fi
143-
144- if [ $retry_counter -eq $max_retry ]; then
145- echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code"
146- exit 1
147- fi
148- done
149-
150- # cache local patch outputs
151- - name : Cache local Maven repository
152- id : cache-local-maven-repo
153- uses : actions/cache@v3
154- with :
155- path : |
156- ~/.m2/repository/io/opentelemetry/
157- key : ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}
158-
159- - name : Publish patched dependencies to maven local
160- uses : ./.github/actions/patch-dependencies
161- if : steps.cache-local-maven-repo.outputs.cache-hit != 'true'
162- with :
163- gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
164- gpg_password : ${{ secrets.GPG_PASSPHRASE }}
67+ terraform apply -auto-approve \
68+ -var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
69+ -var="test_id=${{ env.TESTING_ID }}" \
70+ -var="sample_app_jar=${{ env.SAMPLE_APP_FRONTEND_SERVICE_JAR }}" \
71+ -var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
72+ -var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
73+ -var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}"
16574
16675 - name : Get the ec2 instance ami id
16776 run : |
16877 echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV
169- working-directory : testing/ terraform/ec2
78+ working-directory : terraform/ec2
17079
17180 - name : Get the sample app endpoint
17281 run : |
17382 echo "MAIN_SERVICE_ENDPOINT=$(terraform output sample_app_main_service_public_dns):8080" >> $GITHUB_ENV
17483 echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_public_ip)" >> $GITHUB_ENV
175- working-directory : testing/terraform/ec2
84+ working-directory : terraform/ec2
85+
86+ - name : Wait for app endpoint to come online
87+ id : endpoint-check
88+ run : |
89+ attempt_counter=0
90+ max_attempts=30
91+ until $(curl --output /dev/null --silent --head --fail http://${{ env.MAIN_SERVICE_ENDPOINT }}); do
92+ if [ ${attempt_counter} -eq ${max_attempts} ];then
93+ echo "Max attempts reached"
94+ exit 1
95+ fi
96+
97+ printf '.'
98+ attempt_counter=$(($attempt_counter+1))
99+ sleep 10
100+ done
176101
177102 # This steps increases the speed of the validation by creating the telemetry data in advance
178103 - name : Call all test APIs
179104 continue-on-error : true
180105 run : |
181- curl -S -s -o /dev/null http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call/
182- curl -S -s -o /dev/null http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call/
183- curl -S -s -o /dev/null http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
184- curl -S -s -o /dev/null http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/
106+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call/; echo
107+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call/; echo
108+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/; echo
109+ curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/; echo
110+
111+ - name : Build Gradle
112+ run : ./gradlew
185113
186114 # Validation for pulse telemetry data
187115 - name : Validate generated EMF logs
188116 id : log-validation
189- run : ./gradlew testing: validator:run --args='-c ec2/log-validation.yml
117+ run : ./gradlew validator:run --args='-c ec2/log-validation.yml
190118 --testing-id ${{ env.TESTING_ID }}
191119 --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
192120 --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080
@@ -196,14 +124,14 @@ jobs:
196124 --log-group ${{ env.LOG_GROUP_NAME }}
197125 --service-name sample-application-${{ env.TESTING_ID }}
198126 --remote-service-name sample-remote-application-${{ env.TESTING_ID }}
199- --request-body ip=${{ env.REMOTE_SERVICE_IP }}
127+ --query-string ip=${{ env.REMOTE_SERVICE_IP }}
200128 --instance-ami ${{ env.EC2_INSTANCE_AMI }}
201129 --rollup'
202130
203131 - name : Validate generated metrics
204132 id : metric-validation
205133 if : (success() || steps.log-validation.outcome == 'failure') && !cancelled()
206- run : ./gradlew testing: validator:run --args='-c ec2/metric-validation.yml
134+ run : ./gradlew validator:run --args='-c ec2/metric-validation.yml
207135 --testing-id ${{ env.TESTING_ID }}
208136 --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
209137 --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080
@@ -213,14 +141,14 @@ jobs:
213141 --log-group ${{ env.LOG_GROUP_NAME }}
214142 --service-name sample-application-${{ env.TESTING_ID }}
215143 --remote-service-name sample-remote-application-${{ env.TESTING_ID }}
216- --request-body ip=${{ env.REMOTE_SERVICE_IP }}
144+ --query-string ip=${{ env.REMOTE_SERVICE_IP }}
217145 --instance-ami ${{ env.EC2_INSTANCE_AMI }}
218146 --rollup'
219147
220148 - name : Validate generated traces
221149 id : trace-validation
222150 if : (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
223- run : ./gradlew testing: validator:run --args='-c ec2/trace-validation.yml
151+ run : ./gradlew validator:run --args='-c ec2/trace-validation.yml
224152 --testing-id ${{ env.TESTING_ID }}
225153 --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
226154 --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080
@@ -230,7 +158,7 @@ jobs:
230158 --log-group ${{ env.LOG_GROUP_NAME }}
231159 --service-name sample-application-${{ env.TESTING_ID }}
232160 --remote-service-name sample-remote-application-${{ env.TESTING_ID }}
233- --request-body ip=${{ env.REMOTE_SERVICE_IP }}
161+ --query-string ip=${{ env.REMOTE_SERVICE_IP }}
234162 --instance-ami ${{ env.EC2_INSTANCE_AMI }}
235163 --rollup'
236164
@@ -255,7 +183,7 @@ jobs:
255183 - name : Terraform destroy
256184 if : always()
257185 continue-on-error : true
258- working-directory : testing/ terraform/ec2
186+ working-directory : terraform/ec2
259187 run : |
260188 terraform destroy -auto-approve \
261189 -var="test_id=${{ env.TESTING_ID }}"
0 commit comments