Skip to content

Commit

Permalink
Ubuntu test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeel Mehta committed Jan 27, 2025
1 parent cab4210 commit 6e46a69
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 45 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/java-ec2-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
## including logs, metrics, and traces.
name: Java EC2 Enablement Canary Testing
on:
schedule:
- cron: '6,31 * * * *' # run the workflow at 6th and 31th minute of every hour
# schedule:
# - cron: '6,31 * * * *' # run the workflow at 6th and 31th minute of every hour
workflow_dispatch: # be able to run the workflow on demand

permissions:
Expand All @@ -20,24 +20,21 @@ jobs:
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']
uses: ./.github/workflows/java-ec2-default-retry.yml
secrets: inherit
with:
aws-region: ${{ matrix.aws-region }}
caller-workflow-name: 'appsignals-e2e-ec2-canary-test'
java-version: '11'
cpu-architecture: 'x86_64'
# java-version: '11'
# cpu-architecture: 'x86_64'

maven:
uses: ./.github/workflows/java-ec2-default-retry.yml
secrets: inherit
with:
aws-region: 'us-east-1'
caller-workflow-name: 'appsignals-e2e-ec2-maven-canary-test'
otel-source: 'maven'
java-version: '11'
cpu-architecture: 'x86_64'
# maven:
# uses: ./.github/workflows/java-ec2-default-retry.yml
# secrets: inherit
# with:
# aws-region: 'us-east-1'
# caller-workflow-name: 'appsignals-e2e-ec2-maven-canary-test'
# otel-source: 'maven'
# java-version: '11'
# cpu-architecture: 'x86_64'
38 changes: 19 additions & 19 deletions .github/workflows/java-ec2-default-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@ on:
caller-workflow-name:
required: true
type: string
java-version:
required: true
type: string
cpu-architecture:
required: false
type: string
default: "x86_64"
otel-source:
required: false
type: string
default: 'github'
# java-version:
# required: true
# type: string
# cpu-architecture:
# required: false
# type: string
# default: "x86_64"
# otel-source:
# required: false
# type: string
# default: 'github'

permissions:
id-token: write
contents: read

jobs:
java-ec2-default-attempt-1:
uses: ./.github/workflows/java-ec2-default-test.yml
uses: ./.github/workflows/java-ec2-ubuntu-test.yml
secrets: inherit
with:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
java-version: ${{ inputs.java-version }}
otel-source: ${{ inputs.otel-source }}
cpu-architecture: ${{ inputs.cpu-architecture }}
# java-version: ${{ inputs.java-version }}
# otel-source: ${{ inputs.otel-source }}
# cpu-architecture: ${{ inputs.cpu-architecture }}

java-ec2-default-attempt-2:
needs: [ java-ec2-default-attempt-1 ]
if: ${{ needs.java-ec2-default-attempt-1.outputs.job-started != 'true' }}
uses: ./.github/workflows/java-ec2-default-test.yml
uses: ./.github/workflows/java-ec2-ubuntu-test.yml
secrets: inherit
with:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
java-version: ${{ inputs.java-version }}
otel-source: ${{ inputs.otel-source }}
cpu-architecture: ${{ inputs.cpu-architecture }}
# java-version: ${{ inputs.java-version }}
# otel-source: ${{ inputs.otel-source }}
# cpu-architecture: ${{ inputs.cpu-architecture }}

publish-metric-attempt-1:
needs: [ java-ec2-default-attempt-1, java-ec2-default-attempt-2 ]
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/java-ec2-ubuntu-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ permissions:
env:
E2E_TEST_AWS_REGION: ${{ inputs.aws-region }}
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/java-main-service-v11.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/java-remote-service-v11.jar
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-jeel/java-main-service-v11.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-jeel/java-remote-service-v11.jar
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
METRIC_NAMESPACE: ApplicationSignals
Expand All @@ -53,7 +53,7 @@ jobs:

- uses: actions/checkout@v4
with:
repository: 'aws-observability/aws-application-signals-test-framework'
repository: 'Jeel-mehta/aws-application-signals-test-framework'
ref: ${{ env.CALLER_WORKFLOW_NAME == 'main-build' && 'main' || github.ref }}
fetch-depth: 0

Expand Down Expand Up @@ -101,7 +101,6 @@ jobs:
- name: Set Get CW Agent command environment variable
run: |
if [ "${{ github.event.repository.name }}" = "amazon-cloudwatch-agent" ]; then
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
echo GET_CW_AGENT_DEB_COMMAND= "aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ github.sha }}/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb ./cw-agent.deb" >> $GITHUB_ENV
else
echo GET_CW_AGENT_DEB_COMMAND="wget -O cw-agent.deb https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb" >> $GITHUB_ENV
Expand Down
10 changes: 5 additions & 5 deletions terraform/java/ec2/ubuntu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ data "aws_ami" "ami" {
}

