From d8525a68be2a90fb662a6de71a659a7adf28c377 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:57:26 +0000 Subject: [PATCH 1/6] build nodejs layer zip --- .github/workflows/main-build-nodejs.yml | 73 +++---------------------- 1 file changed, 7 insertions(+), 66 deletions(-) diff --git a/.github/workflows/main-build-nodejs.yml b/.github/workflows/main-build-nodejs.yml index d99e6534d..f365ff52c 100644 --- a/.github/workflows/main-build-nodejs.yml +++ b/.github/workflows/main-build-nodejs.yml @@ -16,7 +16,7 @@ permissions: contents: read jobs: - integration-test: + build-zip: runs-on: ubuntu-22.04 name: nodejs-wrapper-${{ matrix.architecture }} strategy: @@ -44,23 +44,10 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-node- - - uses: aws-actions/configure-aws-credentials@v4.0.2 - with: - role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }} - role-duration-seconds: 7200 - aws-region: us-east-1 - - name: Generate UUID - id: generate-uuid - run: | - UUID=$(uuidgen | cut -c1-4) - echo "uuid=$UUID" >> $GITHUB_OUTPUT - name: Patch ADOT run: ./patch-upstream.sh - - name: Login to Public ECR - uses: docker/login-action@v3 - with: - registry: public.ecr.aws - - name: Build layers / functions + + - name: Build layer Zip run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }} working-directory: nodejs - name: Get Lambda Layer amd64 architecture value @@ -69,54 +56,8 @@ jobs: - name: Get Lambda Layer arm64 architecture value if: ${{ matrix.architecture == 'arm64' }} run: echo LAMBDA_FUNCTION_ARCH=arm64 | tee --append $GITHUB_ENV - - name: Get terraform directory - run: | - echo TERRAFORM_DIRECTORY=nodejs/integration-tests/aws-sdk/wrapper | - tee --append $GITHUB_ENV - - uses: hashicorp/setup-terraform@v2 - - name: Initialize terraform - run: terraform init - working-directory: ${{ env.TERRAFORM_DIRECTORY }} - - name: Get terraform Lambda function name - run: | - echo TERRAFORM_LAMBDA_FUNCTION_NAME=lambda-nodejs-${{ matrix.architecture }}-${{ steps.generate-uuid.outputs.uuid }} | - tee --append $GITHUB_ENV - - name: Apply terraform - run: terraform apply -auto-approve - working-directory: ${{ env.TERRAFORM_DIRECTORY }} - env: - TF_VAR_sdk_layer_name: opentelemetry-nodejs-aws-sdk-wrapper-${{ matrix.architecture }} - TF_VAR_function_name: ${{ env.TERRAFORM_LAMBDA_FUNCTION_NAME }} - TF_VAR_architecture: ${{ env.LAMBDA_FUNCTION_ARCH }} - TF_VAR_runtime: ${{ matrix.runtime }} - - name: Extract endpoint - id: extract-endpoint - run: terraform output -raw api-gateway-url - working-directory: ${{ env.TERRAFORM_DIRECTORY }} - - name: Extract SDK layer arn - id: extract-sdk-layer-arn - run: terraform output -raw sdk_layer_arn - working-directory: ${{ env.TERRAFORM_DIRECTORY }} - - name: Output annotations - run: | - echo "::warning::Function: ${{ env.TERRAFORM_LAMBDA_FUNCTION_NAME }}" - echo "::warning::SDK Layer ARN: ${{ steps.extract-sdk-layer-arn.outputs.stdout }}" - - name: Send request to endpoint - run: curl -sS ${{ steps.extract-endpoint.outputs.stdout }} - - name: Checkout test framework - uses: actions/checkout@v4 + - name: upload built ZIP as artifact + uses: actions/upload-artifact@v4 with: - repository: aws-observability/aws-otel-test-framework - path: test-framework - - name: validate trace sample - run: | - cp adot/utils/expected-templates/nodejs-aws-sdk-wrapper.json \ - test-framework/validator/src/main/resources/expected-data-template/lambdaExpectedTrace.mustache - cd test-framework - ./gradlew :validator:run --args="-c default-lambda-validation.yml --endpoint ${{ steps.extract-endpoint.outputs.stdout }} --region $AWS_REGION" - - name: Destroy terraform - if: always() - run: terraform destroy -auto-approve - working-directory: ${{ env.TERRAFORM_DIRECTORY }} - env: - TF_VAR_architecture: ${{ env.LAMBDA_FUNCTION_ARCH }} + name: nodejs-layer-${{matrix.runtime}}-${{matrix.architecture }} + path: nodejs/layer/${{ matrix.architecture }}/*.zip From 3de31e677f3ffcbca8063161686c5ca6a314c372 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:05:43 +0000 Subject: [PATCH 2/6] build nodejs layer zip --- .github/workflows/main-build-nodejs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main-build-nodejs.yml b/.github/workflows/main-build-nodejs.yml index f365ff52c..7c9649906 100644 --- a/.github/workflows/main-build-nodejs.yml +++ b/.github/workflows/main-build-nodejs.yml @@ -50,6 +50,8 @@ jobs: - name: Build layer Zip run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }} working-directory: nodejs + - name: find all zip hashFiles + rub: find . -type f -name '*.zip' - name: Get Lambda Layer amd64 architecture value if: ${{ matrix.architecture == 'amd64' }} run: echo LAMBDA_FUNCTION_ARCH=x86_64 | tee --append $GITHUB_ENV From 3c1667a7ecf91f2085d66dc9ee643a23d5166051 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:06:28 +0000 Subject: [PATCH 3/6] build nodejs layer zip --- .github/workflows/main-build-nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-build-nodejs.yml b/.github/workflows/main-build-nodejs.yml index 7c9649906..9c8ff1fda 100644 --- a/.github/workflows/main-build-nodejs.yml +++ b/.github/workflows/main-build-nodejs.yml @@ -51,7 +51,7 @@ jobs: run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }} working-directory: nodejs - name: find all zip hashFiles - rub: find . -type f -name '*.zip' + run: find . -type f -name '*.zip' - name: Get Lambda Layer amd64 architecture value if: ${{ matrix.architecture == 'amd64' }} run: echo LAMBDA_FUNCTION_ARCH=x86_64 | tee --append $GITHUB_ENV From 7bbcc144d32ebbc244de5923ed28ac59f84aae35 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:14:00 +0000 Subject: [PATCH 4/6] build nodejs layer zip --- .github/workflows/main-build-nodejs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-build-nodejs.yml b/.github/workflows/main-build-nodejs.yml index 9c8ff1fda..81a80eba6 100644 --- a/.github/workflows/main-build-nodejs.yml +++ b/.github/workflows/main-build-nodejs.yml @@ -62,4 +62,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: nodejs-layer-${{matrix.runtime}}-${{matrix.architecture }} - path: nodejs/layer/${{ matrix.architecture }}/*.zip + path: | + ./opentelemetry-lambda/**/*.zip From 0158da1e2c7a4ce6e75e31b7eed563c880a8d410 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:12:24 +0000 Subject: [PATCH 5/6] Update submodules opentelemtry-lambda --- opentelemetry-lambda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-lambda b/opentelemetry-lambda index 5cc158009..2d1c790be 160000 --- a/opentelemetry-lambda +++ b/opentelemetry-lambda @@ -1 +1 @@ -Subproject commit 5cc158009047d6c5cdc9fad69b4a28e75c7c92f7 +Subproject commit 2d1c790be6652f8d2a33aece89a1a7735a9f9021 From dff55199fd074c6e3018c4839e55e6b042f17597 Mon Sep 17 00:00:00 2001 From: marpbri09 <132700882+Brihadh-Marpadga@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:37:15 +0000 Subject: [PATCH 6/6] update w0orkflow --- .github/workflows/main-build-nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-build-nodejs.yml b/.github/workflows/main-build-nodejs.yml index 81a80eba6..2e0e4a31f 100644 --- a/.github/workflows/main-build-nodejs.yml +++ b/.github/workflows/main-build-nodejs.yml @@ -44,8 +44,8 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-node- - - name: Patch ADOT - run: ./patch-upstream.sh + #- name: Patch ADOT + # run: ./patch-upstream.sh - name: Build layer Zip run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }}