Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test collector #981

Closed
wants to merge 13 commits into from
8 changes: 4 additions & 4 deletions .github/collector/collector-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ receivers:
endpoint: 0.0.0.0:4317

exporters:
debug:
verbosity: normal
logging:
loglevel: info
awsxray:
region: us-west-2
awsemf:
Expand All @@ -21,11 +21,11 @@ service:
receivers:
- otlp
exporters:
- debug
- logging
- awsxray
metrics:
receivers:
- otlp
exporters:
- debug
- logging
- awsemf
2 changes: 1 addition & 1 deletion .github/collector/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.7"
services:
otel:
image: amazon/aws-otel-collector:latest
image: amazon/aws-otel-collector:v0.41.1
command: --config /config/collector-config.yml
environment:
- AWS_ACCESS_KEY_ID
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/e2e-tests-app-with-java-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:

env:
# The precense of this env var is required. It is not redundant
AWS_DEFAULT_REGION: ${{ inputs.aws-region }}
AWS_DEFAULT_REGION: 'us-east-1'

jobs:
build_Images_For_Testing_Sample_App_With_Java_Agent:
Expand Down Expand Up @@ -166,19 +166,19 @@ jobs:
APP_IMAGE: public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1:${{ inputs.image_tag }}
VALIDATOR_COMMAND: -c spark-otel-trace-metric-validation.yml --endpoint http://app:4567 --metric-namespace aws-otel-integ-test -t ${{ github.run_id }}-${{ github.run_number }}

# publish status
publish-build-status:
needs: [ test_Spring_App_With_Java_Agent, test_Spark_App_With_Java_Agent, test_Spark_AWS_SDK_V1_App_With_Java_Agent ]
if: ${{ always() }}
uses: ./.github/workflows/publish-status.yml
with:
namespace: 'ADOT/GitHubActions'
repository: ${{ github.repository }}
branch: ${{ github.ref_name }}
workflow: ${{ inputs.caller-workflow-name }}
success: ${{ needs.test_Spring_App_With_Java_Agent.result == 'success' &&
needs.test_Spark_App_With_Java_Agent.result == 'success' &&
needs.test_Spark_AWS_SDK_V1_App_With_Java_Agent.result == 'success' }}
region: us-east-1
secrets:
roleArn: ${{ secrets.METRICS_ROLE_ARN }}
# # publish status
# publish-build-status:
# needs: [ test_Spring_App_With_Java_Agent, test_Spark_App_With_Java_Agent, test_Spark_AWS_SDK_V1_App_With_Java_Agent ]
# if: ${{ always() }}
# uses: ./.github/workflows/publish-status.yml
# with:
# namespace: 'ADOT/GitHubActions'
# repository: ${{ github.repository }}
# branch: ${{ github.ref_name }}
# workflow: ${{ inputs.caller-workflow-name }}
# success: ${{ needs.test_Spring_App_With_Java_Agent.result == 'success' &&
# needs.test_Spark_App_With_Java_Agent.result == 'success' &&
# needs.test_Spark_AWS_SDK_V1_App_With_Java_Agent.result == 'success' }}
# region: us-east-1
# secrets:
# roleArn: ${{ secrets.METRICS_ROLE_ARN }}
193 changes: 96 additions & 97 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Java Agent Main Build
on:
pull_request:
branches:
- main
- "release/v*"
push:
branches:
- main
Expand Down Expand Up @@ -75,29 +79,24 @@ jobs:
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_password: ${{ secrets.GPG_PASSPHRASE }}

- uses: gradle/wrapper-validation-action@v1

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Log in to AWS ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws
#
# - uses: gradle/wrapper-validation-action@v1

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
# aws-region: ${{ env.AWS_DEFAULT_REGION }}
#
# - name: Log in to AWS ECR
# uses: docker/login-action@v3
# with:
# registry: public.ecr.aws

- name: Build snapshot with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build integrationTests snapshot --stacktrace -PenableCoverage=true -PlocalDocker=true
env:
PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }}
PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true

- name: Get current version
id: getADOTJavaVersion
Expand All @@ -117,21 +116,21 @@ jobs:
echo "stagingRegistry=${{ env.STAGING_ECR_REGISTRY }}" >> $GITHUB_OUTPUT
echo "stagingRepository=${{ env.STAGING_ECR_REPOSITORY }}" >> $GITHUB_OUTPUT
echo "stagingImage=${{ env.STAGING_ECR_REGISTRY }}/${{ env.STAGING_ECR_REPOSITORY }}:${{ steps.java_agent_versioning.outputs.STAGING_TAG }}" >> $GITHUB_OUTPUT

- name: Build and Push Java Agent Image and Execute cpUtility Tests
uses: ./.github/actions/cpUtility-testing
with:
aws-region: us-west-2
image_uri_with_tag: ${{ steps.imageOutput.outputs.stagingImage }}
image_registry: ${{ steps.imageOutput.outputs.stagingRegistry }}
adot-java-version: ${{ steps.getADOTJavaVersion.outputs.adot_java_version }}
snapshot-ecr-role: ${{ secrets.JAVA_INSTRUMENTATION_SNAPSHOT_ECR }}

