Skip to content

Commit 38765f7

Browse files
authored
Merge branch 'main' into remove-docker-image-runner
2 parents af305c2 + d6728ac commit 38765f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+397
-888
lines changed

.github/workflows/java-ec2-asg-e2e-test.yml

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -133,54 +133,6 @@ jobs:
133133
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
134134
fi
135135
136-
# If the deployment_failed is still 0, then the terraform deployment succeeded and now try to connect to the endpoint.
137-
# Attempts to connect will be made for up to 10 minutes
138-
if [ $deployment_failed -eq 0 ]; then
139-
echo "Attempting to connect to the endpoint"
140-
main_service_instance_id=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names ec2-single-asg-${{ env.TESTING_ID }} --region ${{ env.E2E_TEST_AWS_REGION }} --query "AutoScalingGroups[].Instances[0].InstanceId" --output text)
141-
main_service_public_ip=$(aws ec2 describe-instances --instance-ids $main_service_instance_id --region ${{ env.E2E_TEST_AWS_REGION }} --query "Reservations[].Instances[].PublicIpAddress" --output text)
142-
main_service_private_dns_name=$(aws ec2 describe-instances --instance-ids $main_service_instance_id --region ${{ env.E2E_TEST_AWS_REGION }} --query "Reservations[].Instances[].PrivateDnsName" --output text)
143-
144-
echo "INSTANCE_ID=$main_service_instance_id" >> $GITHUB_ENV
145-
echo "MAIN_SERVICE_ENDPOINT=$main_service_public_ip:8080" >> $GITHUB_ENV
146-
echo "PRIVATE_DNS_NAME=$main_service_private_dns_name" >> $GITHUB_ENV
147-
echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV
148-
echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_public_ip)" >> $GITHUB_ENV
149-
150-
main_service_sample_app_endpoint=http://$main_service_public_ip:8080
151-
echo "The main service endpoint is $main_service_sample_app_endpoint"
152-
153-
attempt_counter=0
154-
max_attempts=30
155-
until $(curl --output /dev/null --silent --head --fail $(echo "$main_service_sample_app_endpoint" | tr -d '"')); do
156-
if [ ${attempt_counter} -eq ${max_attempts} ];then
157-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
158-
deployment_failed=1
159-
break
160-
fi
161-
162-
printf '.'
163-
attempt_counter=$(($attempt_counter+1))
164-
sleep 10
165-
done
166-
167-
echo "Attempting to connect to the remote sample app endpoint"
168-
remote_sample_app_endpoint=http://$(terraform output sample_app_remote_service_public_ip):8080/healthcheck
169-
attempt_counter=0
170-
max_attempts=30
171-
until $(curl --output /dev/null --silent --head --fail $(echo "$remote_sample_app_endpoint" | tr -d '"')); do
172-
if [ ${attempt_counter} -eq ${max_attempts} ];then
173-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
174-
deployment_failed=1
175-
break
176-
fi
177-
178-
printf '.'
179-
attempt_counter=$(($attempt_counter+1))
180-
sleep 10
181-
done
182-
fi
183-
184136
# If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
185137
# resources created from terraform and try again.
186138
if [ $deployment_failed -eq 1 ]; then
@@ -200,14 +152,16 @@ jobs:
200152
fi
201153
done
202154
203-
# This steps increases the speed of the validation by creating the telemetry data in advance
204-
- name: Call all test APIs
205-
continue-on-error: true
206-
run: |
207-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call"
208-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"
209-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"
210-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call"
155+
- name: Get the sample app and EC2 instance information
156+
working-directory: terraform/java/ec2/asg
157+
run: |
158+
main_service_instance_id=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names ec2-single-asg-${{ env.TESTING_ID }} --region ${{ env.E2E_TEST_AWS_REGION }} --query "AutoScalingGroups[].Instances[0].InstanceId" --output text)
159+
main_service_private_dns_name=$(aws ec2 describe-instances --instance-ids $main_service_instance_id --region ${{ env.E2E_TEST_AWS_REGION }} --query "Reservations[].Instances[].PrivateDnsName" --output text)
160+
echo "INSTANCE_ID=$main_service_instance_id" >> $GITHUB_ENV
161+
echo "MAIN_SERVICE_ENDPOINT=localhost:8080" >> $GITHUB_ENV
162+
echo "PRIVATE_DNS_NAME=$main_service_private_dns_name" >> $GITHUB_ENV
163+
echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV
164+
echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV
211165
212166
- name: Initiate Gradlew Daemon
213167
if: steps.initiate-gradlew == 'failure'

