Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/actions/lambda_artifacts_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Push Staging AWSOpenTelemetryDistroJs Layer
description: |
This action assumes that the repo was checked out. Builds and pushes/loads tarball and image files. Also performs scan
of the resultant image.

inputs:
aws-region:
required: false
description: 'AWS Region, required only if push_image is true'
node_version:
required: true
description: 'The node version used in actions'
layer_directory:
required: true
description: 'The role use to publish lambda layer'
terraform_directory:
required: true
description: 'The role use to publish lambda layer'
sample_app_directory:
required: true
description: 'The role use to publish lambda layer'
staging_s3_bucket:
required: true
description: 'S3 bucket holds SDK artifact tarball'
staging_tarball:
required: true
description: 'tarball file for building'

runs:
using: 'composite'
steps:
- name: Download Tarball to GitHub Actions
uses: actions/download-artifact@v3
with:
name: ${{ inputs.staging_tarball}}
path: ./aws-distro-opentelemetry-node-autoinstrumentation/
- name: Setup Layer Tools
shell: bash
run: npm install
working-directory: ${{ inputs.layer_directory }}
- name: Build Lambda Layer
shell: bash
run: npm install
working-directory: ${{ inputs.layer_directory }}/packages/layer
- name: Build Lambda Sample App
shell: bash
run: npm install
working-directory: ${{ inputs.layer_directory }}/sample-apps/aws-sdk
- name: Upload Layer to S3
shell: bash
run: |
aws s3 cp ./build/layer.zip s3://${{ env.STAGING_S3_BUCKET }}/layer-${{ github.run_id }}.zip
working-directory: ${{ inputs.layer_directory }}/packages/layer
- name: Upload Sample App to S3
shell: bash
run: |
aws s3 cp ./build/function.zip s3://${{ env.STAGING_S3_BUCKET }}/function-${{ github.run_id }}.zip
working-directory: ${{ inputs.layer_directory }}/sample-apps/aws-sdk
4 changes: 2 additions & 2 deletions .github/actions/set_up/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ inputs:
required: true
description: "The node version used in actions"
package_name:
required: true
required: false
description: "The package name"
os:
required: true
required: false
description: "The os"
run_unit_tests:
required: true
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/application-signals-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: Apache-2.0

# This is a reusable workflow for running the E2E test for Application Signals.
# It is meant to be called from another workflow.
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
name: E2E Testing
on:
workflow_call:
inputs:
staging-instrumentation-name:
required: true
type: string
adot-image-name:
required: true
type: string

permissions:
id-token: write
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ inputs.aws-region }}'
cancel-in-progress: false


jobs:
upload-main-build:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
# role-to-assume: arn:aws:iam::252610625673:role/${{ secrets.STAGING_ARTIFACTS_ACCESS_ROLE_NAME }}
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
aws-region: us-west-1

- uses: actions/download-artifact@v3
with:
name: ${{ inputs.staging-instrumentation-name }}

- name: Upload main-build instrumentation to S3
run: aws s3 cp ${{ inputs.staging-instrumentation-name }} s3://adot-autoinstrumentation-node-staging-min-sfo/${{ inputs.staging-instrumentation-name }}

# ec2-default:
# needs: [ upload-main-build ]
# uses: aws-observability/aws-application-signals-test-framework/.github/workflows/node-ec2-default-test.yml@main
# secrets: inherit
# with:
# aws-region: us-east-1
# staging-instrumentation-name: ${{ inputs.staging-instrumentation-name }}
# caller-workflow-name: 'main-build'
#
# ec2-asg:
# needs: [ upload-main-build ]
# uses: aws-observability/aws-application-signals-test-framework/.github/workflows/node-ec2-asg-test.yml@main
# secrets: inherit
# with:
# aws-region: us-east-1
# staging-instrumentation-name: ${{ inputs.staging-instrumentation-name }}
# caller-workflow-name: 'main-build'
#
# eks:
# uses: aws-observability/aws-application-signals-test-framework/.github/workflows/node-eks-test.yml@main
# secrets: inherit
# with:
# aws-region: us-east-1
# test-cluster-name: 'e2e-node-adot-test'
# adot-image-name: ${{ inputs.adot-image-name }}
# caller-workflow-name: 'main-build'
#
# k8s:
# uses: aws-observability/aws-application-signals-test-framework/.github/workflows/node-k8s-test.yml@main
# secrets: inherit
# with:
# aws-region: us-east-1
# adot-image-name: ${{ inputs.adot-image-name }}
# caller-workflow-name: 'main-build'

lambda:
uses: mxiamxia/aws-application-signals-test-framework/.github/workflows/node-lambda-test.yml@main
with:
aws-region: us-west-1
caller-workflow-name: 'main-build'
43 changes: 29 additions & 14 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ on:
- main
- "release/v*"
- e2e-parallel
- ci-workflow
workflow_dispatch:

# TODO: move the following into secrets, not expose any account id
env:
AWS_DEFAULT_REGION: us-east-1
STAGING_ECR_REGISTRY: 637423224110.dkr.ecr.us-east-1.amazonaws.com
AWS_DEFAULT_REGION: us-west-1
# STAGING_ECR_REGISTRY: 637423224110.dkr.ecr.us-east-1.amazonaws.com
STAGING_ECR_REGISTRY: 252610625673.dkr.ecr.us-west-1.amazonaws.com
STAGING_ECR_REPOSITORY: aws-observability/adot-autoinstrumentation-node-staging
STAGING_S3_BUCKET: ${{ secrets.STAGING_BUCKET_NAME }}

Expand Down Expand Up @@ -77,22 +81,33 @@ jobs:
with:
name: ${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
path: aws-distro-opentelemetry-node-autoinstrumentation/${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}

- name: Build and Publish Lambda Staging Layer
uses: ./.github/actions/lambda_artifacts_build
with:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
node_version: "20"
layer_directory: lambda-layer
terraform_directory: lambda-layer/terraform/lambda
sample_app_directory: lambda-layer/sample-apps/aws-sdk
staging_s3_bucket: ${{ env.STAGING_S3_BUCKET }}
staging_tarball: ${{ steps.staging_tarball_output.outputs.STAGING_TARBALL}}
# TODO - implement contract tests in NodeJS
# - name: Set up and run contract tests with pytest
# run: |
# bash scripts/set-up-contract-tests.sh
# pip install pytest
# pytest contract-tests/tests

# TODO - implement E2E tests in NodeJS
# application-signals-e2e-test:
# name: "Application Signals E2E Test"
# needs: [ build ]
# uses: ./.github/workflows/application-signals-e2e-test.yml
# secrets: inherit
# permissions:
# id-token: write
# contents: read
# with:
# staging-wheel-name: ${{ needs.build.outputs.staging_wheel_file }}
# adot-image-name: ${{ needs.build.outputs.staging_registry }}/aws-observability/adot-autoinstrumentation-python-staging:${{ needs.build.outputs.python_image_tag }}
application-signals-e2e-test:
name: "Application Signals E2E Test"
needs: [ build ]
uses: ./.github/workflows/application-signals-e2e-test.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
staging-instrumentation-name: ${{ needs.build.outputs.staging_tarball_file }}
adot-image-name: ${{ needs.build.outputs.staging_registry }}/aws-observability/adot-autoinstrumentation-node-staging:${{ needs.build.outputs.node_image_tag }}

2 changes: 2 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
run: npm ci
- name: Compile all NPM projects
run: npm run compile
- name: Build Lambda Layer
run: npm run build-lambda
- name: Unit tests (Full)
run: npm run test:coverage
- name: Report Coverage
Expand Down
Loading
Loading