diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml index 292fcc5d9..0b2fd99ad 100644 --- a/.github/workflows/dotnet-ec2-canary.yml +++ b/.github/workflows/dotnet-ec2-canary.yml @@ -7,9 +7,10 @@ ## including logs, metrics, and traces. name: Dotnet EC2 Enablement Canary Testing on: + push: 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,23 +21,21 @@ 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' - nuget: - strategy: - fail-fast: false - matrix: - aws-region: [ 'us-east-1'] - uses: ./.github/workflows/dotnet-ec2-nuget-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-dotnet-e2e-ec2-nuget-canary-test' \ No newline at end of file + # nuget: + # strategy: + # fail-fast: false + # matrix: + # aws-region: [ 'us-east-1'] + # uses: ./.github/workflows/dotnet-ec2-nuget-retry.yml + # secrets: inherit + # with: + # aws-region: ${{ matrix.aws-region }} + # caller-workflow-name: 'appsignals-dotnet-e2e-ec2-nuget-canary-test' \ No newline at end of file diff --git a/.github/workflows/dotnet-ec2-default-retry.yml b/.github/workflows/dotnet-ec2-default-retry.yml index 88336f2f9..8be454ebb 100644 --- a/.github/workflows/dotnet-ec2-default-retry.yml +++ b/.github/workflows/dotnet-ec2-default-retry.yml @@ -14,7 +14,9 @@ on: caller-workflow-name: required: true type: string - + dotnet-version: + required: true + type: string permissions: id-token: write contents: read @@ -26,6 +28,7 @@ jobs: with: aws-region: ${{ inputs.aws-region }} caller-workflow-name: ${{ inputs.caller-workflow-name }} + dotnet-version: ${{ inputs.dotnet-version }} dotnet-ec2-default-attempt-2: needs: [ dotnet-ec2-default-attempt-1 ] @@ -35,6 +38,7 @@ jobs: with: aws-region: ${{ inputs.aws-region }} caller-workflow-name: ${{ inputs.caller-workflow-name }} + dotnet-version: ${{ inputs.dotnet-version }} 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 9d09da3cd..86e220c0b 100644 --- a/.github/workflows/dotnet-ec2-default-test.yml +++ b/.github/workflows/dotnet-ec2-default-test.yml @@ -18,6 +18,11 @@ on: caller-workflow-name: required: true type: string + dotnet-version: + description: "Currently support version 6.0, 8.0" + required: false + type: string + default: '8.0' outputs: job-started: value: ${{ jobs.dotnet-ec2-default.outputs.job-started }} @@ -32,7 +37,8 @@ env: E2E_TEST_AWS_REGION: ${{ inputs.aws-region }} E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} - SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app.zip + DOTNET_VERSION: ${{ inputs.dotnet-version }} + 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 }} @@ -52,7 +58,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 @@ -141,6 +147,7 @@ jobs: -var="sample_app_zip=${{ env.SAMPLE_APP_ZIP }}" \ -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 }}" \ || deployment_failed=$? if [ $deployment_failed -eq 1 ]; then diff --git a/.github/workflows/dotnet-eks-canary.yml b/.github/workflows/dotnet-eks-canary.yml index dc005799c..fe8f992e5 100644 --- a/.github/workflows/dotnet-eks-canary.yml +++ b/.github/workflows/dotnet-eks-canary.yml @@ -7,10 +7,10 @@ ## including logs, metrics, and traces. name: Dotnet EKS Enablement Canary Testing on: - schedule: - - cron: '4,29 * * * *' # run the workflow at 4th and 29th minute of every hour + #schedule: + #- cron: '4,29 * * * *' # run the workflow at 4th and 29th minute of every hour workflow_dispatch: # be able to run the workflow on demand - + #push: concurrency: group: ${{ github.workflow }} cancel-in-progress: false @@ -25,10 +25,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-eks-retry.yml secrets: inherit with: diff --git a/.github/workflows/dotnet-eks-test.yml b/.github/workflows/dotnet-eks-test.yml index 26e20627d..40fe8fa60 100644 --- a/.github/workflows/dotnet-eks-test.yml +++ b/.github/workflows/dotnet-eks-test.yml @@ -58,7 +58,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 @@ -180,8 +180,8 @@ jobs: - name: Set Sample App Image run: | - echo MAIN_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.DOTNET_MAIN_SAMPLE_APP_IMAGE }}" >> $GITHUB_ENV - echo REMOTE_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.DOTNET_REMOTE_SAMPLE_APP_IMAGE }}" >> $GITHUB_ENV + echo MAIN_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.DOTNET_MAIN_SAMPLE_APP_IMAGE }}:8.0" >> $GITHUB_ENV + echo REMOTE_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.DOTNET_REMOTE_SAMPLE_APP_IMAGE }}:8.0" >> $GITHUB_ENV - name: Deploy sample app via terraform and wait for the endpoint to come online id: deploy-dotnet-app diff --git a/.github/workflows/dotnet-sample-app-ecr-deploy.yml b/.github/workflows/dotnet-sample-app-ecr-deploy.yml index 2a5fe96eb..f8ff8eda8 100644 --- a/.github/workflows/dotnet-sample-app-ecr-deploy.yml +++ b/.github/workflows/dotnet-sample-app-ecr-deploy.yml @@ -4,7 +4,7 @@ name: Sample App Deployment - Dotnet ECR on: workflow_dispatch: # be able to run the workflow on demand - + #push: permissions: id-token: write contents: read @@ -14,11 +14,12 @@ 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' ] + dotnet-version: [ '6.0', '8.0' ] runs-on: ubuntu-latest + env: + DEFAULT_VERSION: '8.0' + DOTNET_VERSION: ${{ matrix.dotnet-version }} steps: - uses: actions/checkout@v4 with: @@ -30,17 +31,69 @@ jobs: role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} aws-region: us-east-1 - - name: Retrieve account - uses: aws-actions/aws-secretsmanager-get-secrets@v1 - with: - secret-ids: - ACCOUNT_ID, region-account/${{ matrix.aws-region }} + # - name: Retrieve account + # uses: aws-actions/aws-secretsmanager-get-secrets@v1 + # with: + # secret-ids: + # ACCOUNT_ID, region-account/${{ matrix.aws-region }} - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} - aws-region: ${{ matrix.aws-region }} + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} + # aws-region: ${{ matrix.aws-region }} + - name: Update .NET version if not default + working-directory: sample-apps/dotnet + run: | + if [ "${DOTNET_VERSION}" != "${DEFAULT_VERSION}" ]; then + echo "Updating .NET version from ${DEFAULT_VERSION} to ${DOTNET_VERSION}" + + # Function to update version in files + update_version() { + local file=$1 + if [ ! -f "$file" ]; then + echo "Error: File $file not found" + exit 1 + fi + + # Update TargetFramework in csproj files + if [[ $file == *.csproj ]]; then + sed -i "s/netcoreapp${DEFAULT_VERSION}<\/TargetFramework>/netcoreapp${DOTNET_VERSION}<\/TargetFramework>/g" "$file" + # Update version in Dockerfiles + elif [[ $file == */Dockerfile ]]; then + # Update SDK version + sed -i "s/mcr.microsoft.com\/dotnet\/sdk:${DEFAULT_VERSION}/mcr.microsoft.com\/dotnet\/sdk:${DOTNET_VERSION}/g" "$file" + + # Update ASP.NET runtime version + sed -i "s/mcr.microsoft.com\/dotnet\/aspnet:${DEFAULT_VERSION}/mcr.microsoft.com\/dotnet\/aspnet:${DOTNET_VERSION}/g" "$file" + fi + + if [ $? -ne 0 ]; then + echo "Error: Failed to update version in $file" + exit 1 + fi + echo "Successfully updated $file" + } + + # Update all relevant files + update_version "asp_frontend_service/Dockerfile" + update_version "asp_remote_service/Dockerfile" + update_version "asp_frontend_service/asp_frontend_service.csproj" + update_version "asp_remote_service/asp_remote_service.csproj" + + # Verify changes + echo "Verifying changes..." + echo "=== Frontend Dockerfile ===" + grep -n "FROM.*${DOTNET_VERSION}" asp_frontend_service/Dockerfile + echo "=== Remote Dockerfile ===" + grep -n "FROM.*${DOTNET_VERSION}" asp_remote_service/Dockerfile + echo "=== Frontend csproj ===" + grep -n "TargetFramework" asp_frontend_service/asp_frontend_service.csproj + echo "=== Remote csproj ===" + grep -n "TargetFramework" asp_remote_service/asp_remote_service.csproj + else + echo "Using default version ${DEFAULT_VERSION}, no changes needed" + fi - name: Login to Amazon ECR id: login-ecr @@ -53,10 +106,9 @@ jobs: - name: Upload Main Service Image run: | - docker tag dotnetsampleapp/frontend-service ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_FE_SA_IMG }} - docker push ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_FE_SA_IMG }} - + docker tag dotnetsampleapp/frontend-service 890742580622.dkr.ecr.us-east-1.amazonaws.com/appsignals-dotnet-main-service:${DOTNET_VERSION} + docker push 890742580622.dkr.ecr.us-east-1.amazonaws.com/appsignals-dotnet-main-service:${DOTNET_VERSION} - name: Upload Remote Service Image run: | - docker tag dotnetsampleapp/remote-service ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_RE_SA_IMG }} - docker push ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_RE_SA_IMG }} + docker tag dotnetsampleapp/remote-service 890742580622.dkr.ecr.us-east-1.amazonaws.com/appsignals-dotnet-remote-service:${DOTNET_VERSION} + docker push 890742580622.dkr.ecr.us-east-1.amazonaws.com/appsignals-dotnet-remote-service:${DOTNET_VERSION} diff --git a/.github/workflows/dotnet-sample-app-s3-deploy.yml b/.github/workflows/dotnet-sample-app-s3-deploy.yml index c856b1a81..c1829542b 100644 --- a/.github/workflows/dotnet-sample-app-s3-deploy.yml +++ b/.github/workflows/dotnet-sample-app-s3-deploy.yml @@ -4,7 +4,7 @@ name: Sample App Deployment - Dotnet S3 on: workflow_dispatch: # be able to run the workflow on demand - + #push: permissions: id-token: write contents: read @@ -14,11 +14,12 @@ 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'] + dotnet-version: [ '6.0', '8.0' ] runs-on: ubuntu-latest + env: + DEFAULT_VERSION: '8.0' + DOTNET_VERSION: ${{ matrix.dotnet-version }} steps: - uses: actions/checkout@v4 with: @@ -30,32 +31,129 @@ jobs: role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }} aws-region: us-east-1 - - name: Retrieve account - uses: aws-actions/aws-secretsmanager-get-secrets@v1 - with: - secret-ids: - ACCOUNT_ID, region-account/${{ matrix.aws-region }} - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} - aws-region: ${{ matrix.aws-region }} + # - name: Retrieve account + # uses: aws-actions/aws-secretsmanager-get-secrets@v1 + # with: + # secret-ids: + # ACCOUNT_ID, region-account/${{ matrix.aws-region }} + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} + # aws-region: ${{ matrix.aws-region }} + - name: Update .NET version if not default + working-directory: sample-apps/dotnet + run: | + if [ "${DOTNET_VERSION}" != "${DEFAULT_VERSION}" ]; then + echo "Updating .NET version from ${DEFAULT_VERSION} to ${DOTNET_VERSION}" + + # Function to update version in files + update_version() { + local file=$1 + if [ ! -f "$file" ]; then + echo "Error: File $file not found" + exit 1 + fi + + # Update TargetFramework in csproj files + if [[ $file == *.csproj ]]; then + sed -i "s/netcoreapp${DEFAULT_VERSION}<\/TargetFramework>/netcoreapp${DOTNET_VERSION}<\/TargetFramework>/g" "$file" + # Update version in Dockerfiles + elif [[ $file == */Dockerfile ]]; then + # Update SDK version + sed -i "s/mcr.microsoft.com\/dotnet\/sdk:${DEFAULT_VERSION}/mcr.microsoft.com\/dotnet\/sdk:${DOTNET_VERSION}/g" "$file" + + # Update ASP.NET runtime version + sed -i "s/mcr.microsoft.com\/dotnet\/aspnet:${DEFAULT_VERSION}/mcr.microsoft.com\/dotnet\/aspnet:${DOTNET_VERSION}/g" "$file" + fi + + if [ $? -ne 0 ]; then + echo "Error: Failed to update version in $file" + exit 1 + fi + echo "Successfully updated $file" + } + + # Update all relevant files + update_version "asp_frontend_service/Dockerfile" + update_version "asp_remote_service/Dockerfile" + update_version "asp_frontend_service/asp_frontend_service.csproj" + update_version "asp_remote_service/asp_remote_service.csproj" + + + # Verify changes + echo "Verifying changes..." + echo "=== Frontend Dockerfile ===" + grep -n "FROM.*${DOTNET_VERSION}" asp_frontend_service/Dockerfile + echo "=== Remote Dockerfile ===" + grep -n "FROM.*${DOTNET_VERSION}" asp_remote_service/Dockerfile + echo "=== Frontend csproj ===" + grep -n "TargetFramework" asp_frontend_service/asp_frontend_service.csproj + echo "=== Remote csproj ===" + grep -n "TargetFramework" asp_remote_service/asp_remote_service.csproj + + else + echo "Using default version ${DEFAULT_VERSION}, no changes needed" + fi + + # - name: Update .NET version if not default + # working-directory: terraform/dotnet/ec2/default + # run: | + # if [ "${DOTNET_VERSION}" != "${DEFAULT_VERSION}" ]; then + # echo "Updating .NET version from ${DEFAULT_VERSION} to ${DOTNET_VERSION}" + + # # Function to update version in files + # update_version() { + # local file=$1 + # if [ ! -f "$file" ]; then + # echo "Error: File $file not found" + # exit 1 + # fi + + # # Update version in main.tf files + # if [[ $file == main.tf ]]; then + # # Update dnf install command + # sed -i "s/dotnet-sdk-${DEFAULT_VERSION}/dotnet-sdk-${DOTNET_VERSION}/g" "$file" + # # Update nohup dotnet command + # sed -i "s/netcoreapp${DEFAULT_VERSION}/netcoreapp${DOTNET_VERSION}/g" "$file" + # fi + + # if [ $? -ne 0 ]; then + # echo "Error: Failed to update version in $file" + # exit 1 + # fi + # echo "Successfully updated $file" + # } + + # # Update all relevant files + # update_version "main.tf" + + # # Verify changes + # echo "Verifying changes..." + # echo "=== main.tf ===" + # grep -n "dotnet-sdk-${DOTNET_VERSION}" main.tf + # echo "=== main.tf ===" + # grep -n "netcoreapp${DOTNET_VERSION}" main.tf + # else + # echo "Using default version ${DEFAULT_VERSION}, no changes needed" + # fi - name: Build Sample App Zip working-directory: sample-apps/dotnet - run: zip -r dotnet-sample-app.zip . + run: zip -r dotnet-sample-app:${DOTNET_VERSION}.zip . - name: Upload to S3 working-directory: sample-apps/dotnet - run: aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./dotnet-sample-app.zip --key dotnet-sample-app.zip + run: aws s3api put-object --bucket aws-appsignals-sample-app-prod-jeel --body ./dotnet-sample-app:${DOTNET_VERSION}.zip --key dotnet-sample-app:${DOTNET_VERSION}.zip - name: Upload Windows Script to S3 working-directory: sample-apps/dotnet run: | - aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./dotnet-ec2-win-main-setup.ps1 --key dotnet-ec2-win-main-setup.ps1 - aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./dotnet-ec2-win-remote-setup.ps1 --key dotnet-ec2-win-remote-setup.ps1 - aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./amazon-cloudwatch-agent.json --key amazon-cloudwatch-agent.json + aws s3api put-object --bucket aws-appsignals-sample-app-prod-jeel --body ./dotnet-ec2-win-main-setup.ps1 --key dotnet-ec2-win-main-setup.ps1 + aws s3api put-object --bucket aws-appsignals-sample-app-prod-jeel --body ./dotnet-ec2-win-remote-setup.ps1 --key dotnet-ec2-win-remote-setup.ps1 + aws s3api put-object --bucket aws-appsignals-sample-app-prod-jeel --body ./amazon-cloudwatch-agent.json --key amazon-cloudwatch-agent.json + build-and-upload-lambda-sample-app: strategy: diff --git a/.github/workflows/java-eks-otlp-ocb-canary.yml b/.github/workflows/java-eks-otlp-ocb-canary.yml index a02bea0e6..27a341c8c 100644 --- a/.github/workflows/java-eks-otlp-ocb-canary.yml +++ b/.github/workflows/java-eks-otlp-ocb-canary.yml @@ -8,8 +8,8 @@ ## Logs, metrics, and traces are all validated. name: Java EKS OTLP/OCB Enablement Canary Test on: - schedule: - - cron: '12,37 * * * *' # run the workflow at 12th and 37th minute of every hour + # schedule: + # - cron: '12,37 * * * *' # run the workflow at 12th and 37th minute of every hour workflow_dispatch: # be able to run the workflow on demand permissions: 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/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs index c4427f9ed..f83fda27c 100644 --- a/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs +++ b/sample-apps/dotnet/asp_frontend_service/Controllers/AppController.cs @@ -61,7 +61,6 @@ public AppController() public string OutgoingHttp() { _ = this.httpClient.GetAsync("https://aws.amazon.com").Result; - return this.GetTraceId(); } diff --git a/terraform/dotnet/ec2/default/main.tf b/terraform/dotnet/ec2/default/main.tf index 38927235e..76420b15a 100644 --- a/terraform/dotnet/ec2/default/main.tf +++ b/terraform/dotnet/ec2/default/main.tf @@ -116,7 +116,11 @@ resource "null_resource" "main_service_setup" { sudo yum install -y wget sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo - sudo dnf install -y dotnet-sdk-8.0 + if [[ "${var.language_version}" == "8.0" ]]; then + sudo dnf install -y dotnet-sdk-8.0 + else + sudo dnf install -y dotnet-sdk-6.0 + fi sudo yum install unzip -y # Copy in CW Agent configuration @@ -132,8 +136,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) @@ -141,6 +145,7 @@ resource "null_resource" "main_service_setup" { # Export environment variables for instrumentation cd ./asp_frontend_service + 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 @@ -158,8 +163,7 @@ resource "null_resource" "main_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on export ASPNETCORE_URLS=http://0.0.0.0:8080 - dotnet build - nohup dotnet bin/Debug/netcoreapp8.0/asp_frontend_service.dll & + nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_frontend_service.dll & # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds sleep 30 @@ -224,7 +228,11 @@ resource "null_resource" "remote_service_setup" { sudo yum install -y wget sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo - sudo dnf install -y dotnet-sdk-8.0 + if [[ "${var.language_version}" == "8.0" ]]; then + sudo dnf install -y dotnet-sdk-8.0 + else + sudo dnf install -y dotnet-sdk-6.0 + fi sudo yum install unzip -y # Copy in CW Agent configuration @@ -240,8 +248,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) @@ -249,6 +257,7 @@ resource "null_resource" "remote_service_setup" { # Export environment variables for instrumentation cd ./asp_remote_service + 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 @@ -266,8 +275,7 @@ resource "null_resource" "remote_service_setup" { export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false export OTEL_TRACES_SAMPLER=always_on export ASPNETCORE_URLS=http://0.0.0.0:8081 - dotnet build - nohup dotnet bin/Debug/netcoreapp8.0/asp_remote_service.dll & + nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_remote_service.dll & # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds sleep 30 @@ -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-${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 98d75e176..15f86d058 100644 --- a/terraform/dotnet/ec2/default/variables.tf +++ b/terraform/dotnet/ec2/default/variables.tf @@ -39,4 +39,8 @@ variable "get_cw_agent_rpm_command" { variable "canary_type" { default = "dotnet-ec2-default" +} + +variable "language_version" { + default = "8.0" } \ No newline at end of file