resource "aws_instance" "main_service_instance" {
ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier)
ami = data.aws_ami.ami.id
instance_type = "t3.micro"
key_name = local.ssh_key_name
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
Expand Down Expand Up @@ -140,7 +140,7 @@ resource "null_resource" "main_service_setup" {
# Get and run the sample application with configuration
aws s3 cp ${var.sample_app_jar} ./main-service.jar
JAVA_TOOL_OPTIONS=' -javaagent:/home/ubuntu/adot.jar' \
JAVA_TOOL_OPTIONS=' -javaagent:./adot.jar' \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
Expand Down Expand Up @@ -177,7 +177,7 @@ resource "null_resource" "main_service_setup" {
}

resource "aws_instance" "remote_service_instance" {
ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier)
ami = data.aws_ami.ami.id
instance_type = "t3.micro"
key_name = local.ssh_key_name
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
Expand Down Expand Up @@ -244,7 +244,7 @@ resource "null_resource" "remote_service_setup" {
# Get and run the sample application with configuration
aws s3 cp ${var.sample_remote_app_jar} ./remote-service.jar
JAVA_TOOL_OPTIONS=' -javaagent:/home/ubuntu/adot.jar' \
JAVA_TOOL_OPTIONS=' -javaagent:./adot.jar' \
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
Expand Down Expand Up @@ -303,7 +303,7 @@ resource "null_resource" "traffic_generator_setup" {
sudo apt-get install -y awscli unzip tmux
# Bring in the traffic generator files to EC2 Instance
aws s3 cp s3://aws-appsignals-sample-app-prod-${var.aws_region}/traffic-generator.zip ./traffic-generator.zip
aws s3 cp s3://aws-appsignals-sample-app-prod-jeel/traffic-generator.zip ./traffic-generator.zip
unzip ./traffic-generator.zip -d ./
# Install the traffic generator dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,25 @@ public enum PredefinedExpectedTemplate implements FileConfig {
JAVA_EC2_ASG_CLIENT_CALL_METRIC("/expected-data-template/java/ec2/asg/client-call-metric.mustache"),
JAVA_EC2_ASG_CLIENT_CALL_TRACE("/expected-data-template/java/ec2/asg/client-call-trace.mustache"),

/** Java EC2 Ubuntu Test Case Validations */
JAVA_EC2_UBUNTU_DEFAULT_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/ec2/ubuntu/outgoing-http-call-log.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_OUTGOING_HTTP_CALL_METRIC(
"/expected-data-template/java/ec2/ubuntu/outgoing-http-call-metric.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_OUTGOING_HTTP_CALL_TRACE(
"/expected-data-template/java/ec2/ubuntu/outgoing-http-call-trace.mustache"),

JAVA_EC2_UBUNTU_DEFAULT_AWS_SDK_CALL_LOG("/expected-data-template/java/ec2/ubuntu/aws-sdk-call-log.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_AWS_SDK_CALL_METRIC("/expected-data-template/java/ec2/ubuntu/aws-sdk-call-metric.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_AWS_SDK_CALL_TRACE("/expected-data-template/java/ec2/ubuntu/aws-sdk-call-trace.mustache"),

JAVA_EC2_UBUNTU_DEFAULT_REMOTE_SERVICE_LOG("/expected-data-template/java/ec2/ubuntu/remote-service-log.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_REMOTE_SERVICE_METRIC("/expected-data-template/java/ec2/ubuntu/remote-service-metric.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_REMOTE_SERVICE_TRACE("/expected-data-template/java/ec2/ubuntu/remote-service-trace.mustache"),

JAVA_EC2_UBUNTU_DEFAULT_CLIENT_CALL_LOG("/expected-data-template/java/ec2/ubuntu/client-call-log.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_CLIENT_CALL_METRIC("/expected-data-template/java/ec2/ubuntu/client-call-metric.mustache"),
JAVA_EC2_UBUNTU_DEFAULT_CLIENT_CALL_TRACE("/expected-data-template/java/ec2/ubuntu/client-call-trace.mustache"),

/** Java EC2 K8s Test Case Validations */
JAVA_K8S_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/k8s/outgoing-http-call-log.mustache"),
JAVA_K8S_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/java/k8s/outgoing-http-call-metric.mustache"),
Expand Down

0 comments on commit 6e46a69

Please sign in to comment.