From 4245e9fae20a111305bea3d08c18bacbd6b0f4f5 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Thu, 9 Jan 2025 13:18:34 -0800 Subject: [PATCH 1/9] Generating unique test ids for different version tests --- .github/workflows/dotnet-ec2-default-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index ef1f5ceb4..6351daa92 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -73,7 +73,7 @@ jobs: sleep_time: 60 - name: Generate testing id - run: echo TESTING_ID="${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV + run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $GITHUB_ENV - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 From 4b719b4394e8131afc7742ee9ac84bd44a87ce53 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Fri, 10 Jan 2025 15:27:11 -0800 Subject: [PATCH 2/9] Added architecture variable and testing --- .github/workflows/dotnet-ec2-canary.yml | 10 ++++------ .github/workflows/dotnet-ec2-default-retry.yml | 6 ++++++ .github/workflows/dotnet-ec2-default-test.yml | 18 ++++++++++++++---- .../traffic-generator-image-build.yml | 12 +++--------- terraform/dotnet/ec2/default/main.tf | 14 +++++++------- terraform/dotnet/ec2/default/variables.tf | 4 ++++ 6 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index 5349c06ab..f7300b2db 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -8,8 +8,8 @@ name: Dotnet EC2 Enablement Canary Testing on: workflow_dispatch: # be able to run the workflow on demand - schedule: - - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour + # schedule: + # - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour permissions: id-token: write @@ -20,16 +20,14 @@ jobs: strategy: fail-fast: false matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] uses: ./.github/workflows/dotnet-ec2-default-retry.yml secrets: inherit with: aws-region: ${{ matrix.aws-region }} caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test' dotnet-version: '8.0' + cpu-architecture: 'x86_64' nuget: strategy: diff --git a/.github/workflows/dotnet-ec2-default-retry.yml b/.github/workflows/dotnet-ec2-default-retry.yml index 604e3e142..8aaa75b1b 100644 --- a/.github/workflows/dotnet-ec2-default-retry.yml +++ b/.github/workflows/dotnet-ec2-default-retry.yml @@ -17,6 +17,10 @@ on: dotnet-version: required: true type: string + cpu-architecture: + required: false + type: string + default: "x86_64" permissions: id-token: write @@ -30,6 +34,7 @@ jobs: aws-region: ${{ inputs.aws-region }} caller-workflow-name: ${{ inputs.caller-workflow-name }} dotnet-version: ${{ inputs.dotnet-version }} + cpu-architecture: ${{ inputs.cpu-architecture }} dotnet-ec2-default-attempt-2: needs: [ dotnet-ec2-default-attempt-1 ] @@ -40,6 +45,7 @@ jobs: aws-region: ${{ inputs.aws-region }} caller-workflow-name: ${{ inputs.caller-workflow-name }} dotnet-version: ${{ inputs.dotnet-version }} + cpu-architecture: ${{ inputs.cpu-architecture }} publish-metric-attempt-1: needs: [ dotnet-ec2-default-attempt-1, dotnet-ec2-default-attempt-2 ] diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index 6351daa92..3b735a142 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -23,6 +23,11 @@ on: required: false type: string default: '8.0' + cpu-architecture: + description: "Permitted values: x86_64 or arm64" + required: false + type: string + default: "x86_64" outputs: job-started: value: ${{ jobs.dotnet-ec2-default.outputs.job-started }} @@ -38,7 +43,8 @@ env: E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} DOTNET_VERSION: ${{ inputs.dotnet-version }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app-${{ inputs.dotnet-version }}.zip METRIC_NAMESPACE: ApplicationSignals LOG_GROUP_NAME: /aws/application-signals/data ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} @@ -58,7 +64,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'aws-observability/aws-application-signals-test-framework' + repository: 'Jeel-mehta/aws-application-signals-test-framework' ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }} fetch-depth: 0 @@ -109,8 +115,11 @@ jobs: # Get cloudwatch agent staging file if triggered by cw-a repo echo GET_CW_AGENT_RPM_COMMAND= "aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ github.sha }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm ./cw-agent.rpm" >> $GITHUB_ENV else - # Otherwise get latest release version - echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ env.E2E_TEST_AWS_REGION }}.s3.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV + if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then + echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ env.E2E_TEST_AWS_REGION }}.s3.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV + elif [ "${{ env.CPU_ARCHITECTURE }}" = "arm64" ]; then + echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ env.E2E_TEST_AWS_REGION }}.s3.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV + fi fi - name: Set up terraform @@ -148,6 +157,7 @@ jobs: -var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \ -var="get_adot_distro_command=${{ env.GET_ADOT_DISTRO_COMMAND }}" \ -var="language_version=${{ env.DOTNET_VERSION }}" \ + -var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \ || deployment_failed=$? if [ $deployment_failed -eq 1 ]; then diff --git a/.github/workflows/traffic-generator-image-build.yml b/.github/workflows/traffic-generator-image-build.yml index ad8808050..17ddb973f 100644 --- a/.github/workflows/traffic-generator-image-build.yml +++ b/.github/workflows/traffic-generator-image-build.yml @@ -23,10 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -67,10 +64,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -97,4 +91,4 @@ jobs: working-directory: sample-apps/traffic-generator run: | zip traffic-generator.zip ./index.js ./package.json - aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip \ No newline at end of file + aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip \ No newline at end of file diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 17bb0e478..581a73a0a 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -46,7 +46,7 @@ data "aws_ami" "ami" { most_recent = true filter { name = "name" - values = ["al20*-ami-minimal-*-x86_64"] + values = ["al20*-ami-minimal-*-${var.cpu_architecture}"] } filter { name = "state" @@ -54,7 +54,7 @@ data "aws_ami" "ami" { } filter { name = "architecture" - values = ["x86_64"] + values = [var.cpu_architecture] } filter { name = "image-type" @@ -79,7 +79,7 @@ data "aws_ami" "ami" { resource "aws_instance" "main_service_instance" { ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) - instance_type = "t3.small" + instance_type = var.cpu_architecture == "x86_64" ? "t3.small" : "t4g.micro" key_name = local.ssh_key_name iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] @@ -132,7 +132,7 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app.zip unzip -o dotnet-sample-app.zip # Get Absolute Path @@ -187,7 +187,7 @@ resource "null_resource" "main_service_setup" { resource "aws_instance" "remote_service_instance" { ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) - instance_type = "t3.small" + instance_type = var.cpu_architecture == "x86_64" ? "t3.small" : "t4g.micro" key_name = local.ssh_key_name iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] @@ -240,7 +240,7 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app.zip unzip -o dotnet-sample-app.zip # Get Absolute Path @@ -307,7 +307,7 @@ resource "null_resource" "traffic_generator_setup" { sudo yum install nodejs aws-cli unzip tmux -y # Bring in the traffic generator files to EC2 Instance - aws s3 cp s3://aws-appsignals-sample-app-prod-${var.aws_region}/traffic-generator.zip ./traffic-generator.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip ./traffic-generator.zip unzip ./traffic-generator.zip -d ./ # Install the traffic generator dependencies diff --git a/terraform/dotnet/ec2/default/variables.tf b/terraform/dotnet/ec2/default/variables.tf index 15f86d058..83477bb8f 100644 --- a/terraform/dotnet/ec2/default/variables.tf +++ b/terraform/dotnet/ec2/default/variables.tf @@ -43,4 +43,8 @@ variable "canary_type" { variable "language_version" { default = "8.0" +} + +variable "cpu_architecture" { + default = "x86_64" } \ No newline at end of file From 4651041d1b82e367ff71c42745bbd91e8e09bb83 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Fri, 10 Jan 2025 15:46:47 -0800 Subject: [PATCH 3/9] Testing code for both architectures --- .github/workflows/dotnet-ec2-canary.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index f7300b2db..10b07491f 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -29,6 +29,19 @@ jobs: dotnet-version: '8.0' cpu-architecture: 'x86_64' + default_arm64: + strategy: + fail-fast: false + matrix: + aws-region: ['us-east-1'] + uses: ./.github/workflows/dotnet-ec2-default-retry.yml + secrets: inherit + with: + aws-region: ${{ matrix.aws-region }} + caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test' + dotnet-version: '8.0' + cpu-architecture: 'arm64' + nuget: strategy: fail-fast: false From 8643e26c4ff930b0b7b8c6f64e94d183f17f8e80 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Fri, 10 Jan 2025 16:08:50 -0800 Subject: [PATCH 4/9] Testing it for arm64 architecture --- .github/workflows/dotnet-ec2-canary.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index 10b07491f..bdb1627cb 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -17,19 +17,6 @@ permissions: jobs: default: - strategy: - fail-fast: false - matrix: - aws-region: ['us-east-1'] - uses: ./.github/workflows/dotnet-ec2-default-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test' - dotnet-version: '8.0' - cpu-architecture: 'x86_64' - - default_arm64: strategy: fail-fast: false matrix: From 10c66ed10c7c67062484a52e3e0cfacac6de9825 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Fri, 10 Jan 2025 16:30:01 -0800 Subject: [PATCH 5/9] Setting ADOT Distro command env variable according to the architecture --- .github/workflows/dotnet-ec2-default-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index 3b735a142..d954fba4e 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -106,7 +106,11 @@ jobs: echo GET_ADOT_DISTRO_COMMAND="aws s3 cp s3://adot-autoinstrumentation-dotnet-staging/${{ env.ADOT_DISTRO_NAME }} ./${{ env.ADOT_DISTRO_NAME }} && unzip -d dotnet-distro ${{ env.ADOT_DISTRO_NAME }}" >> $GITHUB_ENV else # After Release will switch to latest tag instead of hard code version for canary purpose - echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" >> $GITHUB_ENV + if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then + echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" >> $GITHUB_ENV + elif [ "${{ env.CPU_ARCHITECTURE }}" = "arm64" ]; then + echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip" >> $GITHUB_ENV + fi fi - name: Set Get CW Agent command environment variable From 6dded9973c79c1d5391ac20b989f1744d4368d59 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Fri, 10 Jan 2025 16:43:03 -0800 Subject: [PATCH 6/9] Just renaming sample application in ec2 locally --- terraform/dotnet/ec2/default/main.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 581a73a0a..366a4d343 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -132,8 +132,8 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip + unzip -o dotnet-sample-app:${var.language_version}.zip # Get Absolute Path current_dir=$(pwd) @@ -240,8 +240,8 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip + unzip -o dotnet-sample-app:${var.language_version}.zip # Get Absolute Path current_dir=$(pwd) From 92a6ca936c8fb4b436e4d47bbc6f6481945e1e7c Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Wed, 15 Jan 2025 14:19:11 -0800 Subject: [PATCH 7/9] Testing amd64 --- .github/workflows/dotnet-ec2-canary.yml | 11 ++++++---- .github/workflows/dotnet-ec2-default-test.yml | 4 ++-- .../traffic-generator-image-build.yml | 12 +++++++--- terraform/dotnet/ec2/default/main.tf | 22 +++++++++++++------ 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index bdb1627cb..99704ffa0 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -8,8 +8,8 @@ name: Dotnet EC2 Enablement Canary Testing on: workflow_dispatch: # be able to run the workflow on demand - # schedule: - # - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour + schedule: + - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour permissions: id-token: write @@ -20,14 +20,17 @@ jobs: strategy: fail-fast: false matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] uses: ./.github/workflows/dotnet-ec2-default-retry.yml secrets: inherit with: aws-region: ${{ matrix.aws-region }} caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test' dotnet-version: '8.0' - cpu-architecture: 'arm64' + cpu-architecture: 'x86_64' nuget: strategy: diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index d954fba4e..3f71720f9 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -44,7 +44,7 @@ env: E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} DOTNET_VERSION: ${{ inputs.dotnet-version }} CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip METRIC_NAMESPACE: ApplicationSignals LOG_GROUP_NAME: /aws/application-signals/data ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'Jeel-mehta/aws-application-signals-test-framework' + repository: 'aws-observability/aws-application-signals-test-framework' ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }} fetch-depth: 0 diff --git a/.github/workflows/traffic-generator-image-build.yml b/.github/workflows/traffic-generator-image-build.yml index 17ddb973f..ad8808050 100644 --- a/.github/workflows/traffic-generator-image-build.yml +++ b/.github/workflows/traffic-generator-image-build.yml @@ -23,7 +23,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -64,7 +67,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -91,4 +97,4 @@ jobs: working-directory: sample-apps/traffic-generator run: | zip traffic-generator.zip ./index.js ./package.json - aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip \ No newline at end of file + aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip \ No newline at end of file diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 366a4d343..151e12dc7 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -132,8 +132,8 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip - unzip -o dotnet-sample-app:${var.language_version}.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip # Get Absolute Path current_dir=$(pwd) @@ -144,7 +144,11 @@ resource "null_resource" "main_service_setup" { dotnet build export CORECLR_ENABLE_PROFILING=1 export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + if [ "${var.cpu_architecture}" == "arm64" ]; then + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so + else + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + fi export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll @@ -240,8 +244,8 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip - unzip -o dotnet-sample-app:${var.language_version}.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip # Get Absolute Path current_dir=$(pwd) @@ -252,7 +256,11 @@ resource "null_resource" "remote_service_setup" { dotnet build export CORECLR_ENABLE_PROFILING=1 export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + if [ "${var.cpu_architecture}" == "arm64" ]; then + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so + else + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so + fi export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll @@ -307,7 +315,7 @@ resource "null_resource" "traffic_generator_setup" { sudo yum install nodejs aws-cli unzip tmux -y # Bring in the traffic generator files to EC2 Instance - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip ./traffic-generator.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-${var.aws_region}/traffic-generator.zip ./traffic-generator.zip unzip ./traffic-generator.zip -d ./ # Install the traffic generator dependencies From ef79a6eba97cb9cad168134fbc0c10d1141e4868 Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Wed, 15 Jan 2025 15:11:01 -0800 Subject: [PATCH 8/9] Testing setting up an environment variable change in accordance to architecture --- .github/workflows/dotnet-ec2-canary.yml | 9 +++------ .github/workflows/dotnet-ec2-default-test.yml | 4 ++-- .../traffic-generator-image-build.yml | 12 +++-------- terraform/dotnet/ec2/default/main.tf | 20 ++++++------------- 4 files changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index 99704ffa0..f7300b2db 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -8,8 +8,8 @@ name: Dotnet EC2 Enablement Canary Testing on: workflow_dispatch: # be able to run the workflow on demand - schedule: - - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour + # schedule: + # - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour permissions: id-token: write @@ -20,10 +20,7 @@ jobs: strategy: fail-fast: false matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] uses: ./.github/workflows/dotnet-ec2-default-retry.yml secrets: inherit with: diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index 3f71720f9..d954fba4e 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -44,7 +44,7 @@ env: E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} DOTNET_VERSION: ${{ inputs.dotnet-version }} CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app-${{ inputs.dotnet-version }}.zip METRIC_NAMESPACE: ApplicationSignals LOG_GROUP_NAME: /aws/application-signals/data ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'aws-observability/aws-application-signals-test-framework' + repository: 'Jeel-mehta/aws-application-signals-test-framework' ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }} fetch-depth: 0 diff --git a/.github/workflows/traffic-generator-image-build.yml b/.github/workflows/traffic-generator-image-build.yml index ad8808050..17ddb973f 100644 --- a/.github/workflows/traffic-generator-image-build.yml +++ b/.github/workflows/traffic-generator-image-build.yml @@ -23,10 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -67,10 +64,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', - 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', - 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', - 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] + aws-region: ['us-east-1'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -97,4 +91,4 @@ jobs: working-directory: sample-apps/traffic-generator run: | zip traffic-generator.zip ./index.js ./package.json - aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip \ No newline at end of file + aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip \ No newline at end of file diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 151e12dc7..2b80a2b2c 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -132,8 +132,8 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip + unzip -o dotnet-sample-app:${var.language_version}.zip # Get Absolute Path current_dir=$(pwd) @@ -144,11 +144,7 @@ resource "null_resource" "main_service_setup" { dotnet build export CORECLR_ENABLE_PROFILING=1 export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} - if [ "${var.cpu_architecture}" == "arm64" ]; then - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so - else - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so - fi + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-${var.cpu_architecture == "arm64" ? "arm64" : "x64"}/OpenTelemetry.AutoInstrumentation.Native.so export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll @@ -244,8 +240,8 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip - unzip -o dotnet-sample-app.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip + unzip -o dotnet-sample-app:${var.language_version}.zip # Get Absolute Path current_dir=$(pwd) @@ -256,11 +252,7 @@ resource "null_resource" "remote_service_setup" { dotnet build export CORECLR_ENABLE_PROFILING=1 export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} - if [ "${var.cpu_architecture}" == "arm64" ]; then - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so - else - export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so - fi + export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-${var.cpu_architecture == "arm64" ? "arm64" : "x64"}/OpenTelemetry.AutoInstrumentation.Native.so export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll From b05883cebff22c8f83b66a90fda91004f509506c Mon Sep 17 00:00:00 2001 From: Jeel Mehta Date: Wed, 15 Jan 2025 19:06:53 -0800 Subject: [PATCH 9/9] Testing AMD64 and adding arm64 --- .github/workflows/dotnet-ec2-canary.yml | 9 ++++++--- .github/workflows/dotnet-ec2-default-test.yml | 4 ++-- .github/workflows/traffic-generator-image-build.yml | 12 +++++++++--- terraform/dotnet/ec2/default/main.tf | 10 +++++----- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index f7300b2db..99704ffa0 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -8,8 +8,8 @@ name: Dotnet EC2 Enablement Canary Testing on: workflow_dispatch: # be able to run the workflow on demand - # schedule: - # - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour + schedule: + - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour permissions: id-token: write @@ -20,7 +20,10 @@ jobs: strategy: fail-fast: false matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] uses: ./.github/workflows/dotnet-ec2-default-retry.yml secrets: inherit with: diff --git a/.github/workflows/dotnet-ec2-default-test.yml b/.github/workflows/dotnet-ec2-default-test.yml index d954fba4e..3f71720f9 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -44,7 +44,7 @@ env: E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} DOTNET_VERSION: ${{ inputs.dotnet-version }} CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip METRIC_NAMESPACE: ApplicationSignals LOG_GROUP_NAME: /aws/application-signals/data ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} @@ -64,7 +64,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'Jeel-mehta/aws-application-signals-test-framework' + repository: 'aws-observability/aws-application-signals-test-framework' ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }} fetch-depth: 0 diff --git a/.github/workflows/traffic-generator-image-build.yml b/.github/workflows/traffic-generator-image-build.yml index 17ddb973f..ad8808050 100644 --- a/.github/workflows/traffic-generator-image-build.yml +++ b/.github/workflows/traffic-generator-image-build.yml @@ -23,7 +23,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -64,7 +67,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - aws-region: ['us-east-1'] + aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -91,4 +97,4 @@ jobs: working-directory: sample-apps/traffic-generator run: | zip traffic-generator.zip ./index.js ./package.json - aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip \ No newline at end of file + aws s3 cp traffic-generator.zip s3://aws-appsignals-sample-app-prod-${{ matrix.aws-region }}/traffic-generator.zip \ No newline at end of file diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 745808e10..e6c6c0f57 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -132,8 +132,8 @@ resource "null_resource" "main_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip - unzip -o dotnet-sample-app:${var.language_version}.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip # Get Absolute Path current_dir=$(pwd) @@ -240,8 +240,8 @@ resource "null_resource" "remote_service_setup" { ${var.get_adot_distro_command} # Get and run the sample application with configuration - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/dotnet-sample-app:${var.language_version}.zip ./dotnet-sample-app:${var.language_version}.zip - unzip -o dotnet-sample-app:${var.language_version}.zip + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip # Get Absolute Path current_dir=$(pwd) @@ -307,7 +307,7 @@ resource "null_resource" "traffic_generator_setup" { sudo yum install nodejs aws-cli unzip tmux -y # Bring in the traffic generator files to EC2 Instance - aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip ./traffic-generator.zip + aws s3 cp s3://aws-appsignals-sample-app-prod-${var.aws_region}/traffic-generator.zip ./traffic-generator.zip unzip ./traffic-generator.zip -d ./ # Install the traffic generator dependencies