diff --git a/.github/workflows/java-sample-app-ecr-deploy.yml b/.github/workflows/java-sample-app-ecr-deploy.yml index d6cc1166..c3caa75d 100644 --- a/.github/workflows/java-sample-app-ecr-deploy.yml +++ b/.github/workflows/java-sample-app-ecr-deploy.yml @@ -18,14 +18,98 @@ env: E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} jobs: - java-v11-main: + # java-v11-main: + # 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' ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # 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 }} + # JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: ${{ matrix.aws-region }} + + # - name: Build and Upload Main Service Image + # working-directory: sample-apps/java/springboot-main-service + # run: | + # sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ env.JAVA_MAIN_SAMPLE_APP_IMAGE }}:v11"#g' build.gradle.kts + # gradle jib -P javaVersion=11 + + # java-v11-remote: + # 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' ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: us-east-1 + + # - name: Retrieve account + # if: ${{ matrix.aws-region }} == 'standard' + # uses: aws-actions/aws-secretsmanager-get-secrets@v1 + # with: + # secret-ids: | + # ACCOUNT_ID, region-account/${{ matrix.aws-region }} + # JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image + + # - name: Retrieve account + # if: ${{ matrix.aws-region }} == 'otlp' + # uses: aws-actions/aws-secretsmanager-get-secrets@v1 + # with: + # secret-ids: | + # ACCOUNT_ID, region-account/${{ matrix.aws-region }} + # JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: ${{ matrix.aws-region }} + + # - name: Build and Upload Remote Service Image + # working-directory: sample-apps/java/springboot-remote-service + # run: | + # sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ env.JAVA_REMOTE_SAMPLE_APP_IMAGE }}:v11"#g' build.gradle.kts + # gradle jib -P javaVersion=11 + + java-otlp-main: 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' ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -39,12 +123,21 @@ jobs: aws-region: us-east-1 - name: Retrieve account + if: ${{ matrix.aws-region }} == 'standard' uses: aws-actions/aws-secretsmanager-get-secrets@v1 with: secret-ids: | ACCOUNT_ID, region-account/${{ matrix.aws-region }} JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image + - name: Retrieve account + if: ${{ matrix.aws-region }} == 'otlp' + uses: aws-actions/aws-secretsmanager-get-secrets@v1 + with: + secret-ids: | + ACCOUNT_ID, otlp-region-account/gamma-${{ matrix.aws-region }} + JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -57,14 +150,11 @@ jobs: sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ env.JAVA_MAIN_SAMPLE_APP_IMAGE }}:v11"#g' build.gradle.kts gradle jib -P javaVersion=11 - java-v11-remote: + java-otlp-remote: 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' ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -81,7 +171,7 @@ jobs: uses: aws-actions/aws-secretsmanager-get-secrets@v1 with: secret-ids: | - ACCOUNT_ID, region-account/${{ matrix.aws-region }} + ACCOUNT_ID, otlp-region-account/gamma-${{ matrix.aws-region }} JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image - name: Configure AWS Credentials @@ -96,82 +186,82 @@ jobs: sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ env.JAVA_REMOTE_SAMPLE_APP_IMAGE }}:v11"#g' build.gradle.kts gradle jib -P javaVersion=11 - java-main: - strategy: - fail-fast: false - matrix: - java-version: [ '8', '17', '21', '22' ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: ${{ matrix.java-version }} - check-latest: true + # java-main: + # strategy: + # fail-fast: false + # matrix: + # java-version: [ '8', '17', '21', '22' ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: ${{ matrix.java-version }} + # check-latest: true - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} - aws-region: us-east-1 + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: us-east-1 - - name: Retrieve account - uses: aws-actions/aws-secretsmanager-get-secrets@v2 - with: - secret-ids: | - JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image + # - name: Retrieve account + # uses: aws-actions/aws-secretsmanager-get-secrets@v2 + # with: + # secret-ids: | + # JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image - - name: Build and Upload Main Service Image - working-directory: sample-apps/java/springboot-main-service - run: | - # For Java 8, springboot must be lower than version 3 - # For Java 11,17,21, they are compatible with both springboot version - # For Java 22 and above, springboot must be version 3 or higher - if [ "${{ matrix.java-version }}" = "22" ]; then - sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts - cat build.gradle.kts - fi - - sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.E2E_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ env.JAVA_MAIN_SAMPLE_APP_IMAGE }}:v${{ matrix.java-version }}"#g' build.gradle.kts - gradle jib -P javaVersion=${{ matrix.java-version }} - - java-remote: - strategy: - fail-fast: false - matrix: - java-version: [ '8', '17', '21', '22' ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: ${{ matrix.java-version }} - check-latest: true + # - name: Build and Upload Main Service Image + # working-directory: sample-apps/java/springboot-main-service + # run: | + # # For Java 8, springboot must be lower than version 3 + # # For Java 11,17,21, they are compatible with both springboot version + # # For Java 22 and above, springboot must be version 3 or higher + # if [ "${{ matrix.java-version }}" = "22" ]; then + # sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts + # cat build.gradle.kts + # fi - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} - aws-region: us-east-1 + # sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.E2E_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ env.JAVA_MAIN_SAMPLE_APP_IMAGE }}:v${{ matrix.java-version }}"#g' build.gradle.kts + # gradle jib -P javaVersion=${{ matrix.java-version }} - - name: Retrieve account - uses: aws-actions/aws-secretsmanager-get-secrets@v2 - with: - secret-ids: | - JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image + # java-remote: + # strategy: + # fail-fast: false + # matrix: + # java-version: [ '8', '17', '21', '22' ] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-java@v4 + # with: + # distribution: 'temurin' + # java-version: ${{ matrix.java-version }} + # check-latest: true - - name: Build and Upload Remote Service Image - working-directory: sample-apps/java/springboot-remote-service - run: | - # For Java 8, springboot must be lower than version 3 - # For Java 11,17,21, they are compatible with both springboot version - # For Java 22 and above, springboot must be version 3 or higher - if [ "${{ matrix.java-version }}" = "22" ]; then - sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts - cat build.gradle.kts - fi - - sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.E2E_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ env.JAVA_REMOTE_SAMPLE_APP_IMAGE }}:v${{ matrix.java-version }}"#g' build.gradle.kts - gradle jib -P javaVersion=${{ matrix.java-version }} + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: us-east-1 + + # - name: Retrieve account + # uses: aws-actions/aws-secretsmanager-get-secrets@v2 + # with: + # secret-ids: | + # JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image + + # - name: Build and Upload Remote Service Image + # working-directory: sample-apps/java/springboot-remote-service + # run: | + # # For Java 8, springboot must be lower than version 3 + # # For Java 11,17,21, they are compatible with both springboot version + # # For Java 22 and above, springboot must be version 3 or higher + # if [ "${{ matrix.java-version }}" = "22" ]; then + # sed -i 's/id("org.springframework.boot")/id("org.springframework.boot") version "3.3.4"/' build.gradle.kts + # cat build.gradle.kts + # fi + + # sed -i 's#"{{ECR_IMAGE_URI}}"#"${{ env.E2E_TEST_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/${{ env.JAVA_REMOTE_SAMPLE_APP_IMAGE }}:v${{ matrix.java-version }}"#g' build.gradle.kts + # gradle jib -P javaVersion=${{ matrix.java-version }} diff --git a/.github/workflows/traffic-generator-image-build.yml b/.github/workflows/traffic-generator-image-build.yml index ad880805..2d81201b 100644 --- a/.github/workflows/traffic-generator-image-build.yml +++ b/.github/workflows/traffic-generator-image-build.yml @@ -19,14 +19,55 @@ env: E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} jobs: - build-and-push-image: + # build-and-push-image: + # 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'] + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # 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/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: ${{ matrix.aws-region }} + + # - name: Login to Amazon ECR + # id: login-ecr + # uses: aws-actions/amazon-ecr-login@v2 + + # - name: Build, tag, and push image to Amazon ECR + # working-directory: sample-apps/traffic-generator + # env: + # REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # REPOSITORY: e2e-test-resource + # IMAGE_TAG: traffic-generator + # run: | + # docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . + # docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG + + build-and-push-image-otlp-account: 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 @@ -41,7 +82,7 @@ jobs: uses: aws-actions/aws-secretsmanager-get-secrets@v1 with: secret-ids: | - ACCOUNT_ID, region-account/${{ matrix.aws-region }} + ACCOUNT_ID, otlp-region-account/gamma-${{ matrix.aws-region }} - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -63,38 +104,38 @@ jobs: docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG - upload-files-to-s3: - 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'] - steps: - - name: Checkout repository - uses: actions/checkout@v4 + # upload-files-to-s3: + # 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'] + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} - aws-region: us-east-1 + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + # 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/${{ env.E2E_TEST_ROLE_NAME }} - 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/${{ env.E2E_TEST_ROLE_NAME }} + # aws-region: ${{ matrix.aws-region }} - - name: Upload traffic generator files - 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 + # - name: Upload traffic generator files + # 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