.github/workflows/java-ec2-default-e2e-test.yml

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ env:
3030
LOG_GROUP_NAME: /aws/application-signals/data
3131
TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE}
3232

33-
3433
jobs:
3534
java-ec2-default:
3635
runs-on: ubuntu-latest
@@ -134,42 +133,6 @@ jobs:
134133
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
135134
fi
136135
137-
# If the deployment_failed is still 0, then the terraform deployment succeeded and now try to connect to the endpoint.
138-
# Attempts to connect will be made for up to 10 minutes
139-
if [ $deployment_failed -eq 0 ]; then
140-
echo "Attempting to connect to the endpoint"
141-
main_sample_app_endpoint=http://$(terraform output sample_app_main_service_public_dns):8080
142-
attempt_counter=0
143-
max_attempts=30
144-
until $(curl --output /dev/null --silent --head --fail $(echo "$main_sample_app_endpoint" | tr -d '"')); do
145-
if [ ${attempt_counter} -eq ${max_attempts} ];then
146-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
147-
deployment_failed=1
148-
break
149-
fi
150-
151-
printf '.'
152-
attempt_counter=$(($attempt_counter+1))
153-
sleep 10
154-
done
155-
156-
echo "Attempting to connect to the remote sample app endpoint"
157-
remote_sample_app_endpoint=http://$(terraform output sample_app_remote_service_public_ip):8080/healthcheck
158-
attempt_counter=0
159-
max_attempts=30
160-
until $(curl --output /dev/null --silent --head --fail $(echo "$remote_sample_app_endpoint" | tr -d '"')); do
161-
if [ ${attempt_counter} -eq ${max_attempts} ];then
162-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
163-
deployment_failed=1
164-
break
165-
fi
166-
167-
printf '.'
168-
attempt_counter=$(($attempt_counter+1))
169-
sleep 10
170-
done
171-
fi
172-
173136
# If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
174137
# resources created from terraform and try again.
175138
if [ $deployment_failed -eq 1 ]; then
@@ -197,19 +160,10 @@ jobs:
197160
- name: Get the sample app and EC2 instance information
198161
working-directory: terraform/java/ec2/default
199162
run: |
200-
echo "MAIN_SERVICE_ENDPOINT=$(terraform output sample_app_main_service_public_dns):8080" >> $GITHUB_ENV
201-
echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_public_ip)" >> $GITHUB_ENV
163+
echo "MAIN_SERVICE_ENDPOINT=localhost:8080" >> $GITHUB_ENV
164+
echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV
202165
echo "MAIN_SERVICE_INSTANCE_ID=$(terraform output main_service_instance_id)" >> $GITHUB_ENV
203166
204-
# This steps increases the speed of the validation by creating the telemetry data in advance
205-
- name: Call all test APIs
206-
continue-on-error: true
207-
run: |
208-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/outgoing-http-call"
209-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"
210-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"
211-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call"
212-
213167
- name: Initiate Gradlew Daemon
214168
if: steps.initiate-gradlew == 'failure'
215169
uses: ./.github/workflows/actions/execute_and_retry

