Skip to content

Commit 7c0463f

Browse files
authored
Revert "Rebase release/v1.32.x (#656)" (#657)
This reverts commit 2283eda.
1 parent 2283eda commit 7c0463f

39 files changed

+245
-442
lines changed

.github/workflows/appsignals-e2e-ec2-canary-test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ permissions:
1414

1515
jobs:
1616
e2e-canary-test:
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
aws-region: ['us-east-1', 'us-east-2', 'eu-west-1', 'ap-northeast-1', 'ap-southeast-2']
2117
uses: ./.github/workflows/appsignals-e2e-ec2-test.yml
2218
secrets: inherit
2319
with:
24-
aws-region: ${{ matrix.aws-region }}
2520
caller-workflow-name: 'appsignals-e2e-ec2-canary-test'

.github/workflows/appsignals-e2e-ec2-test.yml

Lines changed: 28 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ name: App Signals Enablement E2E Testing - EC2 Use Case
55
on:
66
workflow_call:
77
inputs:
8-
aws-region:
9-
required: true
10-
type: string
118
caller-workflow-name:
129
required: true
1310
type: string
@@ -17,10 +14,11 @@ permissions:
1714
contents: read
1815

1916
env:
20-
AWS_DEFAULT_REGION: ${{ inputs.aws-region }} # Used by terraform and AWS CLI commands
17+
AWS_DEFAULT_REGION: us-east-1
2118
TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }}
2219
SAMPLE_APP_FRONTEND_SERVICE_JAR: "s3://aws-appsignals-sample-app/main-service.jar"
2320
SAMPLE_APP_REMOTE_SERVICE_JAR: "s3://aws-appsignals-sample-app/remote-service.jar"
21+
APP_SIGNALS_CW_AGENT_RPM: "https://amazoncloudwatch-agent-us-east-1.s3.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm"
2422
APP_SIGNALS_ADOT_JAR: "https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar"
2523
METRIC_NAMESPACE: AppSignals
2624
LOG_GROUP_NAME: /aws/appsignals/generic
@@ -33,15 +31,6 @@ jobs:
3331
with:
3432
fetch-depth: 0
3533

36-
- name: Set CW Agent RPM environment variable
37-
run: |
38-
if [ ${{ env.AWS_DEFAULT_REGION }} == "us-east-1" ]; then
39-
echo APP_SIGNALS_CW_AGENT_RPM="https://amazoncloudwatch-agent-us-east-1.s3.amazonaws.com/amazon_linux/amd64/1.300031.0b313/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
40-
else
41-
echo APP_SIGNALS_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
42-
fi
43-
44-
4534
- name: Generate testing id
4635
run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
4736

@@ -52,88 +41,45 @@ jobs:
5241
aws-region: ${{ env.AWS_DEFAULT_REGION }}
5342

5443
- name: Set up terraform
55-
uses: hashicorp/setup-terraform@v3
44+
uses: hashicorp/setup-terraform@v2
5645
with:
5746
terraform_wrapper: false
5847

