32
32
# The precense of this env var is required for use by terraform and AWS CLI commands
33
33
# It is not redundant
34
34
AWS_DEFAULT_REGION : ${{ inputs.aws-region }}
35
- PYTHON_SAMPLE_APP_NAMESPACE : python-app-namespace
36
35
METRIC_NAMESPACE : AppSignals
37
36
LOG_GROUP_NAME : /aws/appsignals/eks
38
- TEST_RESOURCES_FOLDER : /home/runner/work/aws-application-signals-test-framework/aws-application-signals-test-framework
39
37
40
38
jobs :
41
39
python-e2e-eks-test :
42
40
runs-on : ubuntu-latest
41
+ container :
42
+ image : public.ecr.aws/h6o3z5z9/aws-application-signals-test-framework-workflow-container:latest
43
43
steps :
44
44
- uses : actions/checkout@v4
45
45
with :
63
63
delete_log_group="aws logs delete-log-group --log-group-name '${{ env.LOG_GROUP_NAME }}' --region \$REGION"
64
64
sed -i "s#$delete_log_group##g" clean-app-signals.sh
65
65
66
- - name : Generate testing id
67
- run : echo TESTING_ID="${{ inputs.aws-region }}-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
66
+ - name : Generate testing id and python sample app namespace
67
+ run : |
68
+ echo TESTING_ID="${{ inputs.aws-region }}-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
69
+ echo PYTHON_SAMPLE_APP_NAMESPACE="ns-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
68
70
69
71
- name : Configure AWS Credentials
70
72
uses : aws-actions/configure-aws-credentials@v4
86
88
role-to-assume : arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ inputs['caller-workflow-name'] == 'main-build' && secrets.ADOT_E2E_TEST_ROLE_ARN || secrets.E2E_TEST_ROLE_ARN }}
87
89
aws-region : ${{ inputs.aws-region }}
88
90
89
- # local directory to store the kubernetes config
90
- - name : Create kubeconfig directory
91
- run : mkdir -p ${{ github.workspace }}/.kube
92
-
93
- - name : Set KUBECONFIG environment variable
94
- run : echo KUBECONFIG="${{ github.workspace }}/.kube/config" >> $GITHUB_ENV
95
-
96
91
- name : Set up kubeconfig
97
92
run : aws eks update-kubeconfig --name ${{ inputs.test-cluster-name }} --region ${{ inputs.aws-region }}
98
93
99
- - name : Install eksctl
100
- uses : ./.github/workflows/actions/execute_and_retry
101
- with :
102
- pre-command : ' mkdir ${{ github.workspace }}/eksctl'
103
- command : ' curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz"
104
- && tar -xzf eksctl_Linux_amd64.tar.gz -C ${{ github.workspace }}/eksctl && rm eksctl_Linux_amd64.tar.gz'
105
- cleanup : ' rm -f eksctl_Linux_amd64.tar.gz'
106
-
107
94
- name : Add eksctl to Github Path
108
95
run : |
109
96
echo "${{ github.workspace }}/eksctl" >> $GITHUB_PATH
@@ -121,13 +108,6 @@ jobs:
121
108
--region ${{ inputs.aws-region }} \
122
109
--approve"
123
110
124
- - name : Set up terraform
125
- uses : ./.github/workflows/actions/execute_and_retry
126
- with :
127
- command : " wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg"
128
- 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
129
- && sudo apt update && sudo apt install terraform'
130
-
131
111
- name : Initiate Terraform
132
112
uses : ./.github/workflows/actions/execute_and_retry
133
113
with :
@@ -167,7 +147,7 @@ jobs:
167
147
# after installing Application Signals. Attempts to connect will be made for up to 10 minutes
168
148
if [ $deployment_failed -eq 0 ]; then
169
149
echo "Installing application signals to the sample app"
170
- source ${GITHUB_WORKSPACE}/.github/workflows/util/execute_and_retry.sh
150
+ . ${GITHUB_WORKSPACE}/.github/workflows/util/execute_and_retry.sh
171
151
execute_and_retry 2 \
172
152
"${GITHUB_WORKSPACE}/enablement-script/enable-app-signals.sh \
173
153
${{ inputs.test-cluster-name }} \
@@ -327,7 +307,7 @@ jobs:
327
307
- name : Publish metric on test result
328
308
if : always()
329
309
run : |
330
- if [[ "${{ steps.log-validation.outcome }}" == "success" && "${{ steps.metric-validation.outcome }}" == "success" && "${{ steps.trace-validation.outcome }}" == "success" ] ]; then
310
+ if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
331
311
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
332
312
--metric-name Failure \
333
313
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=${{ inputs.caller-workflow-name }} \
@@ -363,6 +343,7 @@ jobs:
363
343
- name : Terraform destroy
364
344
if : always()
365
345
continue-on-error : true
346
+ timeout-minutes : 5
366
347
working-directory : terraform/python/eks
367
348
run : |
368
349
terraform destroy -auto-approve \
0 commit comments