.github/workflows/java-eks-e2e-test.yml

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ jobs:
228228
-var="rds_mysql_cluster_endpoint=${{env.RDS_MYSQL_CLUSTER_ENDPOINT}}" \
229229
-var="rds_mysql_cluster_username=${{env.RDS_MYSQL_CLUSTER_SECRETS_USERNAME}}" \
230230
-var='rds_mysql_cluster_password=${{env.RDS_MYSQL_CLUSTER_SECRETS_PASSWORD}}' \
231-
|| deployment_failed=$?
232-
231+
-var='account_id=${{ env.ACCOUNT_ID }}' \
232+
|| deployment_failed=$?
233+
233234
if [ $deployment_failed -ne 0 ]; then
234235
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
235236
fi
@@ -252,39 +253,6 @@ jobs:
252253
253254
execute_and_retry 2 "kubectl delete pods --all -n ${{ env.SAMPLE_APP_NAMESPACE }}" "" 60
254255
execute_and_retry 2 "kubectl wait --for=condition=Ready --request-timeout '5m' pod --all -n ${{ env.SAMPLE_APP_NAMESPACE }}" "" 10
255-
256-
echo "Attempting to connect to the main sample app endpoint"
257-
main_sample_app_endpoint=http://$(terraform output sample_app_endpoint)
258-
attempt_counter=0
259-
max_attempts=60
260-
until $(curl --output /dev/null --silent --head --fail $(echo "$main_sample_app_endpoint" | tr -d '"')); do
261-
if [ ${attempt_counter} -eq ${max_attempts} ];then
262-
echo "Failed to connect to endpoint ($main_sample_app_endpoint). Will attempt to redeploy sample app."
263-
deployment_failed=1
264-
break
265-
fi
266-
267-
printf '.'
268-
attempt_counter=$(($attempt_counter+1))
269-
sleep 10
270-
done
271-
272-
echo "Attempting to connect to the remote sample app endpoint"
273-
remote_sample_app_endpoint=http://$(terraform output sample_remote_app_endpoint)/healthcheck
274-
echo $remote_sample_app_endpoint
275-
attempt_counter=0
276-
max_attempts=30
277-
until $(curl --output /dev/null --silent --head --fail $(echo "$remote_sample_app_endpoint" | tr -d '"')); do
278-
if [ ${attempt_counter} -eq ${max_attempts} ];then
279-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
280-
deployment_failed=1
281-
break
282-
fi
283-
284-
printf '.'
285-
attempt_counter=$(($attempt_counter+1))
286-
sleep 10
287-
done
288256
fi
289257
290258
# If the deployment_failed is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
@@ -353,18 +321,13 @@ jobs:
353321
echo "REMOTE_SERVICE_POD_IP=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].status.podIP}')" >> $GITHUB_ENV
354322
355323
- name: Get the sample app endpoint
356-
working-directory: terraform/java/eks
357-
run: echo "APP_ENDPOINT=$(terraform output sample_app_endpoint)" >> $GITHUB_ENV
324+
run: echo "APP_ENDPOINT=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=sample-app -o jsonpath='{.items[0].status.podIP}'):8080" >> $GITHUB_ENV
358325

359-
# This steps increases the speed of the validation by creating the telemetry data in advance
360-
- name: Call all test APIs
361-
continue-on-error: true
326+
- name: Set endpoints for the traffic generator
362327
run: |
363-
curl -S -s "http://${{ env.APP_ENDPOINT }}/outgoing-http-call"
364-
curl -S -s "http://${{ env.APP_ENDPOINT }}/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"
365-
curl -S -s "http://${{ env.APP_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }}"
366-
curl -S -s "http://${{ env.APP_ENDPOINT }}/client-call"
367-
curl -S -s "http://${{ env.APP_ENDPOINT }}/mysql"
328+
# Add the appropriate environment variables to the traffic generator
329+
kubectl set env -n ${{ env.SAMPLE_APP_NAMESPACE }} deployment/traffic-generator MAIN_ENDPOINT=${{ env.APP_ENDPOINT }}
330+
kubectl set env -n ${{ env.SAMPLE_APP_NAMESPACE }} deployment/traffic-generator REMOTE_ENDPOINT=${{ env.REMOTE_SERVICE_POD_IP }}
368331
369332
- name: Initiate Gradlew Daemon
370333
if: steps.initiate-gradlew == 'failure'

