Skip to content

Commit 3ec461e

Browse files
committed
update workflows to account for leader pod
1 parent 2f4b0fc commit 3ec461e

2 files changed

Lines changed: 75 additions & 63 deletions

File tree

.github/workflows/eks-performance-cluster-addon-install.yml

Lines changed: 73 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ env:
6767

6868
# Github repository environment variables
6969
OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator"
70+
CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test"
71+
CWA_GITHUB_TEST_REPO_BRANCH: "performance-test-testrun"
7072

7173
jobs:
7274
# Check if this workflow should run
@@ -85,61 +87,62 @@ jobs:
8587
outputs:
8688
should_continue: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'schedule') }}
8789

88-
# Get latest operator commit from github repo
89-
GetLatestOperatorCommitSHA:
90-
needs: check-trigger
91-
if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
92-
runs-on: ubuntu-latest
93-
outputs:
94-
operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}}
95-
operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}}
96-
steps:
97-
- name: Checkout the target repo
98-
uses: actions/checkout@v4
99-
with:
100-
repository: ${{env.OPERATOR_GITHUB_REPO_NAME}}
101-
ref: ${{ inputs.operator-branch || 'main' }}
102-
path: operator-repo
103-
104-
- name: Get latest commit SHA
105-
id: get_latest_sha
106-
run: |
107-
cd operator-repo
108-
latest_sha=$(git rev-parse HEAD)
109-
echo "operator_sha=$latest_sha" >> "$GITHUB_OUTPUT"
110-
111-
# Build and upload agent image to ECR repo
112-
BuildAgent:
113-
needs: check-trigger
114-
if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
115-
uses: ./.github/workflows/build-test-artifacts.yml
116-
concurrency:
117-
group: "Build-Test-Artifacts-${{github.ref_name}}"
118-
cancel-in-progress: true
119-
secrets: inherit
120-
permissions:
121-
id-token: write
122-
contents: read
123-
with:
124-
test-image-before-upload: false
125-
126-
# Build and upload operator image to ECR repo
127-
BuildOperator:
128-
needs: [ check-trigger, GetLatestOperatorCommitSHA ]
129-
if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
130-
uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main
131-
concurrency:
132-
group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }}
133-
cancel-in-progress: true
134-
secrets: inherit
135-
with:
136-
tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
137-
target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
138-
repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}}
139-
test-image-before-upload: false
90+
# # Get latest operator commit from github repo
91+
# GetLatestOperatorCommitSHA:
92+
# needs: check-trigger
93+
# if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
94+
# runs-on: ubuntu-latest
95+
# outputs:
96+
# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}}
97+
# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}}
98+
# steps:
99+
# - name: Checkout the target repo
100+
# uses: actions/checkout@v4
101+
# with:
102+
# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}}
103+
# ref: ${{ inputs.operator-branch || 'main' }}
104+
# path: operator-repo
105+
#
106+
# - name: Get latest commit SHA
107+
# id: get_latest_sha
108+
# run: |
109+
# cd operator-repo
110+
# latest_sha=$(git rev-parse HEAD)
111+
# echo "operator_sha=$latest_sha" >> "$GITHUB_OUTPUT"
112+
#
113+
# # Build and upload agent image to ECR repo
114+
# BuildAgent:
115+
# needs: check-trigger
116+
# if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
117+
# uses: ./.github/workflows/build-test-artifacts.yml
118+
# concurrency:
119+
# group: "Build-Test-Artifacts-${{github.ref_name}}"
120+
# cancel-in-progress: true
121+
# secrets: inherit
122+
# permissions:
123+
# id-token: write
124+
# contents: read
125+
# with:
126+
# test-image-before-upload: false
127+
#
128+
# # Build and upload operator image to ECR repo
129+
# BuildOperator:
130+
# needs: [ check-trigger, GetLatestOperatorCommitSHA ]
131+
# if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
132+
# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main
133+
# concurrency:
134+
# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }}
135+
# cancel-in-progress: true
136+
# secrets: inherit
137+
# with:
138+
# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
139+
# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
140+
# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}}
141+
# test-image-before-upload: false
140142

