Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 authored Jan 3, 2025
2 parents 66f3ef7 + f63d7d2 commit 1b0d8c4
Show file tree
Hide file tree
Showing 70 changed files with 3,122 additions and 1,563 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
canary-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Canary Test - (${{ matrix.aws_region }} - ${{ matrix.language }} - ${{ matrix.sample-app }} - ${{ matrix.instrumentation-type }} - ${{ matrix.architecture }})
strategy:
fail-fast: false
Expand Down Expand Up @@ -65,17 +65,17 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '~1.21.3'
go-version: '~1.23.4'
check-latest: true
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
if: ${{ matrix.language == 'java' }}
with:
distribution: corretto
java-version: '17'
- name: Cache (Java)
uses: actions/cache@v3
uses: actions/cache@v4
if: ${{ matrix.language == 'java' }}
with:
path: |
Expand All @@ -88,9 +88,9 @@ jobs:
- uses: actions/setup-node@v4
if: ${{ matrix.language == 'nodejs' }}
with:
node-version: '14'
node-version: '16'
- name: Cache (NodeJS)
uses: actions/cache@v3
uses: actions/cache@v4
if: ${{ matrix.language == 'nodejs' }}
with:
path: |
Expand All @@ -99,12 +99,12 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
if: ${{ matrix.language == 'python' }}
with:
python-version: '3.x'
- name: Cache (Python)
uses: actions/cache@v3
uses: actions/cache@v4
if: ${{ matrix.language == 'python' }}
with:
path: |
Expand All @@ -113,7 +113,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
if: ${{ matrix.language == 'dotnet' }}
with:
dotnet-version: '6.0.405'
Expand All @@ -122,7 +122,7 @@ jobs:
- name: Build functions
run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }}
working-directory: ${{ matrix.language }}
- uses: aws-actions/[email protected].1
- uses: aws-actions/[email protected].2
with:
role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }}
role-duration-seconds: 7200
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
repository: aws-observability/aws-otel-test-framework
path: test-framework
- name: validate trace sample
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
with:
timeout_seconds: 300
max_attempts: 3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand All @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
10 changes: 5 additions & 5 deletions .github/workflows/docker-build-lambda-soak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ permissions:

jobs:
build-lambda-soak:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/[email protected].1
uses: aws-actions/[email protected].2
with:
role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }}
role-duration-seconds: 1200
Expand All @@ -27,18 +27,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
context: adot/utils/soak
tags: |
public.ecr.aws/aws-otel-test/lambda-soak:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
189 changes: 189 additions & 0 deletions .github/workflows/main-build-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Java Layer Integration Test
on:
workflow_call:
inputs:
caller-workflow-name:
required: true
type: string
workflow_dispatch:

concurrency:
group: main-build-java-${{ github.ref_name }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

jobs:
integration-test:
runs-on: ubuntu-22.04
name: java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.architecture }}-${{matrix.confmap}}
strategy:
fail-fast: false
matrix:
architecture: [ amd64, arm64 ]
runtime: [java17, java11]
sample-app: [ aws-sdk, okhttp ]
instrumentation-type: [ wrapper ]
confmap: [ "noop" ]
include:
- sample-app: aws-sdk
instrumentation-type: agent
architecture: amd64
confmap: noop
runtime: java17
- sample-app: aws-sdk
instrumentation-type: agent
architecture: amd64
confmap: noop
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent
architecture: arm64
confmap: noop
runtime: java17
- sample-app: aws-sdk
instrumentation-type: agent
architecture: arm64
confmap: noop
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: amd64
confmap: s3
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: arm64
confmap: s3
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: amd64
confmap: http
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: arm64
confmap: http
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: amd64
confmap: https
runtime: java11
- sample-app: aws-sdk
instrumentation-type: agent-confmap
architecture: arm64
confmap: https
runtime: java11

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: '~1.23.4'
check-latest: true
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: '17'
- name: Cache (Java)
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: aws-actions/[email protected]
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: Build layers / functions
run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }}
working-directory: java
- name: Get Lambda Layer amd64 architecture value
if: ${{ matrix.architecture == 'amd64' }}
run: echo LAMBDA_FUNCTION_ARCH=x86_64 | tee --append $GITHUB_ENV
- 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=java/integration-tests/${{ matrix.sample-app }}/${{ matrix.instrumentation-type }} |
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-java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.confmap }}-${{ 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-java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.architecture }}-${{ github.run_id }}
TF_VAR_function_name: ${{ env.TERRAFORM_LAMBDA_FUNCTION_NAME }}
TF_VAR_architecture: ${{ env.LAMBDA_FUNCTION_ARCH }}
TF_VAR_configuration_source: ${{ matrix.confmap }}
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 AMP endpoint
id: extract-amp-endpoint
if: ${{ matrix.sample-app == 'aws-sdk' && startsWith(matrix.instrumentation-type, 'agent') }}
run: terraform output -raw amp_endpoint
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
with:
repository: aws-observability/aws-otel-test-framework
path: test-framework
- name: validate trace sample
run: |
cp adot/utils/expected-templates/java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}.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: validate java agent metric sample
if: ${{ matrix.sample-app == 'aws-sdk' && startsWith(matrix.instrumentation-type, 'agent') }}
run: |
cp adot/utils/expected-templates/java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-metric.json \
test-framework/validator/src/main/resources/expected-data-template/ampExpectedMetric.mustache
cd test-framework
./gradlew :validator:run --args="-c prometheus-static-metric-validation.yml --cortex-instance-endpoint ${{ steps.extract-amp-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 }}
Loading

0 comments on commit 1b0d8c4

Please sign in to comment.