- name: Upload to GitHub Actions
uses: actions/upload-artifact@v3
with:
name: aws-opentelemetry-agent.jar
path: otelagent/build/libs/aws-opentelemetry-agent-*.jar
#
# - name: Build and Push Java Agent Image and Execute cpUtility Tests
# uses: ./.github/actions/cpUtility-testing
# with:
# aws-region: us-west-2
# image_uri_with_tag: ${{ steps.imageOutput.outputs.stagingImage }}
# image_registry: ${{ steps.imageOutput.outputs.stagingRegistry }}
# adot-java-version: ${{ steps.getADOTJavaVersion.outputs.adot_java_version }}
# snapshot-ecr-role: ${{ secrets.JAVA_INSTRUMENTATION_SNAPSHOT_ECR }}
#
# - name: Upload to GitHub Actions
# uses: actions/upload-artifact@v3
# with:
# name: aws-opentelemetry-agent.jar
# path: otelagent/build/libs/aws-opentelemetry-agent-*.jar

default-region-output:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -184,66 +183,66 @@ jobs:
image_tag: ${{ github.sha }}
caller-workflow-name: 'main-build'

# AppSignals Contract Tests
contract-tests:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'temurin'
- uses: gradle/wrapper-validation-action@v1

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Log in to AWS ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws

# cache local patch outputs
- name: Cache local Maven repository
id: cache-local-maven-repo
uses: actions/cache@v3
with:
path: |
~/.m2/repository/io/opentelemetry/
key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}

- name: Pull base image of Contract Tests Sample Apps
run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine

- name: Build snapshot with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: contractTests -PlocalDocker=true

application-signals-e2e-test:
needs: [build]
uses: ./.github/workflows/application-signals-e2e-test.yml
secrets: inherit
with:
adot-image-name: ${{ needs.build.outputs.staging-image }}

publish-build-status:
needs: [ build, contract-tests ]
if: ${{ always() }}
uses: ./.github/workflows/publish-status.yml
with:
namespace: 'ADOT/GitHubActions'
repository: ${{ github.repository }}
branch: ${{ github.ref_name }}
workflow: main-build
success: ${{ needs.build.result == 'success' &&
needs.contract-tests.result == 'success' }}
region: us-east-1
secrets:
roleArn: ${{ secrets.METRICS_ROLE_ARN }}
# # AppSignals Contract Tests
# contract-tests:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - uses: actions/setup-java@v4
# with:
# java-version: 23
# distribution: 'temurin'
# - uses: gradle/wrapper-validation-action@v1
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
# aws-region: ${{ env.AWS_DEFAULT_REGION }}
#
# - name: Log in to AWS ECR
# uses: docker/login-action@v3
# with:
# registry: public.ecr.aws
#
# # cache local patch outputs
# - name: Cache local Maven repository
# id: cache-local-maven-repo
# uses: actions/cache@v3
# with:
# path: |
# ~/.m2/repository/io/opentelemetry/
# key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}
#
# - name: Pull base image of Contract Tests Sample Apps
# run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine
#
# - name: Build snapshot with Gradle
# uses: gradle/gradle-build-action@v3
# with:
# arguments: contractTests -PlocalDocker=true
#
# application-signals-e2e-test:
# needs: [build]
# uses: ./.github/workflows/application-signals-e2e-test.yml
# secrets: inherit
# with:
# adot-image-name: ${{ needs.build.outputs.staging-image }}
#
# publish-build-status:
# needs: [ build, contract-tests ]
# if: ${{ always() }}
# uses: ./.github/workflows/publish-status.yml
# with:
# namespace: 'ADOT/GitHubActions'
# repository: ${{ github.repository }}
# branch: ${{ github.ref_name }}
# workflow: main-build
# success: ${{ needs.build.result == 'success' &&
# needs.contract-tests.result == 'success' }}
# region: us-east-1
# secrets:
# roleArn: ${{ secrets.METRICS_ROLE_ARN }}
46 changes: 27 additions & 19 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,35 @@ jobs:
with:
arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true

- name: Set up Java version for tests
uses: actions/setup-java@v4
with:
java-version: 23
distribution: temurin

- name: Pull base image of Contract Tests Sample Apps
if: ${{ matrix.os == 'ubuntu-latest' }}
run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine

- name: Run contract tests
uses: gradle/gradle-build-action@v3
- name: e2e-test
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/workflows/e2e-tests-app-with-java-agent.yml
with:
arguments: contractTests -PlocalDocker=true -i

- name: Set up Java version for image build
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
aws-region: 'us-east-1'
image_tag: ${{ github.sha }}
caller-workflow-name: 'main-build'

# - name: Set up Java version for tests
# uses: actions/setup-java@v4
# with:
# java-version: 23
# distribution: temurin
#
# - name: Pull base image of Contract Tests Sample Apps
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine
#
# - name: Run contract tests
# uses: gradle/gradle-build-action@v3
# if: ${{ matrix.os == 'ubuntu-latest' }}
# with:
# arguments: contractTests -PlocalDocker=true -i
#
# - name: Set up Java version for image build
# uses: actions/setup-java@v4
# with:
# java-version: 17
# distribution: temurin

- name: Get current version
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
Loading