.github/workflows/java-k8s-e2e-test.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -130,35 +130,11 @@ jobs:
130130
-var="patch_image_arn=${{ env.PATCH_IMAGE_ARN }}" \
131131
-var="release_testing_ecr_account=${{ env.RELEASE_TESTING_ECR_ACCOUNT }}"
132132
133-
- name: Get Remote Service IP
133+
- name: Get Main and Remote Service IP
134134
run: |
135+
echo MAIN_SERVICE_IP="$(aws ssm get-parameter --region ${{ env.E2E_TEST_AWS_REGION }} --name main-service-ip-${{ env.TESTING_ID }} | jq -r '.Parameter.Value')" >> $GITHUB_ENV
135136
echo REMOTE_SERVICE_IP="$(aws ssm get-parameter --region ${{ env.E2E_TEST_AWS_REGION }} --name remote-service-ip-${{ env.TESTING_ID }} | jq -r '.Parameter.Value')" >> $GITHUB_ENV
136137
137-
- name: Wait for app endpoint to come online
138-
id: endpoint-check
139-
run: |
140-
attempt_counter=0
141-
max_attempts=30
142-
until $(curl --output /dev/null --silent --head --fail http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/); do
143-
if [ ${attempt_counter} -eq ${max_attempts} ];then
144-
echo "Max attempts reached"
145-
exit 1
146-
fi
147-
148-
printf '.'
149-
attempt_counter=$(($attempt_counter+1))
150-
sleep 10
151-
done
152-
# This steps increases the speed of the validation by creating the telemetry data in advance
153-
# It is run after the gradle build to give the app time to initialize after the pods become ready
154-
- name: Call all test APIs
155-
continue-on-error: true
156-
run: |
157-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/outgoing-http-call"; echo
158-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/aws-sdk-call?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"; echo
159-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}"; echo
160-
curl -S -s "http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/client-call"; echo
161-
162138
- name: Initiate Gradlew Daemon
163139
if: steps.initiate-gradlew == 'failure'
164140
uses: ./.github/workflows/actions/execute_and_retry
@@ -174,7 +150,7 @@ jobs:
174150
id: log-validation
175151
run: ./gradlew validator:run --args='-c java/k8s/log-validation.yml
176152
--testing-id ${{ env.TESTING_ID }}
177-
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100
153+
--endpoint http://${{ env.MAIN_SERVICE_IP }}:8080
178154
--region ${{ env.E2E_TEST_AWS_REGION }}
179155
--account-id ${{ env.ACCOUNT_ID }}
180156
--metric-namespace ${{ env.METRIC_NAMESPACE }}
@@ -191,7 +167,7 @@ jobs:
191167
if: (success() || steps.log-validation.outcome == 'failure') && !cancelled()
192168
run: ./gradlew validator:run --args='-c java/k8s/metric-validation.yml
193169
--testing-id ${{ env.TESTING_ID }}
194-
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100
170+
--endpoint http://${{ env.MAIN_SERVICE_IP }}:8080
195171
--region ${{ env.E2E_TEST_AWS_REGION }}
196172
--account-id ${{ env.ACCOUNT_ID }}
197173
--metric-namespace ${{ env.METRIC_NAMESPACE }}
@@ -209,7 +185,7 @@ jobs:
209185
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled()
210186
run: ./gradlew validator:run --args='-c java/k8s/trace-validation.yml
211187
--testing-id ${{ env.TESTING_ID }}
212-
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100
188+
--endpoint http://${{ env.MAIN_SERVICE_IP }}:8080
213189
--region ${{ env.E2E_TEST_AWS_REGION }}
214190
--account-id ${{ env.ACCOUNT_ID }}
215191
--metric-namespace ${{ env.METRIC_NAMESPACE }}

0 commit comments

Comments
 (0)