From 2530981217c1d9477f85e540746604fc7e5da3b4 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:11:05 -0500 Subject: [PATCH 01/52] fixed cluster_name --- .github/workflows/e2e/e2e-rosa-test.yml | 181 ++++++++++++++++++++++++ .github/workflows/e2e/rosa-test.yml | 144 +++++++++++++++++++ 2 files changed, 325 insertions(+) create mode 100644 .github/workflows/e2e/e2e-rosa-test.yml create mode 100644 .github/workflows/e2e/rosa-test.yml diff --git a/.github/workflows/e2e/e2e-rosa-test.yml b/.github/workflows/e2e/e2e-rosa-test.yml new file mode 100644 index 0000000000..7e75f04c1d --- /dev/null +++ b/.github/workflows/e2e/e2e-rosa-test.yml @@ -0,0 +1,181 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Reusable EKS E2E Test + +env: + TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours + CLUSTER_NAME: ${{var.ROSA_CLUSTER_NAME}} + +on: + workflow_call: + inputs: + terraform_dir: + required: true + type: string + job_id: + required: true + type: string + test_props: + required: true + type: string + test_repo_name: + required: true + type: string + test_repo_url: + required: true + type: string + test_repo_branch: + required: true + type: string + cloudwatch_agent_repository: + required: true + type: string + cloudwatch_agent_tag: + required: true + type: string + cloudwatch_agent_operator_repository: + required: true + type: string + cloudwatch_agent_target_allocator_repository: + required: false + type: string + cloudwatch_agent_operator_tag: + required: true + type: string + region: + required: true + type: string + helm_charts_branch: + required: true + type: string + terraform_assume_role: + required: true + type: string + agent_config: + required: true + type: string + prometheus_config: + required: false + type: string + default: "" + otel_config: + required: false + type: string + default: "" + sample_app: + required: true + type: string + +jobs: + RosaTest: + name: 'RosaTest' + runs-on: ubuntu-latest + strategy: + fail-fast: false +# matrix: +# arrays: ${{ fromJson(inputs.test_props) }} + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role}} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + - name: Login ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Verify Terraform version + run: terraform --version + + - name: Install oc + uses: redhat-actions/oc-installer@v1 + + - name: Get Secrets + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + parse-json-secrets: true + secret-ids: | + ,${{env.CLUSTER_NAME}}-htpasswd + + - name: Login to OpenShift + uses: redhat-actions/oc-login@v1 + with: + # URL to your OpenShift cluster. + openshift_server_url: ${{ env.OPENSHIFT_SERVER }} + openshift_username: ${{ env.OPENSHIFT_USERNAME }} + openshift_password: ${{ env.OPENSHIFT_PASSWORD }} + + - name: ClusterTest + with: + command: | + cd ./test/e2e/rosa + go test --cluster-name ${{env.CLUSTER_NAME}} -v + +# +# - name: Terraform apply +# uses: nick-fields/retry@v2 +# env: +# +# with: +# max_attempts: 3 +# timeout_minutes: 60 +# retry_wait_seconds: 5 +# command: | +# if [ "${{ inputs.terraform_dir }}" != "" ]; then +# cd "${{ inputs.terraform_dir }}" +# else +# cd terraform/eks/e2e +# fi +# +# terraform init +# if terraform apply --auto-approve \ +# -var="region=${{ inputs.region }}" \ +# -var="k8s_version=${{ matrix.arrays.k8s_version }}" \ +# -var="nodes=${{ matrix.arrays.nodes }}" \ +# -var="helm_charts_branch=${{ inputs.helm_charts_branch }}" \ +# -var="cloudwatch_agent_repository_url=${{ steps.login-ecr.outputs.registry }}" \ +# -var="cloudwatch_agent_repository=${{ inputs.cloudwatch_agent_repository }}" \ +# -var="cloudwatch_agent_tag=${{ inputs.cloudwatch_agent_tag }}" \ +# -var="cloudwatch_agent_operator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ +# -var="cloudwatch_agent_operator_repository=${{ inputs.cloudwatch_agent_operator_repository }}" \ +# -var="cloudwatch_agent_operator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ +# -var="cloudwatch_agent_target_allocator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ +# -var="cloudwatch_agent_target_allocator_repository=${{ inputs.cloudwatch_agent_target_allocator_repository }}" \ +# -var="cloudwatch_agent_target_allocator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ +# -var="test_dir=${{ matrix.arrays.test_dir }}" \ +# -var="agent_config=${{ inputs.agent_config }}" \ +# -var="prometheus_config=${{ inputs.prometheus_config }}" \ +# -var="otel_config=${{ inputs.otel_config }}" \ +# -var="sample_app=${{ inputs.sample_app }}"; then +# terraform destroy --auto-approve +# else +# terraform destroy --auto-approve && exit 1 +# fi +# +# - name: Terraform destroy +# if: ${{ cancelled() || failure() }} +# uses: nick-fields/retry@v2 +# with: +# max_attempts: 3 +# timeout_minutes: 8 +# retry_wait_seconds: 5 +# command: | +# if [ "${{ inputs.terraform_dir }}" != "" ]; then +# cd "${{ inputs.terraform_dir }}" +# else +# cd terraform/eks/e2e +# fi +# terraform destroy --auto-approve diff --git a/.github/workflows/e2e/rosa-test.yml b/.github/workflows/e2e/rosa-test.yml new file mode 100644 index 0000000000..0078390d8d --- /dev/null +++ b/.github/workflows/e2e/rosa-test.yml @@ -0,0 +1,144 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Run E2E Tests +env: + TERRAFORM_AWS_ASSUME_ROLE: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" + TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours + ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" + CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" + CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" + CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" + TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} + TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} + OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" + +on: +# schedule: +# - cron: '0 17 * * 1' + push: + branches: + - rosa + + workflow_dispatch: + inputs: + region: + required: false + type: string + description: 'AWS Region to run tests in' + default: 'us-west-2' + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + helm-charts-branch: + required: false + type: string + description: 'Branch of the helm charts to test' + default: 'main' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-parent + cancel-in-progress: true + +jobs: +# GetLatestOperatorCommitSHA: +# runs-on: ubuntu-latest +# outputs: +# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} +# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# steps: +# - name: Checkout the target repo +# uses: actions/checkout@v3 +# with: +# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# ref: ${{ inputs.operator-branch || 'main' }} +# path: operator-repo +# +# - name: Get latest commit SHA +# id: get_latest_sha +# run: | +# cd operator-repo +# latest_sha=$(git rev-parse HEAD) +# echo "::set-output name=operator_sha::$latest_sha" + +# BuildAgent: +# uses: ./.github/workflows/build-test-artifacts.yml +# concurrency: +# group: "Build-Test-Artifacts-${{github.ref_name}}" +# cancel-in-progress: true +# secrets: inherit +# permissions: +# id-token: write +# contents: read +# with: +# test-image-before-upload: false +# +# BuildOperator: +# needs: [GetLatestOperatorCommitSHA] +# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main +# concurrency: +# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} +# cancel-in-progress: true +# secrets: inherit +# with: +# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} +# test-image-before-upload: false +# + OutputEnvVariables: +# needs: [ BuildAgent, BuildOperator ] + name: 'OutputEnvVariables' + runs-on: ubuntu-latest + outputs: + CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} + CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} + CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} + ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} + ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} + steps: + + - name: Set output variables + id: set-outputs + run: | + { + echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" + echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" + echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" + echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + } >> "$GITHUB_OUTPUT" + shell: bash + - name: Echo test variables + run: | + echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" + echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" + echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" + echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" + echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" + RosaBaseTest: + needs: [ OutputEnvVariables ] + name: 'Rosa Base Test' + uses: ./.github/workflows/e2e/e2e-rosa-test.yml + with: + terraform_dir: terraform/rosa/e2e + job_id: eks-e2e-jvm-tomcat-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" + agent_config: resources/cwagent_configs/jvm_tomcat.json + sample_app: resources/sample_apps/tomcat.yaml + secrets: inherit From 5a7a7d9f848a7371f719170580f3d287b0d0a22a Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:13:01 -0500 Subject: [PATCH 02/52] wc --- .github/workflows/e2e/rosa-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e/rosa-test.yml b/.github/workflows/e2e/rosa-test.yml index 0078390d8d..f0685815d2 100644 --- a/.github/workflows/e2e/rosa-test.yml +++ b/.github/workflows/e2e/rosa-test.yml @@ -1,9 +1,9 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT -name: Run E2E Tests +name: Run ROSA E2E Tests env: - TERRAFORM_AWS_ASSUME_ROLE: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" + TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" From 8386c0f861579554e513b4a2ff8fa49bb6337a43 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:19:38 -0500 Subject: [PATCH 03/52] wc --- .github/workflows/e2e-test.yml | 352 +++++++++++++++------------- .github/workflows/e2e/rosa-test.yml | 22 +- 2 files changed, 189 insertions(+), 185 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 2ea9b5075a..4fa84f954d 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -16,6 +16,8 @@ env: on: schedule: - cron: '0 17 * * 1' + branches: + - rosa workflow_dispatch: inputs: region: @@ -39,125 +41,191 @@ concurrency: cancel-in-progress: true jobs: - GetLatestOperatorCommitSHA: - runs-on: ubuntu-latest - outputs: - operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} - operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} - steps: - - name: Checkout the target repo - uses: actions/checkout@v3 - with: - repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} - ref: ${{ inputs.operator-branch || 'main' }} - path: operator-repo - - - name: Get latest commit SHA - id: get_latest_sha - run: | - cd operator-repo - latest_sha=$(git rev-parse HEAD) - echo "::set-output name=operator_sha::$latest_sha" - - BuildAgent: - uses: ./.github/workflows/build-test-artifacts.yml - concurrency: - group: "Build-Test-Artifacts-${{github.ref_name}}" - cancel-in-progress: true - secrets: inherit - permissions: - id-token: write - contents: read - with: - test-image-before-upload: false - - BuildOperator: - needs: [GetLatestOperatorCommitSHA] - uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main - concurrency: - group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} - cancel-in-progress: true - secrets: inherit - with: - tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} - test-image-before-upload: false - - OutputEnvVariables: - needs: [ BuildAgent, BuildOperator ] - name: 'OutputEnvVariables' - runs-on: ubuntu-latest - outputs: - CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} - CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} - CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} - ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} - ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} - steps: - - uses: actions/checkout@v3 - with: - repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} - ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} - - - name: Set up Go 1.x - uses: actions/setup-go@v4 - with: - go-version: ~1.22.2 - - - name: SetOutputs - id: set-outputs - run: | - echo "::set-output name=CWA_GITHUB_TEST_REPO_NAME::${{ env.CWA_GITHUB_TEST_REPO_NAME }}" - echo "::set-output name=CWA_GITHUB_TEST_REPO_URL::${{ env.CWA_GITHUB_TEST_REPO_URL }}" - echo "::set-output name=CWA_GITHUB_TEST_REPO_BRANCH::${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" - echo "::set-output name=ECR_INTEGRATION_TEST_REPO::cwagent-integration-test" - echo "::set-output name=ECR_OPERATOR_REPO::$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" - echo "::set-output name=ECR_TARGET_ALLOCATOR_REPO::$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" - - - name: Echo test variables - run: | - echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" - echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" - echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" - echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" - echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" - echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" - - GenerateTestMatrix: - needs: [BuildAgent, BuildOperator] - name: 'GenerateTestMatrix' - runs-on: ubuntu-latest - outputs: - eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }} - steps: - - uses: actions/checkout@v3 - with: - repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} - ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} - - - name: Set up Go 1.x - uses: actions/setup-go@v4 - with: - go-version: ~1.22.2 - - - name: Generate matrix - id: set-matrix - run: | - go run generator/test_case_generator.go -e2e - echo "::set-output name=eks_e2e_jmx_matrix::$(echo $(cat generator/resources/eks_e2e_jmx_complete_test_matrix.json))" - - - name: Echo test plan matrix - run: | - echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" - - EKSE2EJVMTomcatTest: - needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] - name: 'EKSE2EJVMTomcatTest' - uses: ./.github/workflows/eks-e2e-test.yml +# GetLatestOperatorCommitSHA: +# runs-on: ubuntu-latest +# outputs: +# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} +# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# steps: +# - name: Checkout the target repo +# uses: actions/checkout@v3 +# with: +# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# ref: ${{ inputs.operator-branch || 'main' }} +# path: operator-repo +# +# - name: Get latest commit SHA +# id: get_latest_sha +# run: | +# cd operator-repo +# latest_sha=$(git rev-parse HEAD) +# echo "::set-output name=operator_sha::$latest_sha" +# +# BuildAgent: +# uses: ./.github/workflows/build-test-artifacts.yml +# concurrency: +# group: "Build-Test-Artifacts-${{github.ref_name}}" +# cancel-in-progress: true +# secrets: inherit +# permissions: +# id-token: write +# contents: read +# with: +# test-image-before-upload: false +# +# BuildOperator: +# needs: [GetLatestOperatorCommitSHA] +# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main +# concurrency: +# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} +# cancel-in-progress: true +# secrets: inherit +# with: +# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} +# test-image-before-upload: false +# +# OutputEnvVariables: +# needs: [ BuildAgent, BuildOperator ] +# name: 'OutputEnvVariables' +# runs-on: ubuntu-latest +# outputs: +# CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} +# CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} +# ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} +# ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} +# steps: +# - uses: actions/checkout@v3 +# with: +# repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} +# ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} +# +# - name: Set up Go 1.x +# uses: actions/setup-go@v4 +# with: +# go-version: ~1.22.2 +# +# - name: SetOutputs +# id: set-outputs +# run: | +# echo "::set-output name=CWA_GITHUB_TEST_REPO_NAME::${{ env.CWA_GITHUB_TEST_REPO_NAME }}" +# echo "::set-output name=CWA_GITHUB_TEST_REPO_URL::${{ env.CWA_GITHUB_TEST_REPO_URL }}" +# echo "::set-output name=CWA_GITHUB_TEST_REPO_BRANCH::${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" +# echo "::set-output name=ECR_INTEGRATION_TEST_REPO::cwagent-integration-test" +# echo "::set-output name=ECR_OPERATOR_REPO::$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" +# echo "::set-output name=ECR_TARGET_ALLOCATOR_REPO::$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" +# +# - name: Echo test variables +# run: | +# echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" +# echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" +# echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" +# echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" +# echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" +# echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" +# +# GenerateTestMatrix: +# needs: [BuildAgent, BuildOperator] +# name: 'GenerateTestMatrix' +# runs-on: ubuntu-latest +# outputs: +# eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }} +# steps: +# - uses: actions/checkout@v3 +# with: +# repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} +# ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} +# +# - name: Set up Go 1.x +# uses: actions/setup-go@v4 +# with: +# go-version: ~1.22.2 +# +# - name: Generate matrix +# id: set-matrix +# run: | +# go run generator/test_case_generator.go -e2e +# echo "::set-output name=eks_e2e_jmx_matrix::$(echo $(cat generator/resources/eks_e2e_jmx_complete_test_matrix.json))" +# +# - name: Echo test plan matrix +# run: | +# echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" +# +# EKSE2EJVMTomcatTest: +# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] +# name: 'EKSE2EJVMTomcatTest' +# uses: ./.github/workflows/eks-e2e-test.yml +# with: +# terraform_dir: terraform/eks/e2e +# job_id: eks-e2e-jvm-tomcat-test +# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} +# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} +# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} +# cloudwatch_agent_tag: ${{ github.sha }} +# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} +# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} +# region: ${{ inputs.region || 'us-west-2' }} +# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} +# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} +# agent_config: resources/cwagent_configs/jvm_tomcat.json +# sample_app: resources/sample_apps/tomcat.yaml +# secrets: inherit +# +# EKSE2EKafkaTest: +# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] +# name: 'EKSE2EKafkaTest' +# uses: ./.github/workflows/eks-e2e-test.yml +# with: +# terraform_dir: terraform/eks/e2e +# job_id: eks-e2e-kafka-test +# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} +# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} +# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} +# cloudwatch_agent_tag: ${{ github.sha }} +# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} +# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} +# region: ${{ inputs.region || 'us-west-2' }} +# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} +# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} +# agent_config: resources/cwagent_configs/kafka.json +# sample_app: resources/sample_apps/kafka.yaml +# secrets: inherit +# +# EKSE2EJMXContainerInsightsTest: +# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] +# name: 'EKSE2EJMXContainerInsightsTest' +# uses: ./.github/workflows/eks-e2e-test.yml +# with: +# terraform_dir: terraform/eks/e2e +# job_id: eks-e2e-jmx-containerinsights-test +# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} +# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} +# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} +# cloudwatch_agent_tag: ${{ github.sha }} +# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} +# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} +# region: ${{ inputs.region || 'us-west-2' }} +# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} +# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} +# agent_config: resources/cwagent_configs/containerinsights.json +# sample_app: resources/sample_apps/tomcat.yaml +# secrets: inherit + + RosaBaseTest: + needs: [ OutputEnvVariables ] + name: 'Rosa Base Test' + uses: ./.github/workflows/e2e/e2e-rosa-test.yml with: - terraform_dir: terraform/eks/e2e + terraform_dir: terraform/rosa/e2e job_id: eks-e2e-jvm-tomcat-test test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} @@ -169,51 +237,7 @@ jobs: cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} region: ${{ inputs.region || 'us-west-2' }} helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + terraform_assume_role: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml - secrets: inherit - - EKSE2EKafkaTest: - needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] - name: 'EKSE2EKafkaTest' - uses: ./.github/workflows/eks-e2e-test.yml - with: - terraform_dir: terraform/eks/e2e - job_id: eks-e2e-kafka-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} - agent_config: resources/cwagent_configs/kafka.json - sample_app: resources/sample_apps/kafka.yaml - secrets: inherit - - EKSE2EJMXContainerInsightsTest: - needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] - name: 'EKSE2EJMXContainerInsightsTest' - uses: ./.github/workflows/eks-e2e-test.yml - with: - terraform_dir: terraform/eks/e2e - job_id: eks-e2e-jmx-containerinsights-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} - agent_config: resources/cwagent_configs/containerinsights.json - sample_app: resources/sample_apps/tomcat.yaml - secrets: inherit + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/e2e/rosa-test.yml b/.github/workflows/e2e/rosa-test.yml index f0685815d2..bbfb4f7b2f 100644 --- a/.github/workflows/e2e/rosa-test.yml +++ b/.github/workflows/e2e/rosa-test.yml @@ -121,24 +121,4 @@ jobs: echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" - RosaBaseTest: - needs: [ OutputEnvVariables ] - name: 'Rosa Base Test' - uses: ./.github/workflows/e2e/e2e-rosa-test.yml - with: - terraform_dir: terraform/rosa/e2e - job_id: eks-e2e-jvm-tomcat-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" - agent_config: resources/cwagent_configs/jvm_tomcat.json - sample_app: resources/sample_apps/tomcat.yaml - secrets: inherit + From 334ba414b5f2f77c721bab1db6c9f5b3dadb9e77 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:20:45 -0500 Subject: [PATCH 04/52] branch --- .github/workflows/e2e-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4fa84f954d..4e4bc1035a 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -16,8 +16,9 @@ env: on: schedule: - cron: '0 17 * * 1' - branches: - - rosa + push: + branches: + - rosa workflow_dispatch: inputs: region: From 65aa6641d7791221e345d5339f88feabda0ea7ee Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:22:23 -0500 Subject: [PATCH 05/52] wc --- .github/workflows/{e2e => }/e2e-rosa-test.yml | 0 .github/workflows/e2e-test.yml | 82 +++--- .github/workflows/e2e/rosa-test.yml | 236 +++++++++--------- 3 files changed, 159 insertions(+), 159 deletions(-) rename .github/workflows/{e2e => }/e2e-rosa-test.yml (100%) diff --git a/.github/workflows/e2e/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml similarity index 100% rename from .github/workflows/e2e/e2e-rosa-test.yml rename to .github/workflows/e2e-rosa-test.yml diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4e4bc1035a..32e5ecf18d 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -87,47 +87,47 @@ jobs: # repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} # test-image-before-upload: false # -# OutputEnvVariables: + OutputEnvVariables: # needs: [ BuildAgent, BuildOperator ] -# name: 'OutputEnvVariables' -# runs-on: ubuntu-latest -# outputs: -# CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} -# CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} -# ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} -# ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} -# steps: -# - uses: actions/checkout@v3 -# with: -# repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} -# ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} -# -# - name: Set up Go 1.x -# uses: actions/setup-go@v4 -# with: -# go-version: ~1.22.2 -# -# - name: SetOutputs -# id: set-outputs -# run: | -# echo "::set-output name=CWA_GITHUB_TEST_REPO_NAME::${{ env.CWA_GITHUB_TEST_REPO_NAME }}" -# echo "::set-output name=CWA_GITHUB_TEST_REPO_URL::${{ env.CWA_GITHUB_TEST_REPO_URL }}" -# echo "::set-output name=CWA_GITHUB_TEST_REPO_BRANCH::${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" -# echo "::set-output name=ECR_INTEGRATION_TEST_REPO::cwagent-integration-test" -# echo "::set-output name=ECR_OPERATOR_REPO::$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" -# echo "::set-output name=ECR_TARGET_ALLOCATOR_REPO::$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" -# -# - name: Echo test variables -# run: | -# echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" -# echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" -# echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" -# echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" -# echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" -# echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" -# + name: 'OutputEnvVariables' + runs-on: ubuntu-latest + outputs: + CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} + CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} + CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} + ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} + ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} + steps: + - uses: actions/checkout@v3 + with: + repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} + ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} + + - name: Set up Go 1.x + uses: actions/setup-go@v4 + with: + go-version: ~1.22.2 + + - name: SetOutputs + id: set-outputs + run: | + echo "::set-output name=CWA_GITHUB_TEST_REPO_NAME::${{ env.CWA_GITHUB_TEST_REPO_NAME }}" + echo "::set-output name=CWA_GITHUB_TEST_REPO_URL::${{ env.CWA_GITHUB_TEST_REPO_URL }}" + echo "::set-output name=CWA_GITHUB_TEST_REPO_BRANCH::${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "::set-output name=ECR_INTEGRATION_TEST_REPO::cwagent-integration-test" + echo "::set-output name=ECR_OPERATOR_REPO::$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + echo "::set-output name=ECR_TARGET_ALLOCATOR_REPO::$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + + - name: Echo test variables + run: | + echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" + echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" + echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" + echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" + echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" + # GenerateTestMatrix: # needs: [BuildAgent, BuildOperator] # name: 'GenerateTestMatrix' @@ -224,7 +224,7 @@ jobs: RosaBaseTest: needs: [ OutputEnvVariables ] name: 'Rosa Base Test' - uses: ./.github/workflows/e2e/e2e-rosa-test.yml + uses: ./.github/workflows/e2e-rosa-test.yml with: terraform_dir: terraform/rosa/e2e job_id: eks-e2e-jvm-tomcat-test diff --git a/.github/workflows/e2e/rosa-test.yml b/.github/workflows/e2e/rosa-test.yml index bbfb4f7b2f..2a22c874ad 100644 --- a/.github/workflows/e2e/rosa-test.yml +++ b/.github/workflows/e2e/rosa-test.yml @@ -1,124 +1,124 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: MIT - -name: Run ROSA E2E Tests -env: - TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} - TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours - ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" - CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" - CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" - CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" - TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} - TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} - OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" - -on: -# schedule: -# - cron: '0 17 * * 1' - push: - branches: - - rosa - - workflow_dispatch: - inputs: - region: - required: false - type: string - description: 'AWS Region to run tests in' - default: 'us-west-2' - operator-branch: - required: false - type: string - description: 'Branch of the operator to test' - default: 'main' - helm-charts-branch: - required: false - type: string - description: 'Branch of the helm charts to test' - default: 'main' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }}-parent - cancel-in-progress: true - -jobs: -# GetLatestOperatorCommitSHA: +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: MIT +# +#name: Run ROSA E2E Tests +#env: +# TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} +# TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours +# ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" +# CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" +# CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" +# CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" +# TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} +# TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} +# OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" +# +#on: +## schedule: +## - cron: '0 17 * * 1' +# push: +# branches: +# - rosa +# +# workflow_dispatch: +# inputs: +# region: +# required: false +# type: string +# description: 'AWS Region to run tests in' +# default: 'us-west-2' +# operator-branch: +# required: false +# type: string +# description: 'Branch of the operator to test' +# default: 'main' +# helm-charts-branch: +# required: false +# type: string +# description: 'Branch of the helm charts to test' +# default: 'main' +# +#concurrency: +# group: ${{ github.workflow }}-${{ github.ref_name }}-parent +# cancel-in-progress: true +# +#jobs: +## GetLatestOperatorCommitSHA: +## runs-on: ubuntu-latest +## outputs: +## operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} +## operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} +## steps: +## - name: Checkout the target repo +## uses: actions/checkout@v3 +## with: +## repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} +## ref: ${{ inputs.operator-branch || 'main' }} +## path: operator-repo +## +## - name: Get latest commit SHA +## id: get_latest_sha +## run: | +## cd operator-repo +## latest_sha=$(git rev-parse HEAD) +## echo "::set-output name=operator_sha::$latest_sha" +# +## BuildAgent: +## uses: ./.github/workflows/build-test-artifacts.yml +## concurrency: +## group: "Build-Test-Artifacts-${{github.ref_name}}" +## cancel-in-progress: true +## secrets: inherit +## permissions: +## id-token: write +## contents: read +## with: +## test-image-before-upload: false +## +## BuildOperator: +## needs: [GetLatestOperatorCommitSHA] +## uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main +## concurrency: +## group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} +## cancel-in-progress: true +## secrets: inherit +## with: +## tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +## target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +## repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} +## test-image-before-upload: false +## +# OutputEnvVariables: +## needs: [ BuildAgent, BuildOperator ] +# name: 'OutputEnvVariables' # runs-on: ubuntu-latest # outputs: -# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} -# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} +# CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} +# ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} +# ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} # steps: -# - name: Checkout the target repo -# uses: actions/checkout@v3 -# with: -# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} -# ref: ${{ inputs.operator-branch || 'main' }} -# path: operator-repo # -# - name: Get latest commit SHA -# id: get_latest_sha +# - name: Set output variables +# id: set-outputs # run: | -# cd operator-repo -# latest_sha=$(git rev-parse HEAD) -# echo "::set-output name=operator_sha::$latest_sha" - -# BuildAgent: -# uses: ./.github/workflows/build-test-artifacts.yml -# concurrency: -# group: "Build-Test-Artifacts-${{github.ref_name}}" -# cancel-in-progress: true -# secrets: inherit -# permissions: -# id-token: write -# contents: read -# with: -# test-image-before-upload: false -# -# BuildOperator: -# needs: [GetLatestOperatorCommitSHA] -# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main -# concurrency: -# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} -# cancel-in-progress: true -# secrets: inherit -# with: -# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} -# test-image-before-upload: false +# { +# echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" +# echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" +# echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" +# echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" +# echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" +# echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" +# } >> "$GITHUB_OUTPUT" +# shell: bash +# - name: Echo test variables +# run: | +# echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" +# echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" +# echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" +# echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" +# echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" +# echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" # - OutputEnvVariables: -# needs: [ BuildAgent, BuildOperator ] - name: 'OutputEnvVariables' - runs-on: ubuntu-latest - outputs: - CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} - CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} - CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} - ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} - ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} - steps: - - - name: Set output variables - id: set-outputs - run: | - { - echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" - echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" - echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" - echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" - echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" - echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" - } >> "$GITHUB_OUTPUT" - shell: bash - - name: Echo test variables - run: | - echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" - echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" - echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" - echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" - echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" - echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" - From 79732654873cd3a99c5ed033ef825e055a8f647b Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:23:55 -0500 Subject: [PATCH 06/52] update paths --- .github/workflows/e2e-rosa-test.yml | 2 +- .github/workflows/e2e-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 7e75f04c1d..1d3d6ba6fc 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -1,7 +1,7 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT -name: Reusable EKS E2E Test +name: Reusable ROSA E2E Test env: TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 32e5ecf18d..0871b6db68 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -224,7 +224,7 @@ jobs: RosaBaseTest: needs: [ OutputEnvVariables ] name: 'Rosa Base Test' - uses: ./.github/workflows/e2e-rosa-test.yml + uses: ./e2e-rosa-test.yml with: terraform_dir: terraform/rosa/e2e job_id: eks-e2e-jvm-tomcat-test From b4987bf2d405177fe2c2335ce9d00a414edd70d3 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 14:24:33 -0500 Subject: [PATCH 07/52] update paths --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 0871b6db68..32e5ecf18d 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -224,7 +224,7 @@ jobs: RosaBaseTest: needs: [ OutputEnvVariables ] name: 'Rosa Base Test' - uses: ./e2e-rosa-test.yml + uses: ./.github/workflows/e2e-rosa-test.yml with: terraform_dir: terraform/rosa/e2e job_id: eks-e2e-jvm-tomcat-test From fec8dd250df8c0a8578969ffbe049b7602ac07bf Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 15:18:12 -0500 Subject: [PATCH 08/52] added step/run --- .github/workflows/e2e-rosa-test.yml | 10 +++---- .github/workflows/e2e-test.yml | 44 ++++++++++++++--------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 1d3d6ba6fc..03f31d2690 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -118,11 +118,11 @@ jobs: openshift_username: ${{ env.OPENSHIFT_USERNAME }} openshift_password: ${{ env.OPENSHIFT_PASSWORD }} - - name: ClusterTest - with: - command: | - cd ./test/e2e/rosa - go test --cluster-name ${{env.CLUSTER_NAME}} -v + - name: Run cluster test + working-directory: ./test/e2e/rosa + env: + CLUSTER_NAME: ${{env.CLUSTER_NAME}} + run: go test --cluster-name ${{env.CLUSTER_NAME}} -v # # - name: Terraform apply diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 32e5ecf18d..08eb200091 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -127,7 +127,27 @@ jobs: echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" - + RosaBaseTest: + needs: [ OutputEnvVariables ] + name: 'Rosa Base Test' + uses: ./.github/workflows/e2e-rosa-test.yml + secrets: inherit + with: + terraform_dir: terraform/rosa/e2e + job_id: rosa-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{env.TERRAFORM_AWS_ASSUME_ROLE}} + agent_config: resources/cwagent_configs/jvm_tomcat.json + sample_app: resources/sample_apps/tomcat.yaml # GenerateTestMatrix: # needs: [BuildAgent, BuildOperator] # name: 'GenerateTestMatrix' @@ -220,25 +240,3 @@ jobs: # agent_config: resources/cwagent_configs/containerinsights.json # sample_app: resources/sample_apps/tomcat.yaml # secrets: inherit - - RosaBaseTest: - needs: [ OutputEnvVariables ] - name: 'Rosa Base Test' - uses: ./.github/workflows/e2e-rosa-test.yml - with: - terraform_dir: terraform/rosa/e2e - job_id: eks-e2e-jvm-tomcat-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: "arn:aws:iam::956457624121:role/Terraform-Test-Role-1KVXLJHXGQ52P" - agent_config: resources/cwagent_configs/jvm_tomcat.json - sample_app: resources/sample_apps/tomcat.yaml - secrets: inherit \ No newline at end of file From a7118ac416989bd021311f59a63b4bcb82fc73cf Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 15:19:34 -0500 Subject: [PATCH 09/52] changed tf assume role form env to var --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 08eb200091..bb3f4488bc 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -145,7 +145,7 @@ jobs: cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} region: ${{ inputs.region || 'us-west-2' }} helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{env.TERRAFORM_AWS_ASSUME_ROLE}} + terraform_assume_role: ${{vars.TERRAFORM_AWS_ASSUME_ROLE}} agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml # GenerateTestMatrix: From b05db4de3f0080148b3e68d021915e93635118df Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 17:00:47 -0500 Subject: [PATCH 10/52] typo fix --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 03f31d2690..a39b03740f 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -5,7 +5,7 @@ name: Reusable ROSA E2E Test env: TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours - CLUSTER_NAME: ${{var.ROSA_CLUSTER_NAME}} + CLUSTER_NAME: ${{vars.ROSA_CLUSTER_NAME}} on: workflow_call: From 375240ee61220f0735de9c83aaeff5903e302c1e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 17:42:54 -0500 Subject: [PATCH 11/52] updated path --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index a39b03740f..53eb255015 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -119,7 +119,7 @@ jobs: openshift_password: ${{ env.OPENSHIFT_PASSWORD }} - name: Run cluster test - working-directory: ./test/e2e/rosa + working-directory: test/e2e/rosa env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} run: go test --cluster-name ${{env.CLUSTER_NAME}} -v From edce8503db4af3dcc029267ff38ffcd9c8798763 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 17 Feb 2025 17:43:38 -0500 Subject: [PATCH 12/52] temporarily changed default aws region --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 53eb255015..f3dfb129a6 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -88,7 +88,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: ${{ inputs.terraform_assume_role}} - aws-region: ${{ inputs.region }} + aws-region: "us-east-1" role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} - name: Login ECR id: login-ecr From fcc253f675a25413c67f5fac367f288db84a78b6 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 12:40:08 -0500 Subject: [PATCH 13/52] changed secret with wildcard --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index f3dfb129a6..539e5e0b98 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -108,7 +108,7 @@ jobs: with: parse-json-secrets: true secret-ids: | - ,${{env.CLUSTER_NAME}}-htpasswd + ,${{env.CLUSTER_NAME}}-* - name: Login to OpenShift uses: redhat-actions/oc-login@v1 From b1f06b0ed9c9608d5275991bce80c5ce791626b8 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 12:49:01 -0500 Subject: [PATCH 14/52] Revert "temporarily changed default aws region" This reverts commit edce8503db4af3dcc029267ff38ffcd9c8798763. --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 539e5e0b98..d3f76088f4 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -88,7 +88,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: ${{ inputs.terraform_assume_role}} - aws-region: "us-east-1" + aws-region: ${{ inputs.region }} role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} - name: Login ECR id: login-ecr From 0a821edff0deaa48f7fd6b78b1eda6bb70c5458e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 12:50:32 -0500 Subject: [PATCH 15/52] Revert "changed secret with wildcard" This reverts commit fcc253f675a25413c67f5fac367f288db84a78b6. --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index d3f76088f4..53eb255015 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -108,7 +108,7 @@ jobs: with: parse-json-secrets: true secret-ids: | - ,${{env.CLUSTER_NAME}}-* + ,${{env.CLUSTER_NAME}}-htpasswd - name: Login to OpenShift uses: redhat-actions/oc-login@v1 From 7a1764b5c14d7ea0d842b856491014f7f3b0625c Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 12:56:13 -0500 Subject: [PATCH 16/52] changed to look at correct region and test branch --- .github/workflows/e2e-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index bb3f4488bc..374e8035b9 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -8,7 +8,7 @@ env: ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" - CWA_GITHUB_TEST_REPO_BRANCH: "main" + CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" @@ -25,7 +25,7 @@ on: required: false type: string description: 'AWS Region to run tests in' - default: 'us-west-2' + default: 'us-east-1' operator-branch: required: false type: string @@ -143,7 +143,7 @@ jobs: cloudwatch_agent_tag: ${{ github.sha }} cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} + region: ${{ inputs.region || 'us-east-1' }} helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} terraform_assume_role: ${{vars.TERRAFORM_AWS_ASSUME_ROLE}} agent_config: resources/cwagent_configs/jvm_tomcat.json From dedd7d45815cf24e949425fe03c6b167b0903380 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 13:14:52 -0500 Subject: [PATCH 17/52] added rosa cli installation --- .github/workflows/e2e-rosa-test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 53eb255015..de2258d7b8 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -100,9 +100,19 @@ jobs: - name: Verify Terraform version run: terraform --version - - name: Install oc + - name: Install OpenShift CLI uses: redhat-actions/oc-installer@v1 + - name: Install ROSA CLI + shell: bash + run: | + curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz" + tar -xvf rosa-linux.tar.gz + sudo mv rosa /usr/local/bin/rosa + chmod +x /usr/local/bin/rosa + rm -f rosa-linux.tar.gz + rosa version + - name: Get Secrets uses: aws-actions/aws-secretsmanager-get-secrets@v2 with: From cb1cf7cc67916555db1c1266491f78f9c391162b Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 17:30:25 -0500 Subject: [PATCH 18/52] added container insights test --- .github/workflows/e2e-rosa-test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index de2258d7b8..de7df88753 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -134,6 +134,12 @@ jobs: CLUSTER_NAME: ${{env.CLUSTER_NAME}} run: go test --cluster-name ${{env.CLUSTER_NAME}} -v + - name: Run Container Insights Test + working-directory: test/e2e/container_insights + env: + CLUSTER_NAME: ${{env.CLUSTER_NAME}} + run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -v + # # - name: Terraform apply # uses: nick-fields/retry@v2 From af9cf4737c0a49ae7581cca4936cc73b85811bdc Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Feb 2025 17:37:23 -0500 Subject: [PATCH 19/52] added helm charts --- .github/workflows/e2e-rosa-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index de7df88753..ffaa940cf4 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -83,7 +83,11 @@ jobs: with: repository: ${{inputs.test_repo_name}} ref: ${{inputs.test_repo_branch}} - + - uses: actions/checkout@v3 + with: + repository: "aws-observability/helm-charts" + ref: ${{inputs.helm_charts_branch}} + path: "terraform/eks/e2e/helm-charts"# have to fix this later - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: From f577265fc33e6e2f796fc76c59db00620c4faa25 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 19 Feb 2025 10:43:04 -0500 Subject: [PATCH 20/52] added region --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index ffaa940cf4..82e9430237 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -142,7 +142,7 @@ jobs: working-directory: test/e2e/container_insights env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} - run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -v + run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v # # - name: Terraform apply From 18cbe48e7b965c8532c99d253ecc5ca16d82f9fd Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 4 Mar 2025 11:10:47 -0500 Subject: [PATCH 21/52] added security test --- .github/workflows/e2e-rosa-test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 82e9430237..c13dee8f1b 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -132,18 +132,28 @@ jobs: openshift_username: ${{ env.OPENSHIFT_USERNAME }} openshift_password: ${{ env.OPENSHIFT_PASSWORD }} - - name: Run cluster test + - name: Validate Cluster and Host ROSA Setup working-directory: test/e2e/rosa env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} run: go test --cluster-name ${{env.CLUSTER_NAME}} -v + - name: Run Security Test + working-directory: test/e2e/security + env: + CLUSTER_NAME: ${{env.CLUSTER_NAME}} + run: | + go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + go test --destroy -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - name: Run Container Insights Test working-directory: test/e2e/container_insights env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} - run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + run: | + go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + go test --destroy -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v +# # # - name: Terraform apply # uses: nick-fields/retry@v2 From f428c86e0793e5bf711888ec0c26191735011387 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 4 Mar 2025 12:03:10 -0500 Subject: [PATCH 22/52] updated validation test --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index c13dee8f1b..ec07f59ca7 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -136,7 +136,7 @@ jobs: working-directory: test/e2e/rosa env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} - run: go test --cluster-name ${{env.CLUSTER_NAME}} -v + run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - name: Run Security Test working-directory: test/e2e/security From c645d94a8d692d1b2e3673813f9187804b8fd0da Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 4 Mar 2025 12:51:27 -0500 Subject: [PATCH 23/52] added matrix system --- .github/workflows/e2e-rosa-test.yml | 102 +++++++++++++++++++---- .github/workflows/e2e-test.yml | 60 +++++++------- .github/workflows/e2e/rosa-test.yml | 124 ---------------------------- 3 files changed, 117 insertions(+), 169 deletions(-) delete mode 100644 .github/workflows/e2e/rosa-test.yml diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index ec07f59ca7..8f2d98e78a 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -68,13 +68,25 @@ on: type: string jobs: - RosaTest: - name: 'RosaTest' + CreateCluster: + name: "Create ROSA HCP Cluster" + runs-on: ubuntu-latest + strategy: + fail-fast: false +# outputs: +# cluster_id: ${{}} + permissions: + id-token: write + contents: read + steps: + - name: Terraform Apply + run: echo "Terraform run" + ValidateCluster: + needs: [CreateCluster] + name: "Validate Cluster" runs-on: ubuntu-latest strategy: fail-fast: false -# matrix: -# arrays: ${{ fromJson(inputs.test_props) }} permissions: id-token: write contents: read @@ -83,17 +95,14 @@ jobs: with: repository: ${{inputs.test_repo_name}} ref: ${{inputs.test_repo_branch}} - - uses: actions/checkout@v3 - with: - repository: "aws-observability/helm-charts" - ref: ${{inputs.helm_charts_branch}} - path: "terraform/eks/e2e/helm-charts"# have to fix this later + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: ${{ inputs.terraform_assume_role}} aws-region: ${{ inputs.region }} role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + - name: Login ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 @@ -138,15 +147,74 @@ jobs: CLUSTER_NAME: ${{env.CLUSTER_NAME}} run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - - name: Run Security Test - working-directory: test/e2e/security - env: - CLUSTER_NAME: ${{env.CLUSTER_NAME}} + + RosaTest: + needs: [ValidateCluster] + name: 'RosaTest' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arrays: ${{ fromJson(inputs.test_props) }} + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + - uses: actions/checkout@v3 + with: + repository: "aws-observability/helm-charts" + ref: ${{inputs.helm_charts_branch}} + path: "terraform/eks/e2e/helm-charts"# have to fix this later + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role}} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + - name: Login ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Verify Terraform version + run: terraform --version + + - name: Install OpenShift CLI + uses: redhat-actions/oc-installer@v1 + + - name: Install ROSA CLI + shell: bash run: | - go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - go test --destroy -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - - name: Run Container Insights Test - working-directory: test/e2e/container_insights + curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz" + tar -xvf rosa-linux.tar.gz + sudo mv rosa /usr/local/bin/rosa + chmod +x /usr/local/bin/rosa + rm -f rosa-linux.tar.gz + rosa version + + - name: Get Secrets + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + parse-json-secrets: true + secret-ids: | + ,${{env.CLUSTER_NAME}}-htpasswd + + - name: Login to OpenShift + uses: redhat-actions/oc-login@v1 + with: + # URL to your OpenShift cluster. + openshift_server_url: ${{ env.OPENSHIFT_SERVER }} + openshift_username: ${{ env.OPENSHIFT_USERNAME }} + openshift_password: ${{ env.OPENSHIFT_PASSWORD }} + + - name: ${{matrix.arrays.testName}} + working-directory: ${{matrix.arrays.test_dir}} env: CLUSTER_NAME: ${{env.CLUSTER_NAME}} run: | diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 374e8035b9..051f290124 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -128,14 +128,14 @@ jobs: echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" RosaBaseTest: - needs: [ OutputEnvVariables ] + needs: [ OutputEnvVariables,GenerateTestMatrix ] name: 'Rosa Base Test' uses: ./.github/workflows/e2e-rosa-test.yml secrets: inherit with: terraform_dir: terraform/rosa/e2e job_id: rosa-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_props: ${{ needs.GenerateTestMatrix.outputs.rosa_e2e_matrix}} test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} @@ -148,33 +148,37 @@ jobs: terraform_assume_role: ${{vars.TERRAFORM_AWS_ASSUME_ROLE}} agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml -# GenerateTestMatrix: + GenerateTestMatrix: # needs: [BuildAgent, BuildOperator] -# name: 'GenerateTestMatrix' -# runs-on: ubuntu-latest -# outputs: -# eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }} -# steps: -# - uses: actions/checkout@v3 -# with: -# repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} -# ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} -# -# - name: Set up Go 1.x -# uses: actions/setup-go@v4 -# with: -# go-version: ~1.22.2 -# -# - name: Generate matrix -# id: set-matrix -# run: | -# go run generator/test_case_generator.go -e2e -# echo "::set-output name=eks_e2e_jmx_matrix::$(echo $(cat generator/resources/eks_e2e_jmx_complete_test_matrix.json))" -# -# - name: Echo test plan matrix -# run: | -# echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" -# + name: 'GenerateTestMatrix' + runs-on: ubuntu-latest + outputs: + eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }} + rosa_e2e_matrix: ${{steps.set-matrix.outputs.rosa_e2e_matrix}} + steps: + - uses: actions/checkout@v3 + with: + repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} + ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} + + - name: Set up Go 1.x + uses: actions/setup-go@v4 + with: + go-version: ~1.22.2 + + - name: Generate matrix + id: set-matrix + run: | + go run generator/test_case_generator.go -e2e + echo "::set-output name=eks_e2e_jmx_matrix::$(echo $(cat generator/resources/eks_e2e_jmx_complete_test_matrix.json))" + echo "::set-output name=rosa_e2e_matrix::$(echo $(cat generator/resources/rosa_e2e_cluster_complete_test_matrix.json))" + + - name: Echo test plan matrix + run: | + echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" + echo "rosa_e2e_matrix: ${{ steps.set-matrix.outputs.rosa_e2e_matrix }}" + + # EKSE2EJVMTomcatTest: # needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] # name: 'EKSE2EJVMTomcatTest' diff --git a/.github/workflows/e2e/rosa-test.yml b/.github/workflows/e2e/rosa-test.yml deleted file mode 100644 index 2a22c874ad..0000000000 --- a/.github/workflows/e2e/rosa-test.yml +++ /dev/null @@ -1,124 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: MIT -# -#name: Run ROSA E2E Tests -#env: -# TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} -# TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours -# ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" -# CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" -# CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" -# CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" -# TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} -# TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} -# OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" -# -#on: -## schedule: -## - cron: '0 17 * * 1' -# push: -# branches: -# - rosa -# -# workflow_dispatch: -# inputs: -# region: -# required: false -# type: string -# description: 'AWS Region to run tests in' -# default: 'us-west-2' -# operator-branch: -# required: false -# type: string -# description: 'Branch of the operator to test' -# default: 'main' -# helm-charts-branch: -# required: false -# type: string -# description: 'Branch of the helm charts to test' -# default: 'main' -# -#concurrency: -# group: ${{ github.workflow }}-${{ github.ref_name }}-parent -# cancel-in-progress: true -# -#jobs: -## GetLatestOperatorCommitSHA: -## runs-on: ubuntu-latest -## outputs: -## operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} -## operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} -## steps: -## - name: Checkout the target repo -## uses: actions/checkout@v3 -## with: -## repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} -## ref: ${{ inputs.operator-branch || 'main' }} -## path: operator-repo -## -## - name: Get latest commit SHA -## id: get_latest_sha -## run: | -## cd operator-repo -## latest_sha=$(git rev-parse HEAD) -## echo "::set-output name=operator_sha::$latest_sha" -# -## BuildAgent: -## uses: ./.github/workflows/build-test-artifacts.yml -## concurrency: -## group: "Build-Test-Artifacts-${{github.ref_name}}" -## cancel-in-progress: true -## secrets: inherit -## permissions: -## id-token: write -## contents: read -## with: -## test-image-before-upload: false -## -## BuildOperator: -## needs: [GetLatestOperatorCommitSHA] -## uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main -## concurrency: -## group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} -## cancel-in-progress: true -## secrets: inherit -## with: -## tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -## target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -## repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} -## test-image-before-upload: false -## -# OutputEnvVariables: -## needs: [ BuildAgent, BuildOperator ] -# name: 'OutputEnvVariables' -# runs-on: ubuntu-latest -# outputs: -# CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} -# CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} -# ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} -# ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} -# steps: -# -# - name: Set output variables -# id: set-outputs -# run: | -# { -# echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" -# echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" -# echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" -# echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" -# echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" -# echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" -# } >> "$GITHUB_OUTPUT" -# shell: bash -# - name: Echo test variables -# run: | -# echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" -# echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" -# echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" -# echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" -# echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" -# echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" -# From e7678ed46b66bd875d58867772dbaaa8a7ee4906 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 4 Mar 2025 13:30:46 -0500 Subject: [PATCH 24/52] testing test naming --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 8f2d98e78a..a6f3d782de 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -150,7 +150,7 @@ jobs: RosaTest: needs: [ValidateCluster] - name: 'RosaTest' + name: ${{matrix.arrays.testName}} runs-on: ubuntu-latest strategy: fail-fast: false From 4d4ecc630cec60bf69fe72ace2bae4421107f91e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 11:57:29 -0500 Subject: [PATCH 25/52] added terraform logic --- .github/workflows/e2e-rosa-test.yml | 89 +++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index a6f3d782de..a6a567228c 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -5,7 +5,6 @@ name: Reusable ROSA E2E Test env: TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours - CLUSTER_NAME: ${{vars.ROSA_CLUSTER_NAME}} on: workflow_call: @@ -71,16 +70,51 @@ jobs: CreateCluster: name: "Create ROSA HCP Cluster" runs-on: ubuntu-latest + outputs: + cluster_id: ${{ steps.terraform.outputs.cluster_id }} + cluster_name: ${{ steps.terraform.outputs.cluster_name }} strategy: fail-fast: false -# outputs: -# cluster_id: ${{}} permissions: id-token: write contents: read steps: - - name: Terraform Apply - run: echo "Terraform run" + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role}} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + - name: Verify Terraform version + run: terraform --version + + - name: Terraform apply + id: terraform + uses: nick-fields/retry@v2 + env: + TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} + TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} + with: + max_attempts: 1 + timeout_minutes: 60 + retry_wait_seconds: 5 + command: | + cd terraform/rosa/e2e + + terraform init + if terraform apply --auto-approve; then + echo "cluster_id=$(terraform output -raw cluster_id)" >> $GITHUB_OUTPUT + echo "cluster_name=$(terraform output -raw cluster_name)" >> $GITHUB_OUTPUT + else + terraform destroy --auto-approve && exit 1 + fi + ValidateCluster: needs: [CreateCluster] name: "Validate Cluster" @@ -107,12 +141,6 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v2 - - name: Install Terraform - uses: hashicorp/setup-terraform@v3 - - - name: Verify Terraform version - run: terraform --version - - name: Install OpenShift CLI uses: redhat-actions/oc-installer@v1 @@ -144,15 +172,14 @@ jobs: - name: Validate Cluster and Host ROSA Setup working-directory: test/e2e/rosa env: - CLUSTER_NAME: ${{env.CLUSTER_NAME}} + CLUSTER_NAME: ${{needs.CreateCluster.outputs.cluster_name}} run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - - RosaTest: - needs: [ValidateCluster] + needs: [CreateCluster,ValidateCluster] name: ${{matrix.arrays.testName}} runs-on: ubuntu-latest strategy: + max-parallel: 1 fail-fast: false matrix: arrays: ${{ fromJson(inputs.test_props) }} @@ -216,12 +243,40 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} env: - CLUSTER_NAME: ${{env.CLUSTER_NAME}} + CLUSTER_NAME: ${{needs.CreateCluster.outputs.cluster_name}} run: | go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v go test --destroy -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v -# + + DestroyCluster: + name: "Destroy ROSA HCP Cluster" + needs: [CreateCluster, ValidateCluster, RosaTest] + runs-on: ubuntu-latest + strategy: + fail-fast: false + permissions: + id-token: write + contents: read + steps: + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + - name: Verify Terraform version + run: terraform --version + + - name: Terraform apply + id: terraform + uses: nick-fields/retry@v2 + env: + TF_VAR_rhcs_token=${{secrets.RHCS_ACCOUNT_TOKEN}} + TF_VAR_billing_account_id=${{secrets.ROSA_BILLING_ACCOUNT}} + with: + max_attempts: 1 + timeout_minutes: 60 + retry_wait_seconds: 5 + command: | + cd terraform/rosa/e2e + terraform destroy --auto-approve && exit 1 # # - name: Terraform apply # uses: nick-fields/retry@v2 From f1cbb11befcf73f1da754ddbecd070530374d927 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 12:49:37 -0500 Subject: [PATCH 26/52] removed hardcoded region --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 051f290124..9eeadb4bb4 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -143,7 +143,7 @@ jobs: cloudwatch_agent_tag: ${{ github.sha }} cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-east-1' }} + region: ${{ inputs.region}} helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} terraform_assume_role: ${{vars.TERRAFORM_AWS_ASSUME_ROLE}} agent_config: resources/cwagent_configs/jvm_tomcat.json From 63fc6a6dba6586b7d75eb8ada0aeac87d06cd3f8 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 13:13:39 -0500 Subject: [PATCH 27/52] added new region support --- .github/workflows/e2e-rosa-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index a6a567228c..36c1018c07 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -100,6 +100,7 @@ jobs: env: TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} + TF_VAR_aws_region: ${{inputs.region}} with: max_attempts: 1 timeout_minutes: 60 From 125debc76d1d596d8961067b1f01318bf30fa265 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 14:45:43 -0500 Subject: [PATCH 28/52] changed cluster naming --- .github/workflows/e2e-rosa-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 36c1018c07..7e2ec95aa9 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -101,6 +101,7 @@ jobs: TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} TF_VAR_aws_region: ${{inputs.region}} + TF_VAR_cluster_name: rosa-cluster-${{github.run_attempt}} with: max_attempts: 1 timeout_minutes: 60 From 0adb0bff8e92652399823812bcd48d105d42952e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 15:52:49 -0500 Subject: [PATCH 29/52] changed from run_attempt to runid --- .github/workflows/e2e-rosa-test.yml | 2 +- .github/workflows/e2e-test.yml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 7e2ec95aa9..c265b75aa7 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -101,7 +101,7 @@ jobs: TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} TF_VAR_aws_region: ${{inputs.region}} - TF_VAR_cluster_name: rosa-cluster-${{github.run_attempt}} + TF_VAR_cluster_name: rosa-cluster-${{github.run_id}} with: max_attempts: 1 timeout_minutes: 60 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 9eeadb4bb4..bfebbf506d 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -16,16 +16,14 @@ env: on: schedule: - cron: '0 17 * * 1' - push: - branches: - - rosa + workflow_dispatch: inputs: region: required: false type: string description: 'AWS Region to run tests in' - default: 'us-east-1' + default: 'us-west-2' operator-branch: required: false type: string @@ -35,7 +33,7 @@ on: required: false type: string description: 'Branch of the helm charts to test' - default: 'main' + default: 'rosa' concurrency: group: ${{ github.workflow }}-${{ github.ref_name }}-parent From 5e044f2e5c2698023b60c52c9dbd9dce0f7a35db Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 15:53:35 -0500 Subject: [PATCH 30/52] updated timeout minutes to 80 --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index c265b75aa7..c43f9aee73 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -104,7 +104,7 @@ jobs: TF_VAR_cluster_name: rosa-cluster-${{github.run_id}} with: max_attempts: 1 - timeout_minutes: 60 + timeout_minutes: 80 retry_wait_seconds: 5 command: | cd terraform/rosa/e2e From c139cc28d7b72460e5be9f347877814211000239 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 5 Mar 2025 16:22:14 -0500 Subject: [PATCH 31/52] fixed get secret --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index c43f9aee73..3136b23bb0 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -161,7 +161,7 @@ jobs: with: parse-json-secrets: true secret-ids: | - ,${{env.CLUSTER_NAME}}-htpasswd + ,${{needs.CreateCluster.outputs.cluster_name}}-htpasswd - name: Login to OpenShift uses: redhat-actions/oc-login@v1 From 5e4d78c1a6230d92336f225b8773c70caec94d77 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Thu, 6 Mar 2025 16:50:40 -0500 Subject: [PATCH 32/52] fixed the naming --- .github/workflows/e2e-rosa-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 3136b23bb0..393af6988c 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -101,7 +101,7 @@ jobs: TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} TF_VAR_aws_region: ${{inputs.region}} - TF_VAR_cluster_name: rosa-cluster-${{github.run_id}} + TF_VAR_cluster_name: cwa-rosa-test-${{github.run_id}}-${{github.run_attempt}} with: max_attempts: 1 timeout_minutes: 80 From 330ceffa08398845ec0e60acb4b5fb8846567e79 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 7 Mar 2025 11:13:25 -0500 Subject: [PATCH 33/52] removed env.ClusterName --- .github/workflows/e2e-rosa-test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 393af6988c..7fec5aed14 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -175,7 +175,7 @@ jobs: working-directory: test/e2e/rosa env: CLUSTER_NAME: ${{needs.CreateCluster.outputs.cluster_name}} - run: go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + run: go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v RosaTest: needs: [CreateCluster,ValidateCluster] name: ${{matrix.arrays.testName}} @@ -232,7 +232,7 @@ jobs: with: parse-json-secrets: true secret-ids: | - ,${{env.CLUSTER_NAME}}-htpasswd + ,${{needs.CreateCluster.outputs.cluster_name}}-htpasswd - name: Login to OpenShift uses: redhat-actions/oc-login@v1 @@ -244,15 +244,14 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} - env: - CLUSTER_NAME: ${{needs.CreateCluster.outputs.cluster_name}} run: | - go test -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - go test --destroy -computeType=ROSA -eksClusterName=${{env.CLUSTER_NAME}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + go test --destroy -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v DestroyCluster: name: "Destroy ROSA HCP Cluster" + if: ${{ always() && needs.CreateCluster.result== 'success' }} needs: [CreateCluster, ValidateCluster, RosaTest] runs-on: ubuntu-latest strategy: From 63e91e2b368ff6d9253766a059e84911884b0e8a Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Fri, 7 Mar 2025 13:00:07 -0500 Subject: [PATCH 34/52] fixed terraform destroy --- .github/workflows/e2e-rosa-test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 7fec5aed14..3e1bd02e38 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -265,15 +265,17 @@ jobs: - name: Verify Terraform version run: terraform --version - - name: Terraform apply + - name: Terraform destroy id: terraform uses: nick-fields/retry@v2 env: - TF_VAR_rhcs_token=${{secrets.RHCS_ACCOUNT_TOKEN}} - TF_VAR_billing_account_id=${{secrets.ROSA_BILLING_ACCOUNT}} + TF_VAR_rhcs_token: ${{secrets.RHCS_ACCOUNT_TOKEN}} + TF_VAR_billing_account_id: ${{secrets.ROSA_BILLING_ACCOUNT}} + TF_VAR_aws_region: ${{inputs.region}} + TF_VAR_cluster_name: ${{needs.CreateCluster.outputs.cluster_name}} with: max_attempts: 1 - timeout_minutes: 60 + timeout_minutes: 80 retry_wait_seconds: 5 command: | cd terraform/rosa/e2e From 3ca4139ea95bd64353e070eab871bcad3f8c226d Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 11:13:13 -0400 Subject: [PATCH 35/52] fix cluster cleanup --- .github/workflows/e2e-rosa-test.yml | 64 ++++------------------------- 1 file changed, 8 insertions(+), 56 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 3e1bd02e38..995f2f7f45 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -244,9 +244,15 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} + continue-on-error: true run: | go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - go test --destroy -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + + - name: Cleanup + working-directory: ${{matrix.arrays.test_dir}} + if: always() + run: go test --destroy -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + DestroyCluster: @@ -280,58 +286,4 @@ jobs: command: | cd terraform/rosa/e2e terraform destroy --auto-approve && exit 1 -# -# - name: Terraform apply -# uses: nick-fields/retry@v2 -# env: -# -# with: -# max_attempts: 3 -# timeout_minutes: 60 -# retry_wait_seconds: 5 -# command: | -# if [ "${{ inputs.terraform_dir }}" != "" ]; then -# cd "${{ inputs.terraform_dir }}" -# else -# cd terraform/eks/e2e -# fi -# -# terraform init -# if terraform apply --auto-approve \ -# -var="region=${{ inputs.region }}" \ -# -var="k8s_version=${{ matrix.arrays.k8s_version }}" \ -# -var="nodes=${{ matrix.arrays.nodes }}" \ -# -var="helm_charts_branch=${{ inputs.helm_charts_branch }}" \ -# -var="cloudwatch_agent_repository_url=${{ steps.login-ecr.outputs.registry }}" \ -# -var="cloudwatch_agent_repository=${{ inputs.cloudwatch_agent_repository }}" \ -# -var="cloudwatch_agent_tag=${{ inputs.cloudwatch_agent_tag }}" \ -# -var="cloudwatch_agent_operator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ -# -var="cloudwatch_agent_operator_repository=${{ inputs.cloudwatch_agent_operator_repository }}" \ -# -var="cloudwatch_agent_operator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ -# -var="cloudwatch_agent_target_allocator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ -# -var="cloudwatch_agent_target_allocator_repository=${{ inputs.cloudwatch_agent_target_allocator_repository }}" \ -# -var="cloudwatch_agent_target_allocator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ -# -var="test_dir=${{ matrix.arrays.test_dir }}" \ -# -var="agent_config=${{ inputs.agent_config }}" \ -# -var="prometheus_config=${{ inputs.prometheus_config }}" \ -# -var="otel_config=${{ inputs.otel_config }}" \ -# -var="sample_app=${{ inputs.sample_app }}"; then -# terraform destroy --auto-approve -# else -# terraform destroy --auto-approve && exit 1 -# fi -# -# - name: Terraform destroy -# if: ${{ cancelled() || failure() }} -# uses: nick-fields/retry@v2 -# with: -# max_attempts: 3 -# timeout_minutes: 8 -# retry_wait_seconds: 5 -# command: | -# if [ "${{ inputs.terraform_dir }}" != "" ]; then -# cd "${{ inputs.terraform_dir }}" -# else -# cd terraform/eks/e2e -# fi -# terraform destroy --auto-approve + From 4b14c5d5bbbee02e22df2b0e79fd7e3916aea5cb Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 14:15:53 -0400 Subject: [PATCH 36/52] added terraform state --- .github/workflows/e2e-rosa-test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 995f2f7f45..3b5ce6e927 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -113,6 +113,7 @@ jobs: if terraform apply --auto-approve; then echo "cluster_id=$(terraform output -raw cluster_id)" >> $GITHUB_OUTPUT echo "cluster_name=$(terraform output -raw cluster_name)" >> $GITHUB_OUTPUT + aws s3 cp terraform.tfstate s3://${{inputs.s3_integration_bucket}}/integration-test/local-stack-terraform-state/${{inputs.github_sha}}/terraform.tfstate else terraform destroy --auto-approve && exit 1 fi @@ -266,6 +267,14 @@ jobs: id-token: write contents: read steps: + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + + - name: Copy state + run: aws s3 cp s3://${{inputs.s3_integration_bucket}}/integration-test/local-stack-terraform-state/${{inputs.github_sha}}/terraform.tfstate . + - name: Install Terraform uses: hashicorp/setup-terraform@v3 - name: Verify Terraform version From 9aff71c7d3d3c6a0f9b166ad4ac58a9c7ec86995 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 14:25:31 -0400 Subject: [PATCH 37/52] removed continue when failed --- .github/workflows/e2e-rosa-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 3b5ce6e927..3f6a2c1e59 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -245,7 +245,6 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} - continue-on-error: true run: | go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v From 83503b5740eda78e726eb1066761b631f3f94131 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 16:14:33 -0400 Subject: [PATCH 38/52] added sample app --- .github/workflows/e2e-rosa-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 3f6a2c1e59..ffd2fa7359 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -246,7 +246,11 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} run: | - go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + go test -computeType=ROSA \ + -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ + -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} \ + -sample_app=${{matrix.arrays.sample_app_path}} \ + -v - name: Cleanup working-directory: ${{matrix.arrays.test_dir}} From bad14b2587ebd40d8bc4f10287816c0e0b23012e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 16:44:29 -0400 Subject: [PATCH 39/52] Added patching --- .github/workflows/e2e-rosa-test.yml | 69 ++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index ffd2fa7359..0e3da25377 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -177,8 +177,59 @@ jobs: env: CLUSTER_NAME: ${{needs.CreateCluster.outputs.cluster_name}} run: go test -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v - RosaTest: + PatchCluster: needs: [CreateCluster,ValidateCluster] + name: "Patch ROSA Cluster" + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + - name: Login ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Install OpenShift CLI + uses: redhat-actions/oc-installer@v1 + + - name: Install ROSA CLI + shell: bash + run: | + curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz" + tar -xvf rosa-linux.tar.gz + sudo mv rosa /usr/local/bin/rosa + chmod +x /usr/local/bin/rosa + rm -f rosa-linux.tar.gz + rosa version + + - name: Get Secrets + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + parse-json-secrets: true + secret-ids: | + ,${{needs.CreateCluster.outputs.cluster_name}}-htpasswd + + - name: Login to OpenShift + uses: redhat-actions/oc-login@v1 + with: + # URL to your OpenShift cluster. + openshift_server_url: ${{ env.OPENSHIFT_SERVER }} + openshift_username: ${{ env.OPENSHIFT_USERNAME }} + openshift_password: ${{ env.OPENSHIFT_PASSWORD }} + + - name: Install SSM Agent + working-directory: "terraform/rosa/patching" + run : | + oc apply -f ./patch.yaml + + + + RosaTest: + needs: [CreateCluster,ValidateCluster,PatchCluster] name: ${{matrix.arrays.testName}} runs-on: ubuntu-latest strategy: @@ -246,16 +297,20 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} run: | - go test -computeType=ROSA \ - -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ - -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} \ - -sample_app=${{matrix.arrays.sample_app_path}} \ - -v + go test --computeType=ROSA \ + --eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ + --eksDeploymentStrategy="DAEMON" --region=${{env.AWS_REGION}} \ + --sample_app=${{matrix.arrays.sample_app_path}} \ + --v - name: Cleanup working-directory: ${{matrix.arrays.test_dir}} if: always() - run: go test --destroy -computeType=ROSA -eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} -eksDeploymentStrategy="DAEMON" -region=${{env.AWS_REGION}} -v + run: go test --destroy \ + --eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ + --eksDeploymentStrategy="DAEMON" --region=${{env.AWS_REGION}} \ + --sample_app=${{matrix.arrays.sample_app_path}} \ + -v From 46820a01e0e7f64ad9f00ddafe86e3e0aee18f99 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Mon, 10 Mar 2025 16:49:37 -0400 Subject: [PATCH 40/52] added integ bucket --- .github/workflows/e2e-rosa-test.yml | 39 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 0e3da25377..c014ce2120 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -65,6 +65,9 @@ on: sample_app: required: true type: string + s3_integration_bucket: + default: ${{vars.S3_INTEGRATION_BUCKET}} + type: string jobs: CreateCluster: @@ -189,9 +192,13 @@ jobs: with: repository: ${{inputs.test_repo_name}} ref: ${{inputs.test_repo_branch}} - - name: Login ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role}} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} - name: Install OpenShift CLI uses: redhat-actions/oc-installer@v1 @@ -222,11 +229,9 @@ jobs: openshift_password: ${{ env.OPENSHIFT_PASSWORD }} - name: Install SSM Agent - working-directory: "terraform/rosa/patching" + working-directory: terraform/rosa/patching run : | oc apply -f ./patch.yaml - - RosaTest: needs: [CreateCluster,ValidateCluster,PatchCluster] @@ -245,20 +250,19 @@ jobs: with: repository: ${{inputs.test_repo_name}} ref: ${{inputs.test_repo_branch}} + - uses: actions/checkout@v3 with: repository: "aws-observability/helm-charts" ref: ${{inputs.helm_charts_branch}} path: "terraform/eks/e2e/helm-charts"# have to fix this later + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: ${{ inputs.terraform_assume_role}} aws-region: ${{ inputs.region }} role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} - - name: Login ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - name: Install Terraform uses: hashicorp/setup-terraform@v3 @@ -297,9 +301,10 @@ jobs: - name: ${{matrix.arrays.testName}} working-directory: ${{matrix.arrays.test_dir}} run: | - go test --computeType=ROSA \ + go test --computeType=ROSA \ --eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ - --eksDeploymentStrategy="DAEMON" --region=${{env.AWS_REGION}} \ + --eksDeploymentStrategy="DAEMON" \ + --region=${{env.AWS_REGION}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ --v @@ -311,9 +316,6 @@ jobs: --eksDeploymentStrategy="DAEMON" --region=${{env.AWS_REGION}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ -v - - - DestroyCluster: name: "Destroy ROSA HCP Cluster" if: ${{ always() && needs.CreateCluster.result== 'success' }} @@ -330,7 +332,15 @@ jobs: repository: ${{inputs.test_repo_name}} ref: ${{inputs.test_repo_branch}} + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role}} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + - name: Copy state + working-directory: terraform/rosa/e2e run: aws s3 cp s3://${{inputs.s3_integration_bucket}}/integration-test/local-stack-terraform-state/${{inputs.github_sha}}/terraform.tfstate . - name: Install Terraform @@ -352,5 +362,6 @@ jobs: retry_wait_seconds: 5 command: | cd terraform/rosa/e2e + terraform init terraform destroy --auto-approve && exit 1 From 70817310a584724fe5a6989235db1028cb8f53d4 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 11 Mar 2025 08:24:31 -0400 Subject: [PATCH 41/52] fix delete error based on warning --- .github/workflows/e2e-rosa-test.yml | 11 ++- .github/workflows/e2e-test.yml | 115 ++++++++++++++++------------ 2 files changed, 74 insertions(+), 52 deletions(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index c014ce2120..8e0efbc580 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -311,11 +311,14 @@ jobs: - name: Cleanup working-directory: ${{matrix.arrays.test_dir}} if: always() - run: go test --destroy \ + run: | + go test --computeType=ROSA \ + --destroy \ --eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ - --eksDeploymentStrategy="DAEMON" --region=${{env.AWS_REGION}} \ + --eksDeploymentStrategy="DAEMON" \ + --region=${{env.AWS_REGION}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ - -v + --v DestroyCluster: name: "Destroy ROSA HCP Cluster" if: ${{ always() && needs.CreateCluster.result== 'success' }} @@ -363,5 +366,5 @@ jobs: command: | cd terraform/rosa/e2e terraform init - terraform destroy --auto-approve && exit 1 + terraform destroy --auto-approve || exit 0 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index bfebbf506d..4434f0fbe9 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,53 +40,53 @@ concurrency: cancel-in-progress: true jobs: -# GetLatestOperatorCommitSHA: -# runs-on: ubuntu-latest -# outputs: -# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} -# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} -# steps: -# - name: Checkout the target repo -# uses: actions/checkout@v3 -# with: -# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} -# ref: ${{ inputs.operator-branch || 'main' }} -# path: operator-repo -# -# - name: Get latest commit SHA -# id: get_latest_sha -# run: | -# cd operator-repo -# latest_sha=$(git rev-parse HEAD) -# echo "::set-output name=operator_sha::$latest_sha" -# -# BuildAgent: -# uses: ./.github/workflows/build-test-artifacts.yml -# concurrency: -# group: "Build-Test-Artifacts-${{github.ref_name}}" -# cancel-in-progress: true -# secrets: inherit -# permissions: -# id-token: write -# contents: read -# with: -# test-image-before-upload: false -# -# BuildOperator: -# needs: [GetLatestOperatorCommitSHA] -# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main -# concurrency: -# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} -# cancel-in-progress: true -# secrets: inherit -# with: -# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} -# test-image-before-upload: false -# + GetLatestOperatorCommitSHA: + runs-on: ubuntu-latest + outputs: + operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} + operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} + steps: + - name: Checkout the target repo + uses: actions/checkout@v3 + with: + repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} + ref: ${{ inputs.operator-branch || 'main' }} + path: operator-repo + + - name: Get latest commit SHA + id: get_latest_sha + run: | + cd operator-repo + latest_sha=$(git rev-parse HEAD) + echo "::set-output name=operator_sha::$latest_sha" + + BuildAgent: + uses: ./.github/workflows/build-test-artifacts.yml + concurrency: + group: "Build-Test-Artifacts-${{github.ref_name}}" + cancel-in-progress: true + secrets: inherit + permissions: + id-token: write + contents: read + with: + test-image-before-upload: false + + BuildOperator: + needs: [GetLatestOperatorCommitSHA] + uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main + concurrency: + group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} + cancel-in-progress: true + secrets: inherit + with: + tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} + test-image-before-upload: false + OutputEnvVariables: -# needs: [ BuildAgent, BuildOperator ] + needs: [ BuildAgent, BuildOperator ] name: 'OutputEnvVariables' runs-on: ubuntu-latest outputs: @@ -147,7 +147,7 @@ jobs: agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml GenerateTestMatrix: -# needs: [BuildAgent, BuildOperator] + needs: [BuildAgent, BuildOperator] name: 'GenerateTestMatrix' runs-on: ubuntu-latest outputs: @@ -176,7 +176,26 @@ jobs: echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" echo "rosa_e2e_matrix: ${{ steps.set-matrix.outputs.rosa_e2e_matrix }}" - + EKSE2EContainerInsightsTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKS E2E ContainerInsights Test' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + test_dir: test/e2e/container_insights + job_id: eks-e2e-ci-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + secrets: inherit # EKSE2EJVMTomcatTest: # needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] # name: 'EKSE2EJVMTomcatTest' From 35efcaebc2380ef01ba634267334a4e4e483af94 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 11 Mar 2025 11:44:54 -0400 Subject: [PATCH 42/52] removed eks ci test for now --- .github/workflows/e2e-test.yml | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4434f0fbe9..6ee7ba4314 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -176,26 +176,26 @@ jobs: echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" echo "rosa_e2e_matrix: ${{ steps.set-matrix.outputs.rosa_e2e_matrix }}" - EKSE2EContainerInsightsTest: - needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] - name: 'EKS E2E ContainerInsights Test' - uses: ./.github/workflows/eks-e2e-test.yml - with: - terraform_dir: terraform/eks/e2e - test_dir: test/e2e/container_insights - job_id: eks-e2e-ci-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} - secrets: inherit +# EKSE2EContainerInsightsTest: +# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] +# name: 'EKS E2E ContainerInsights Test' +# uses: ./.github/workflows/eks-e2e-test.yml +# with: +# terraform_dir: terraform/eks/e2e +# test_dir: test/e2e/container_insights +# job_id: eks-e2e-ci-test +# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} +# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} +# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} +# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} +# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} +# cloudwatch_agent_tag: ${{ github.sha }} +# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} +# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} +# region: ${{ inputs.region || 'us-west-2' }} +# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} +# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} +# secrets: inherit # EKSE2EJVMTomcatTest: # needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] # name: 'EKSE2EJVMTomcatTest' From 5991828efd09f9089dd866a5df492f62f7d148bc Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 11 Mar 2025 13:31:32 -0400 Subject: [PATCH 43/52] remove unecessary test for now --- .github/workflows/e2e-test.yml | 92 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 6ee7ba4314..3c022d6aad 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,53 +40,53 @@ concurrency: cancel-in-progress: true jobs: - GetLatestOperatorCommitSHA: - runs-on: ubuntu-latest - outputs: - operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} - operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} - steps: - - name: Checkout the target repo - uses: actions/checkout@v3 - with: - repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} - ref: ${{ inputs.operator-branch || 'main' }} - path: operator-repo - - - name: Get latest commit SHA - id: get_latest_sha - run: | - cd operator-repo - latest_sha=$(git rev-parse HEAD) - echo "::set-output name=operator_sha::$latest_sha" - - BuildAgent: - uses: ./.github/workflows/build-test-artifacts.yml - concurrency: - group: "Build-Test-Artifacts-${{github.ref_name}}" - cancel-in-progress: true - secrets: inherit - permissions: - id-token: write - contents: read - with: - test-image-before-upload: false - - BuildOperator: - needs: [GetLatestOperatorCommitSHA] - uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main - concurrency: - group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} - cancel-in-progress: true - secrets: inherit - with: - tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} - test-image-before-upload: false +# GetLatestOperatorCommitSHA: +# runs-on: ubuntu-latest +# outputs: +# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} +# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# steps: +# - name: Checkout the target repo +# uses: actions/checkout@v3 +# with: +# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} +# ref: ${{ inputs.operator-branch || 'main' }} +# path: operator-repo +# +# - name: Get latest commit SHA +# id: get_latest_sha +# run: | +# cd operator-repo +# latest_sha=$(git rev-parse HEAD) +# echo "::set-output name=operator_sha::$latest_sha" +# +# BuildAgent: +# uses: ./.github/workflows/build-test-artifacts.yml +# concurrency: +# group: "Build-Test-Artifacts-${{github.ref_name}}" +# cancel-in-progress: true +# secrets: inherit +# permissions: +# id-token: write +# contents: read +# with: +# test-image-before-upload: false +# +# BuildOperator: +# needs: [GetLatestOperatorCommitSHA] +# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main +# concurrency: +# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} +# cancel-in-progress: true +# secrets: inherit +# with: +# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} +# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} +# test-image-before-upload: false OutputEnvVariables: - needs: [ BuildAgent, BuildOperator ] +# needs: [ BuildAgent, BuildOperator ] name: 'OutputEnvVariables' runs-on: ubuntu-latest outputs: @@ -147,7 +147,7 @@ jobs: agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml GenerateTestMatrix: - needs: [BuildAgent, BuildOperator] +# needs: [BuildAgent, BuildOperator] name: 'GenerateTestMatrix' runs-on: ubuntu-latest outputs: From ced3efefd24c9de0e1a18a94d1d5798773dd60e3 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Wed, 12 Mar 2025 09:06:06 -0400 Subject: [PATCH 44/52] added 30min timeout --- .github/workflows/e2e-rosa-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 8e0efbc580..4ee084941d 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -306,6 +306,7 @@ jobs: --eksDeploymentStrategy="DAEMON" \ --region=${{env.AWS_REGION}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ + --timeout 30m \ --v - name: Cleanup @@ -318,6 +319,7 @@ jobs: --eksDeploymentStrategy="DAEMON" \ --region=${{env.AWS_REGION}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ + --timeout 30m \ --v DestroyCluster: name: "Destroy ROSA HCP Cluster" From cd834dffc6f304ddc63a32668465b4a5298bd92d Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 12:19:41 -0400 Subject: [PATCH 45/52] added the rest of e2e tests back --- .github/workflows/e2e-test.yml | 262 ++++++++++++++++----------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 3c022d6aad..47e0e9b852 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,50 +40,50 @@ concurrency: cancel-in-progress: true jobs: -# GetLatestOperatorCommitSHA: -# runs-on: ubuntu-latest -# outputs: -# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} -# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} -# steps: -# - name: Checkout the target repo -# uses: actions/checkout@v3 -# with: -# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} -# ref: ${{ inputs.operator-branch || 'main' }} -# path: operator-repo -# -# - name: Get latest commit SHA -# id: get_latest_sha -# run: | -# cd operator-repo -# latest_sha=$(git rev-parse HEAD) -# echo "::set-output name=operator_sha::$latest_sha" -# -# BuildAgent: -# uses: ./.github/workflows/build-test-artifacts.yml -# concurrency: -# group: "Build-Test-Artifacts-${{github.ref_name}}" -# cancel-in-progress: true -# secrets: inherit -# permissions: -# id-token: write -# contents: read -# with: -# test-image-before-upload: false -# -# BuildOperator: -# needs: [GetLatestOperatorCommitSHA] -# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main -# concurrency: -# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} -# cancel-in-progress: true -# secrets: inherit -# with: -# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} -# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} -# test-image-before-upload: false + GetLatestOperatorCommitSHA: + runs-on: ubuntu-latest + outputs: + operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} + operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} + steps: + - name: Checkout the target repo + uses: actions/checkout@v3 + with: + repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} + ref: ${{ inputs.operator-branch || 'main' }} + path: operator-repo + + - name: Get latest commit SHA + id: get_latest_sha + run: | + cd operator-repo + latest_sha=$(git rev-parse HEAD) + echo "::set-output name=operator_sha::$latest_sha" + + BuildAgent: + uses: ./.github/workflows/build-test-artifacts.yml + concurrency: + group: "Build-Test-Artifacts-${{github.ref_name}}" + cancel-in-progress: true + secrets: inherit + permissions: + id-token: write + contents: read + with: + test-image-before-upload: false + + BuildOperator: + needs: [GetLatestOperatorCommitSHA] + uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main + concurrency: + group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} + cancel-in-progress: true + secrets: inherit + with: + tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} + test-image-before-upload: false OutputEnvVariables: # needs: [ BuildAgent, BuildOperator ] @@ -126,7 +126,7 @@ jobs: echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" RosaBaseTest: - needs: [ OutputEnvVariables,GenerateTestMatrix ] + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] name: 'Rosa Base Test' uses: ./.github/workflows/e2e-rosa-test.yml secrets: inherit @@ -147,7 +147,7 @@ jobs: agent_config: resources/cwagent_configs/jvm_tomcat.json sample_app: resources/sample_apps/tomcat.yaml GenerateTestMatrix: -# needs: [BuildAgent, BuildOperator] + needs: [BuildAgent, BuildOperator] name: 'GenerateTestMatrix' runs-on: ubuntu-latest outputs: @@ -176,88 +176,88 @@ jobs: echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" echo "rosa_e2e_matrix: ${{ steps.set-matrix.outputs.rosa_e2e_matrix }}" -# EKSE2EContainerInsightsTest: -# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] -# name: 'EKS E2E ContainerInsights Test' -# uses: ./.github/workflows/eks-e2e-test.yml -# with: -# terraform_dir: terraform/eks/e2e -# test_dir: test/e2e/container_insights -# job_id: eks-e2e-ci-test -# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} -# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} -# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} -# cloudwatch_agent_tag: ${{ github.sha }} -# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} -# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} -# region: ${{ inputs.region || 'us-west-2' }} -# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} -# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} -# secrets: inherit -# EKSE2EJVMTomcatTest: -# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] -# name: 'EKSE2EJVMTomcatTest' -# uses: ./.github/workflows/eks-e2e-test.yml -# with: -# terraform_dir: terraform/eks/e2e -# job_id: eks-e2e-jvm-tomcat-test -# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} -# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} -# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} -# cloudwatch_agent_tag: ${{ github.sha }} -# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} -# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} -# region: ${{ inputs.region || 'us-west-2' }} -# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} -# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} -# agent_config: resources/cwagent_configs/jvm_tomcat.json -# sample_app: resources/sample_apps/tomcat.yaml -# secrets: inherit -# -# EKSE2EKafkaTest: -# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] -# name: 'EKSE2EKafkaTest' -# uses: ./.github/workflows/eks-e2e-test.yml -# with: -# terraform_dir: terraform/eks/e2e -# job_id: eks-e2e-kafka-test -# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} -# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} -# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} -# cloudwatch_agent_tag: ${{ github.sha }} -# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} -# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} -# region: ${{ inputs.region || 'us-west-2' }} -# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} -# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} -# agent_config: resources/cwagent_configs/kafka.json -# sample_app: resources/sample_apps/kafka.yaml -# secrets: inherit -# -# EKSE2EJMXContainerInsightsTest: -# needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] -# name: 'EKSE2EJMXContainerInsightsTest' -# uses: ./.github/workflows/eks-e2e-test.yml -# with: -# terraform_dir: terraform/eks/e2e -# job_id: eks-e2e-jmx-containerinsights-test -# test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} -# test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} -# test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} -# test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} -# cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} -# cloudwatch_agent_tag: ${{ github.sha }} -# cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} -# cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} -# region: ${{ inputs.region || 'us-west-2' }} -# helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} -# terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} -# agent_config: resources/cwagent_configs/containerinsights.json -# sample_app: resources/sample_apps/tomcat.yaml -# secrets: inherit + EKSE2EContainerInsightsTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKS E2E ContainerInsights Test' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + test_dir: test/e2e/container_insights + job_id: eks-e2e-ci-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + secrets: inherit + EKSE2EJVMTomcatTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EJVMTomcatTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-jvm-tomcat-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/jvm_tomcat.json + sample_app: resources/sample_apps/tomcat.yaml + secrets: inherit + + EKSE2EKafkaTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EKafkaTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-kafka-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/kafka.json + sample_app: resources/sample_apps/kafka.yaml + secrets: inherit + + EKSE2EJMXContainerInsightsTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EJMXContainerInsightsTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-jmx-containerinsights-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region || 'us-west-2' }} + helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/containerinsights.json + sample_app: resources/sample_apps/tomcat.yaml + secrets: inherit From 29ac6c82c0f4b0c52fdfaf552175f64d7cf0ccdc Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 12:44:28 -0400 Subject: [PATCH 46/52] added other tests --- .github/workflows/e2e-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 47e0e9b852..996d246fa3 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -193,8 +193,10 @@ jobs: cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} region: ${{ inputs.region || 'us-west-2' }} + agent_config: resources/cwagent_configs/jvm_tomcat.json helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + sample_app: resources/sample_apps/tomcat.yaml secrets: inherit EKSE2EJVMTomcatTest: needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] From 26d2685cd1c9d91113f221a4f10b2124966a6c9c Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 12:50:12 -0400 Subject: [PATCH 47/52] removed ci test for now --- .github/workflows/e2e-test.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 996d246fa3..b715de2688 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -175,29 +175,7 @@ jobs: run: | echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" echo "rosa_e2e_matrix: ${{ steps.set-matrix.outputs.rosa_e2e_matrix }}" - - EKSE2EContainerInsightsTest: - needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] - name: 'EKS E2E ContainerInsights Test' - uses: ./.github/workflows/eks-e2e-test.yml - with: - terraform_dir: terraform/eks/e2e - test_dir: test/e2e/container_insights - job_id: eks-e2e-ci-test - test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} - test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} - test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} - test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} - cloudwatch_agent_tag: ${{ github.sha }} - cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} - cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} - region: ${{ inputs.region || 'us-west-2' }} - agent_config: resources/cwagent_configs/jvm_tomcat.json - helm_charts_branch: ${{ inputs.helm-charts-branch || 'main' }} - terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} - sample_app: resources/sample_apps/tomcat.yaml - secrets: inherit + EKSE2EJVMTomcatTest: needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] name: 'EKSE2EJVMTomcatTest' From f76363650048ba976ede56c0918e1d8ea3d1435a Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 16:37:54 -0400 Subject: [PATCH 48/52] added agent health for rosa --- cfg/envconfig/envconfig.go | 5 +++++ cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go | 3 +++ extension/agenthealth/handler/useragent/useragent.go | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cfg/envconfig/envconfig.go b/cfg/envconfig/envconfig.go index afbf4918de..3d3c02a0de 100644 --- a/cfg/envconfig/envconfig.go +++ b/cfg/envconfig/envconfig.go @@ -25,6 +25,7 @@ const ( RunAsHostProcessContainer = "RUN_AS_HOST_PROCESS_CONTAINER" RunInAWS = "RUN_IN_AWS" RunWithIRSA = "RUN_WITH_IRSA" + RunWithROSA = "RUN_ON_ROSA" UseDefaultConfig = "USE_DEFAULT_CONFIG" HostName = "HOST_NAME" PodName = "POD_NAME" @@ -72,3 +73,7 @@ func IsWindowsHostProcessContainer() bool { } return false } + +func IsRunningOnROSA() bool { + return os.Getenv(RunWithROSA) == TrueValue +} diff --git a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go index da084dedcd..f62c3637f9 100644 --- a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go +++ b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go @@ -309,6 +309,9 @@ func runAgent(ctx context.Context, }() } } + if envconfig.IsRunningOnROSA() { + log.Println("I! Running on ROSA") + } if len(c.Inputs) != 0 && len(c.Outputs) != 0 { log.Println("creating new logs agent") diff --git a/extension/agenthealth/handler/useragent/useragent.go b/extension/agenthealth/handler/useragent/useragent.go index eb90e2b1aa..9476270bdb 100644 --- a/extension/agenthealth/handler/useragent/useragent.go +++ b/extension/agenthealth/handler/useragent/useragent.go @@ -31,7 +31,7 @@ const ( flagContainerInsights = "container_insights" flagAppSignals = "application_signals" flagEnhancedContainerInsights = "enhanced_container_insights" - + flagROSA = "rosa" separator = " " typeInputs = "inputs" @@ -77,7 +77,12 @@ func (ua *userAgent) SetComponents(otelCfg *otelcol.Config, telegrafCfg *telegra for _, output := range telegrafCfg.Outputs { ua.outputs.Add(output.Config.Name) } - + //Adding ROSA status + if envconfig.IsRunningOnROSA(){ + ua.inputs.Add(flagROSA) + + } + for _, pipeline := range otelCfg.Service.Pipelines { for _, receiver := range pipeline.Receivers { // trim the adapter prefix from adapted Telegraf plugins From a83d3b79dd2c487959940787dba3ebd0bd74670e Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 16:39:51 -0400 Subject: [PATCH 49/52] added agent health for rosa --- cfg/envconfig/envconfig.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/envconfig/envconfig.go b/cfg/envconfig/envconfig.go index 3d3c02a0de..d22dc61a62 100644 --- a/cfg/envconfig/envconfig.go +++ b/cfg/envconfig/envconfig.go @@ -25,7 +25,7 @@ const ( RunAsHostProcessContainer = "RUN_AS_HOST_PROCESS_CONTAINER" RunInAWS = "RUN_IN_AWS" RunWithIRSA = "RUN_WITH_IRSA" - RunWithROSA = "RUN_ON_ROSA" + RunOnROSA = "RUN_ON_ROSA" UseDefaultConfig = "USE_DEFAULT_CONFIG" HostName = "HOST_NAME" PodName = "POD_NAME" @@ -75,5 +75,5 @@ func IsWindowsHostProcessContainer() bool { } func IsRunningOnROSA() bool { - return os.Getenv(RunWithROSA) == TrueValue + return os.Getenv(RunOnROSA) == TrueValue } From 7f54dd3b322fedfdc514db3a6e7b9a96b1aeafaa Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Tue, 18 Mar 2025 16:51:29 -0400 Subject: [PATCH 50/52] ran fmt and lint --- extension/agenthealth/handler/useragent/useragent.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/agenthealth/handler/useragent/useragent.go b/extension/agenthealth/handler/useragent/useragent.go index daa1e2de07..cf0134a1f7 100644 --- a/extension/agenthealth/handler/useragent/useragent.go +++ b/extension/agenthealth/handler/useragent/useragent.go @@ -32,8 +32,8 @@ const ( flagAppSignals = "application_signals" flagEnhancedContainerInsights = "enhanced_container_insights" flagSELinux = "selinux" - flagROSA = "rosa" - separator = " " + flagROSA = "rosa" + separator = " " typeInputs = "inputs" typeProcessors = "processors" @@ -84,11 +84,11 @@ func (ua *userAgent) SetComponents(otelCfg *otelcol.Config, telegrafCfg *telegra ua.inputs.Add(flagSELinux) } //Adding ROSA status - if envconfig.IsRunningOnROSA(){ + if envconfig.IsRunningOnROSA() { ua.inputs.Add(flagROSA) - + } - + for _, pipeline := range otelCfg.Service.Pipelines { for _, receiver := range pipeline.Receivers { // trim the adapter prefix from adapted Telegraf plugins From 8737109685bd49274bdd7c5f611cd09a34100036 Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Thu, 27 Mar 2025 11:49:02 -0400 Subject: [PATCH 51/52] rosa image args --- .github/workflows/e2e-rosa-test.yml | 10 ++++++++++ .github/workflows/e2e-test.yml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-rosa-test.yml b/.github/workflows/e2e-rosa-test.yml index 4ee084941d..0036545893 100644 --- a/.github/workflows/e2e-rosa-test.yml +++ b/.github/workflows/e2e-rosa-test.yml @@ -305,6 +305,16 @@ jobs: --eksClusterName=${{needs.CreateCluster.outputs.cluster_name}} \ --eksDeploymentStrategy="DAEMON" \ --region=${{env.AWS_REGION}} \ + --helm_charts_branch=${{inputs.helm_charts_branch}} \ + --cloudwatch_agent_repository=${{inputs.cloudwatch_agent_repository}} \ + --cloudwatch_agent_tag=${{inputs.cloudwatch_agent_tag}} \ + --cloudwatch_agent_repository_url=${{inputs.cloudwatch_agent_repository_url}} \ + --cloudwatch_agent_operator_repository=${{inputs.cloudwatch_agent_operator_repository}} \ + --cloudwatch_agent_operator_tag=${{inputs.cloudwatch_agent_operator_tag}} \ + --cloudwatch_agent_operator_repository_url=${{inputs.cloudwatch_agent_operator_repository_url}} \ + --cloudwatch_agent_target_allocator_repository=${{inputs.cloudwatch_agent_target_allocator_repository}} \ + --cloudwatch_agent_target_allocator_tag=${{inputs.cloudwatch_agent_target_allocator_tag}} \ + --cloudwatch_agent_target_allocator_repository_url=${{inputs.cloudwatch_agent_target_allocator_repository_url}} \ --sample_app=${{matrix.arrays.sample_app_path}} \ --timeout 30m \ --v diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index b715de2688..67b7ef4c74 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -86,7 +86,7 @@ jobs: test-image-before-upload: false OutputEnvVariables: -# needs: [ BuildAgent, BuildOperator ] + needs: [ BuildAgent, BuildOperator ] name: 'OutputEnvVariables' runs-on: ubuntu-latest outputs: From 86b1625328183c6d36dbb5099f4c99d95b85584f Mon Sep 17 00:00:00 2001 From: Okan Kocabalkanli Date: Thu, 27 Mar 2025 11:54:33 -0400 Subject: [PATCH 52/52] fixed merge --- extension/agenthealth/handler/useragent/useragent.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/extension/agenthealth/handler/useragent/useragent.go b/extension/agenthealth/handler/useragent/useragent.go index 518c7ed15a..152a3b6e6d 100644 --- a/extension/agenthealth/handler/useragent/useragent.go +++ b/extension/agenthealth/handler/useragent/useragent.go @@ -87,11 +87,6 @@ func (ua *userAgent) SetComponents(otelCfg *otelcol.Config, telegrafCfg *telegra if envconfig.IsRunningInROSA() { ua.outputs.Add(flagROSA) } - //Adding ROSA status - if envconfig.IsRunningOnROSA() { - ua.inputs.Add(flagROSA) - - } for _, pipeline := range otelCfg.Service.Pipelines { for _, receiver := range pipeline.Receivers {