From 23b7f8aa24f45583150b4ada957d2aeb253e0686 Mon Sep 17 00:00:00 2001 From: harryryu Date: Mon, 9 Sep 2024 00:51:34 -0700 Subject: [PATCH] Test --- .github/workflows/java-k8s-test.yml | 2 +- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ terraform/java/k8s/deploy/main.tf | 9 +++++---- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/java-k8s-test.yml b/.github/workflows/java-k8s-test.yml index 633fa5621..5b0f72e07 100644 --- a/.github/workflows/java-k8s-test.yml +++ b/.github/workflows/java-k8s-test.yml @@ -63,7 +63,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'aws-observability/aws-application-signals-test-framework' + repository: 'harrryr/aws-application-signals-test-framework' ref: ${{ env.CALLER_WORKFLOW_NAME == 'main-build' && 'main' || github.ref }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..7c8197c0a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +## This workflow aims to run the Application Signals end-to-end tests as a canary to +## test the artifacts for App Signals enablement. It will deploy the CloudWatch Agent +## Operator and our sample app and remote service onto a native K8s cluster, call the +## APIs, and validate the generated telemetry, including logs, metrics, and traces. +## It will then clean up the cluster and EC2 instance it runs on for the next test run. +name: Java K8s Enablement Canary Testing +on: + push: + +permissions: + id-token: write + contents: read + +jobs: + k8s: + uses: ./.github/workflows/java-k8s-retry.yml + secrets: inherit + with: + # To run in more regions, a cluster must be provisioned manually on EC2 instances in that region + aws-region: 'us-east-1' + caller-workflow-name: 'appsignals-e2e-k8s-canary-test' \ No newline at end of file diff --git a/terraform/java/k8s/deploy/main.tf b/terraform/java/k8s/deploy/main.tf index d77927d52..d345e2bd2 100644 --- a/terraform/java/k8s/deploy/main.tf +++ b/terraform/java/k8s/deploy/main.tf @@ -37,10 +37,11 @@ resource "null_resource" "deploy" { # Clone and install operator onto cluster echo "LOG: Cloning helm-charts repo" - git clone https://github.com/aws-observability/helm-charts -q - - cd helm-charts/charts/amazon-cloudwatch-observability/ - git reset --hard e0e99c77f69ef388b0ffce769371f7c735a776e4 + latest_version_url=$(curl -s https://api.github.com/repos/aws-observability/helm-charts/releases/latest | grep "tarball_url" | cut -d '"' -f 4) + echo "LOG: The latest helm chart version url is $latest_version_url" + curl -L $latest_version_url -o aws-observability-helm-charts-latest.tar.gz + tar -xvzf aws-observability-helm-charts-latest.tar.gz -C aws-observability-helm-charts-latest + cd aws-observability-helm-charts-latest echo "LOG: Installing CloudWatch Agent Operator using Helm" helm upgrade --install --debug --namespace amazon-cloudwatch amazon-cloudwatch-operator ./ --create-namespace --set region=${var.aws_region} --set clusterName=k8s-cluster-${var.test_id}