Skip to content

Commit

Permalink
Merge branch 'aws:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
okankoAMZ authored Oct 2, 2024
2 parents 78cfab0 + 452c0f7 commit b275557
Show file tree
Hide file tree
Showing 130 changed files with 6,625 additions and 4,773 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/PR-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ jobs:
if: steps.cached_binaries.outputs.cache-hit != 'true' && needs.changes.outputs.build == 'true'
run: make test

- name: Upload coverage to Codecov
if: steps.cached_binaries.outputs.cache-hit != 'true' && needs.changes.outputs.build == 'true'
uses: codecov/codecov-action@v3
with:
verbose: true

- name: Build
if: steps.cached_binaries.outputs.cache-hit != 'true' && needs.changes.outputs.build == 'true'
run: make amazon-cloudwatch-agent-${{ matrix.family }}
Expand Down
68 changes: 52 additions & 16 deletions .github/workflows/application-signals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,84 +4,120 @@
# This is a reusable workflow for running the E2E test for Application Signals.
# It is meant to be called from another workflow.
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
name: E2E Testing
name: Application Signals E2E Test
on:
workflow_call:
workflow_dispatch:
inputs:
build_run_id:
description: 'The ID of the build-test-artifacts workflow run'
type: number
required: true
build_sha:
description: 'The SHA of the build-test-artifacts workflow run'
type: string
required: true

permissions:
id-token: write
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ inputs.aws-region }}'
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true


jobs:
CheckBuildTestArtifacts:
runs-on: ubuntu-latest
steps:
- run: |
if [[ ${{ inputs.build_sha }} == ${{ github.sha }} ]]; then
echo "Build SHA matches test SHA"
else
echo "Build SHA does not match test SHA"
exit 1
fi
- run: |
conclusion=$(gh run view ${{ inputs.build_run_id }} --repo $GITHUB_REPOSITORY --json conclusion -q '.conclusion')
if [[ $conclusion == "success" ]]; then
echo "Run succeeded"
else
echo "Run failed"
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
java-eks-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-e2e-test.yml@main
needs: CheckBuildTestArtifacts
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
test-cluster-name: 'e2e-cw-agent-test'
caller-workflow-name: 'main-build'

java-ec2-default-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-e2e-test.yml@main
needs: CheckBuildTestArtifacts
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

java-ec2-asg-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

java-metric-limiter-e2e-test:
needs: [ java-eks-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-metric-limiter-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts, java-eks-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/metric-limiter-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
test-cluster-name: 'e2e-cw-agent-test'
caller-workflow-name: 'main-build'

java-k8s-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-eks-e2e-test:
needs: [ java-metric-limiter-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts, java-metric-limiter-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
test-cluster-name: 'e2e-cw-agent-test'
caller-workflow-name: 'main-build'

python-ec2-default-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-ec2-asg-e2e-test:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-asg-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-asg-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-k8s-e2e-test:
needs: [ java-k8s-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-k8s-e2e-test.yml@main
needs: [ CheckBuildTestArtifacts, java-k8s-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-k8s-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/build-test-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: Build Test Artifacts
on:
push:
branches:
- main*
paths-ignore:
- '**/*.md'
- 'NOTICE'
- 'THIRD-PARTY'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/build-test-artifacts.yml'
- '!.github/workflows/integration-test.yml'
- '!.github/workflows/application-signals-e2e-test.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
BuildAndUpload:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET }}

BuildAndUploadPackages:
uses: ./.github/workflows/test-build-packages.yml
needs: [BuildAndUpload]
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET }}

BuildDocker:
needs: [BuildAndUpload]
uses: ./.github/workflows/test-build-docker.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
ContainerRepositoryNameAndTag: "cwagent-integration-test:${{ github.sha }}"
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"

BuildAndUploadITAR:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
Region: "us-gov-east-1"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET_ITAR }}

BuildAndUploadCN:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
Region: "cn-north-1"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET_CN }}

StartIntegrationTests:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ]
runs-on: ubuntu-latest
steps:
- run: gh workflow run integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

StartApplicationSignalsE2ETests:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ]
# Workflow only runs against main
if: ${{ contains(github.ref_name, 'main') }}
runs-on: ubuntu-latest
steps:
- run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/clean-aws-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,24 @@ jobs:
working-directory: tool/clean
run: go run ./clean_auto_scaling_groups/clean_auto_scaling_groups.go --tags=clean

clean-launch-configs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
aws-region: us-west-2

- name: Clean old launch configuration
working-directory: tool/clean
run: go run ./clean_launch_configuration/clean_launch_configuration.go --tags=clean
clean-iam-roles:
runs-on: ubuntu-latest
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stalled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'aws/amazon-cloudwatch-agent'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Loading

0 comments on commit b275557

Please sign in to comment.