59-
- name: Deploy sample app via terraform and wait for endpoint to come online
48+
- name: Deploy sample app via terraform
6049
working-directory: testing/terraform/ec2
6150
run: |
6251
terraform init
6352
terraform validate
64-
65-
# Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online.
66-
# There may be occasional failures due to transitivity issues, so try up to 2 times.
67-
# deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates
68-
# that it failed at some point
69-
retry_counter=0
70-
max_retry=2
71-
while [ $retry_counter -lt $max_retry ]; do
72-
echo "Attempt $retry_counter"
73-
deployment_failed=0
74-
terraform apply -auto-approve \
75-
-var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
76-
-var="test_id=${{ env.TESTING_ID }}" \
77-
-var="sample_app_jar=${{ env.SAMPLE_APP_FRONTEND_SERVICE_JAR }}" \
78-
-var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
79-
-var="cw_agent_rpm=${{ env.APP_SIGNALS_CW_AGENT_RPM }}" \
80-
-var="adot_jar=${{ env.APP_SIGNALS_ADOT_JAR }}" \
81-
|| deployment_failed=$?
82-
83-
if [ $deployment_failed -eq 1 ]; then
84-
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
85-
fi
86-
87-
# If the deployment_failed is still 0, then the terraform deployment succeeded and now try to connect to the endpoint.
88-
# Attempts to connect will be made for up to 10 minutes
89-
if [ $deployment_failed -eq 0 ]; then
90-
echo "Attempting to connect to the endpoint"
91-
sample_app_endpoint=http://$(terraform output sample_app_main_service_public_dns):8080
92-
attempt_counter=0
93-
max_attempts=60
94-
until $(curl --output /dev/null --silent --head --fail $(echo "$sample_app_endpoint" | tr -d '"')); do
95-
if [ ${attempt_counter} -eq ${max_attempts} ];then
96-
echo "Failed to connect to endpoint. Will attempt to redeploy sample app."
97-
deployment_failed=1
98-
break
99-
fi
100-
101-
printf '.'
102-
attempt_counter=$(($attempt_counter+1))
103-
sleep 10
104-
done
105-
fi
106-
107-
# If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
108-
# resources created from terraform and try again.
109-
if [ $deployment_failed -eq 1 ]; then
110-
echo "Destroying terraform"
111-
terraform destroy -auto-approve \
112-
-var="test_id=${{ env.TESTING_ID }}"
113-
114-
retry_counter=$(($retry_counter+1))
115-
else
116-
# If deployment succeeded, then exit the loop
117-
break
118-
fi
119-
120-
if [ $retry_counter -eq $max_retry ]; then
121-
echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code"
122-
exit 1
123-
fi
124-
done
125-
126-
- name: Get the ec2 instance ami id
127-
run: |
128-
echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV
129-
working-directory: testing/terraform/ec2
53+
terraform apply -auto-approve \
54+
-var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
55+
-var="test_id=${{ env.TESTING_ID }}" \
56+
-var="sample_app_jar=${{ env.SAMPLE_APP_FRONTEND_SERVICE_JAR }}" \
57+
-var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
58+
-var="cw_agent_rpm=${{ env.APP_SIGNALS_CW_AGENT_RPM }}" \
59+
-var="adot_jar=${{ env.APP_SIGNALS_ADOT_JAR }}"
13060
13161
- name: Get the sample app endpoint
13262
run: |
13363
echo "MAIN_SERVICE_ENDPOINT=$(terraform output sample_app_main_service_public_dns):8080" >> $GITHUB_ENV
13464
echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_public_ip)" >> $GITHUB_ENV
13565
working-directory: testing/terraform/ec2
13666

67+
- name: Wait for app endpoint to come online
68+
id: endpoint-check
69+
run: |
70+
attempt_counter=0
71+
max_attempts=30
72+
until $(curl --output /dev/null --silent --head --fail http://${{ env.MAIN_SERVICE_ENDPOINT }}); do
73+
if [ ${attempt_counter} -eq ${max_attempts} ];then
74+
echo "Max attempts reached"
75+
exit 1
76+
fi
77+
78+
printf '.'
79+
attempt_counter=$(($attempt_counter+1))
80+
sleep 10
81+
done
82+
13783
# This steps increases the speed of the validation by creating the telemetry data in advance
13884
- name: Call all test APIs
13985
continue-on-error: true
@@ -157,7 +103,6 @@ jobs:
157103
--service-name sample-application-${{ env.TESTING_ID }}
158104
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
159105
--request-body ip=${{ env.REMOTE_SERVICE_IP }}
160-
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
161106
--rollup'
162107

163108
- name: Validate generated metrics
@@ -174,7 +119,6 @@ jobs:
174119
--service-name sample-application-${{ env.TESTING_ID }}
175120
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
176121
--request-body ip=${{ env.REMOTE_SERVICE_IP }}
177-
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
178122
--rollup'
179123

180124
- name: Validate generated traces
@@ -191,7 +135,6 @@ jobs:
191135
--service-name sample-application-${{ env.TESTING_ID }}
192136
--remote-service-name sample-remote-application-${{ env.TESTING_ID }}
193137
--request-body ip=${{ env.REMOTE_SERVICE_IP }}
194-
--instance-ami ${{ env.EC2_INSTANCE_AMI }}
195138
--rollup'
196139

197140
- name: Publish metric on test result
@@ -220,4 +163,4 @@ jobs:
220163
working-directory: testing/terraform/ec2
221164
run: |
222165
terraform destroy -auto-approve \
223-
-var="test_id=${{ env.TESTING_ID }}"
166+
-var="test_id=${{ env.TESTING_ID }}"

.github/workflows/appsignals-e2e-eks-canary-test.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
e2e-test:
21-
strategy:
22-
fail-fast: false
23-
matrix:
24-
aws-region: ['us-east-1', 'us-east-2', 'eu-west-1', 'ap-northeast-1', 'ap-southeast-2']
20+
e2e-canary-test:
2521
uses: ./.github/workflows/appsignals-e2e-eks-test.yml
2622
secrets: inherit
2723
with:
28-
aws-region: ${{ matrix.aws-region }}
2924
test-cluster-name: 'e2e-canary-test'
3025
caller-workflow-name: 'appsignals-e2e-eks-canary-test'

0 commit comments

Comments
 (0)