141143
install-helm:
142-
needs: [ check-trigger, BuildAgent, BuildOperator, GetLatestOperatorCommitSHA ]
144+
# needs: [ check-trigger, BuildAgent, BuildOperator, GetLatestOperatorCommitSHA ]
145+
needs: [ check-trigger ]
143146
if: ${{ needs.check-trigger.outputs.should_continue == 'true' }}
144147
runs-on: ubuntu-latest
145148
permissions:
@@ -176,6 +179,12 @@ jobs:
176179
rm -rf ./helm-charts
177180
git clone -b ${{ inputs.helm-charts-branch || 'main' }} https://github.com/aws-observability/helm-charts.git ./helm-charts
178181
182+
- name: Clone Test Repo
183+
uses: actions/checkout@v4
184+
with:
185+
repository: ${{ env.CWA_GITHUB_TEST_REPO_NAME }}
186+
ref: ${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}
187+
179188
- name: Check node count and manage Helm chart
180189
run: |
181190
NODE_COUNT=$(kubectl get nodes --no-headers | wc -l)
@@ -195,19 +204,21 @@ jobs:
195204
echo "MANAGER_REPOSITORY: ${{ inputs.cloudwatch_agent_operator_repository || env.OPERATOR_ECR_TEST_REPO }}"
196205
echo "MANAGER_TAG: ${{ inputs.cloudwatch_agent_operator_tag || needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}"
197206
echo "MANAGER_REPOSITORY_DOMAIN: ${{ steps.login-ecr.outputs.registry }}"
207+
ls
198208
199209
helm upgrade --install amazon-cloudwatch-observability \
200210
./helm-charts/charts/amazon-cloudwatch-observability \
201211
--namespace amazon-cloudwatch \
202212
--create-namespace \
203-
--set clusterName=${{ inputs.cluster_name ||env.CLUSTER_NAME }} \
204-
--set region=${{ inputs.region || env.AWS_REGION }} \
205-
--set agent.image.repository=${{ inputs.cloudwatch_agent_repository || env.AGENT_ECR_TEST_REPO }} \
206-
--set agent.image.tag=${{ inputs.cloudwatch_agent_tag || github.sha }} \
207-
--set agent.image.repositoryDomainMap.public=${{ steps.login-ecr.outputs.registry }} \
208-
--set manager.image.repository=${{ inputs.cloudwatch_agent_operator_repository || env.OPERATOR_ECR_TEST_REPO }} \
209-
--set manager.image.tag=${{ inputs.cloudwatch_agent_operator_tag || needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} \
210-
--set manager.image.repositoryDomainMap.public=${{ steps.login-ecr.outputs.registry }}
213+
--set clusterName="eks-performance" \
214+
--set region="us-west-2" \
215+
--set agent.image.repository="cwagent-integration-test" \
216+
--set agent.image.tag="0ed03d7052efec77c8d1a2b40109de9c20e47b7f" \
217+
--set agent.image.repositoryDomainMap.public="506463145083.dkr.ecr.us-west-2.amazonaws.com" \
218+
--set manager.image.repository="cwagent-operator-pre-release" \
219+
--set manager.image.tag="1fd8d00ed22eaefb781b2f707f76d7d12a1755ba" \
220+
--set manager.image.repositoryDomainMap.public="506463145083.dkr.ecr.us-west-2.amazonaws.com" \
221+
--values .test/performance/eks/resources/leader_election_overrides/base-overrides.yml
211222
fi
212223
213224
cleanup-on-failure:
@@ -243,4 +254,5 @@ jobs:
243254
run: |
244255
echo "Test was cancelled or failed. Cleaning up resources..."
245256
helm uninstall amazon-cloudwatch-observability -n amazon-cloudwatch || echo "Chart not found or already removed"
257+
kubectl delete crd amazoncloudwatchagents.cloudwatch.aws.amazon.com
246258
echo "Cleanup completed"

.github/workflows/eks-performance-cluster-scaling.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ jobs:
126126
127127
# Determine expected count based on trigger type
128128
if [ "${{ github.event.schedule }}" = "0 21 * * 1" ]; then
129-
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * 0))
129+
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * 0 + 1))
130130
else
131-
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * $DESIRED_CAPACITY_PER_NODEGROUP))
131+
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * $DESIRED_CAPACITY_PER_NODEGROUP + 1))
132132
fi
133133
134134
echo "Expected total nodes: $EXPECTED_NODE_COUNT"

0 commit comments

Comments
 (0)