Skip to content

Commit fbe568f

Browse files
committed
[K8s] Fix region references and concurrency tag
1 parent f4e3948 commit fbe568f

File tree

3 files changed

+16
-30
lines changed

3 files changed

+16
-30
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ on:
1212
- cron: '*/15 * * * *' # run the workflow every 15 minutes
1313
workflow_dispatch: # be able to run the workflow on demand
1414

15-
concurrency:
16-
group: ${{ github.workflow }}
17-
cancel-in-progress: false
18-
1915
permissions:
2016
id-token: write
2117
contents: read

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
required: true
1616
type: string
1717

18+
concurrency:
19+
group: '${{ github.workflow }} @ ${{ inputs.aws-region }}'
20+
cancel-in-progress: false
21+
1822
permissions:
1923
id-token: write
2024
contents: read
@@ -26,22 +30,23 @@ env:
2630
TEST_ACCOUNT: ${{ secrets.APP_SIGNALS_E2E_TEST_ACC }}
2731
METRIC_NAMESPACE: AppSignals
2832
LOG_GROUP_NAME: /aws/appsignals/k8s
29-
TEST_RESOURCES_FOLDER: /home/runner/work/aws-application-signals-test-framework/aws-application-signals-test-framework
3033
MASTER_NODE_SSH_KEY: ${{ secrets.APP_SIGNALS_E2E_K8S_SSH_KEY_IAD }}
3134
MAIN_SERVICE_ENDPOINT: ${{ secrets.APP_SIGNALS_E2E_K8S_MASTER_NODE_ENDPOINT }}
3235
SAMPLE_APP_NAMESPACE: sample-app-namespace
33-
36+
TEST_RESOURCES_FOLDER: /__w/aws-application-signals-test-framework/aws-application-signals-test-framework
3437

3538
jobs:
3639
e2e-k8s-test:
3740
runs-on: ubuntu-latest
41+
container:
42+
image: public.ecr.aws/h6o3z5z9/aws-application-signals-test-framework-workflow-container:latest
3843
steps:
3944
- uses: actions/checkout@v4
4045
with:
4146
fetch-depth: 0
4247

4348
- name: Generate testing id
44-
run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
49+
run: echo TESTING_ID="${{ env.AWS_DEFAULT_REGION }}-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
4550

4651
- name: Configure AWS Credentials
4752
uses: aws-actions/configure-aws-credentials@v4
@@ -70,16 +75,8 @@ jobs:
7075
sed -i 's#\${IMAGE}#${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_DEFAULT_REGION }}.amazonaws.com/${{ secrets.APP_SIGNALS_E2E_RE_SA_IMG }}#' remote-service-depl.yaml
7176
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ env.AWS_DEFAULT_REGION }} --key frontend-service-depl.yaml --body frontend-service-depl.yaml
7277
aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ env.AWS_DEFAULT_REGION }} --key remote-service-depl.yaml --body remote-service-depl.yaml
73-
74-
75-
- name: Set up terraform
76-
uses: ./.github/workflows/actions/execute_and_retry
77-
with:
78-
command: "wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg"
79-
post-command: 'echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
80-
&& sudo apt update && sudo apt install terraform'
8178
82-
- name: Initiate Terraform for Deployment
79+
- name: Initiate Terraform
8380
uses: ./.github/workflows/actions/execute_and_retry
8481
with:
8582
command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/k8s/deploy && terraform init && terraform validate"
@@ -98,22 +95,15 @@ jobs:
9895
run: |
9996
echo REMOTE_SERVICE_IP="$(aws ssm get-parameter --region ${{ env.AWS_DEFAULT_REGION }} --name remote-service-ip | jq -r '.Parameter.Value')" >> $GITHUB_ENV
10097
101-
- name: Build Gradlew
102-
uses: ./.github/workflows/actions/execute_and_retry
103-
with:
104-
max_retry: 2
105-
command: "./gradlew"
106-
cleanup: "./gradlew clean"
107-
10898
# This steps increases the speed of the validation by creating the telemetry data in advance
10999
# It is run after the gradle build to give the app time to initialize after the pods become ready
110100
- name: Call all test APIs
111101
continue-on-error: true
112102
run: |
113-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/outgoing-http-call/
114-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/aws-sdk-call/
115-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
116-
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/client-call/
103+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/outgoing-http-call/; echo
104+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/aws-sdk-call/; echo
105+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/; echo
106+
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}:30100/client-call/; echo
117107
118108
# Validation for pulse telemetry data
119109
- name: Validate generated EMF logs
@@ -171,7 +161,7 @@ jobs:
171161
- name: Publish metric on test result
172162
if: always()
173163
run: |
174-
if [[ "${{ steps.log-validation.outcome }}" == "success" && "${{ steps.metric-validation.outcome }}" == "success" && "${{ steps.trace-validation.outcome }}" == "success" ]]; then
164+
if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
175165
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
176166
--metric-name Failure \
177167
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \
@@ -198,7 +188,7 @@ jobs:
198188
working-directory: terraform/k8s/cleanup
199189
run: |
200190
terraform apply -auto-approve \
201-
-var="aws_region=${{ inputs.aws-region }}" \
191+
-var="aws_region=${{ env.AWS_DEFAULT_REGION }}" \
202192
-var="test_id=${{ env.TESTING_ID }}" \
203193
-var="ssh_key=${{ env.MASTER_NODE_SSH_KEY }}" \
204194
-var="host=${{ env.MAIN_SERVICE_ENDPOINT }}"

terraform/k8s/deploy/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "null_resource" "deploy" {
4040
git clone https://github.com/aws/amazon-cloudwatch-agent-operator -q
4141
cd amazon-cloudwatch-agent-operator/helm/
4242
echo "LOG: Installing CloudWatch Agent Operator using Helm"
43-
helm upgrade --install --debug --namespace amazon-cloudwatch amazon-cloudwatch-operator ./ --create-namespace --set region=us-east-1 --set clusterName=k8s-cluster-${var.test_id}
43+
helm upgrade --install --debug --namespace amazon-cloudwatch amazon-cloudwatch-operator ./ --create-namespace --set region=${var.aws_region} --set clusterName=k8s-cluster-${var.test_id}
4444
4545
# Wait for pods to exist before checking if they're ready
4646
sleep 60

0 commit comments

Comments
 (0)