Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 12 additions & 2 deletions .github/workflows/java-ec2-asg-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
caller-workflow-name:
required: true
type: string
cpu-architecture:
required: false
type: string
default: "x86_64"
outputs:
job-started:
value: ${{ jobs.java-ec2-asg.outputs.job-started }}
Expand All @@ -27,6 +31,7 @@ permissions:
env:
E2E_TEST_AWS_REGION: ${{ inputs.aws-region }}
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/main-service.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/remote-service.jar
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
Expand All @@ -48,7 +53,7 @@ jobs:
run: echo "job-started=true" >> $GITHUB_OUTPUT

- name: Generate testing id
run: echo TESTING_ID="${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV
run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -103,7 +108,11 @@ jobs:
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
echo GET_CW_AGENT_RPM_COMMAND= "aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ github.sha }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm ./cw-agent.rpm" >> $GITHUB_ENV
else
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ env.E2E_TEST_AWS_REGION }}.s3.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
else
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
fi
fi

- name: Set up terraform
Expand Down Expand Up @@ -141,6 +150,7 @@ jobs:
-var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
-var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
-var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?

if [ $deployment_failed -eq 1 ]; then
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/java-ec2-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
with:
aws-region: ${{ matrix.aws-region }}
caller-workflow-name: 'appsignals-e2e-ec2-canary-test'
cpu-architecture: 'x86_64'

maven:
uses: ./.github/workflows/java-ec2-default-retry.yml
Expand All @@ -37,3 +38,4 @@ jobs:
aws-region: 'us-east-1'
caller-workflow-name: 'appsignals-e2e-ec2-maven-canary-test'
otel-source: 'maven'
cpu-architecture: 'x86_64'
6 changes: 6 additions & 0 deletions .github/workflows/java-ec2-default-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
caller-workflow-name:
required: true
type: string
cpu-architecture:
required: false
type: string
default: "x86_64"
otel-source:
required: false
type: string
Expand All @@ -31,6 +35,7 @@ jobs:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
otel-source: ${{ inputs.otel-source }}
cpu-architecture: ${{ inputs.cpu-architecture }}

java-ec2-default-attempt-2:
needs: [ java-ec2-default-attempt-1 ]
Expand All @@ -41,6 +46,7 @@ jobs:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
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
12 changes: 11 additions & 1 deletion .github/workflows/java-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
caller-workflow-name:
required: true
type: string
cpu-architecture:
required: false
type: string
default: "x86_64"
otel-source:
required: false
type: string
Expand All @@ -32,6 +36,7 @@ env:
E2E_TEST_AWS_REGION: ${{ inputs.aws-region }}
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
OTEL_SOURCE: ${{ inputs.otel-source }}
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/main-service.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/remote-service.jar
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
Expand Down Expand Up @@ -112,7 +117,11 @@ jobs:
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
echo GET_CW_AGENT_RPM_COMMAND= "aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ github.sha }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm ./cw-agent.rpm" >> $GITHUB_ENV
else
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
else
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
fi
fi

- name: Set up terraform
Expand Down Expand Up @@ -150,6 +159,7 @@ jobs:
-var="sample_remote_app_jar=${{ env.SAMPLE_APP_REMOTE_SERVICE_JAR }}" \
-var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
-var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?

if [ $deployment_failed -eq 1 ]; then
Expand Down
8 changes: 4 additions & 4 deletions terraform/java/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ data "aws_ami" "ami" {
most_recent = true
filter {
name = "name"
values = ["al20*-ami-minimal-*-x86_64"]
values = ["al20*-ami-minimal-*-${var.cpu_architecture}"]
}
filter {
name = "state"
values = ["available"]
}
filter {
name = "architecture"
values = ["x86_64"]
values = [var.cpu_architecture]
}
filter {
name = "image-type"
Expand All @@ -86,7 +86,7 @@ data "aws_ami" "ami" {

resource "aws_launch_configuration" "launch_configuration" {
image_id = data.aws_ami.ami.id
instance_type = "t3.micro"
instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro"
key_name = local.ssh_key_name
associate_public_ip_address = true
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
Expand Down Expand Up @@ -158,7 +158,7 @@ resource "aws_autoscaling_group" "asg" {

resource "aws_instance" "remote_service_instance" {
ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier)
instance_type = "t3.micro"
instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro"
key_name = local.ssh_key_name
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
Expand Down
4 changes: 4 additions & 0 deletions terraform/java/ec2/asg/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ variable "get_adot_jar_command" {

variable "canary_type" {
default = "java-ec2-asg"
}

variable "cpu_architecture" {
default = "x86_64"
}
8 changes: 4 additions & 4 deletions terraform/java/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ data "aws_ami" "ami" {
most_recent = true
filter {
name = "name"
values = ["al20*-ami-minimal-*-x86_64"]
values = ["al20*-ami-minimal-*-${var.cpu_architecture}"]
}
filter {
name = "state"
values = ["available"]
}
filter {
name = "architecture"
values = ["x86_64"]
values = [var.cpu_architecture]
}
filter {
name = "image-type"
Expand All @@ -79,7 +79,7 @@ data "aws_ami" "ami" {

resource "aws_instance" "main_service_instance" {
ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier)
instance_type = "t3.micro"
instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro"
key_name = local.ssh_key_name
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
Expand Down Expand Up @@ -162,7 +162,7 @@ resource "null_resource" "main_service_setup" {

resource "aws_instance" "remote_service_instance" {
ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier)
instance_type = "t3.micro"
instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro"
key_name = local.ssh_key_name
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
Expand Down
4 changes: 4 additions & 0 deletions terraform/java/ec2/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ variable "get_adot_jar_command" {

variable "canary_type" {
default = "java-ec2-default"
}

variable "cpu_architecture" {
default = "x86_64"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"otel.resource.ec2.tag.aws:autoscaling:groupName": "^{{platformInfo}}$",
"otel.resource.host.id": "^{{instanceId}}$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$",
"otel.resource.host.name": "^{{privateDnsName}}$"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"otel.resource.ec2.tag.aws:autoscaling:groupName": "^{{platformInfo}}$",
"otel.resource.host.id": "^{{instanceId}}$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"otel.resource.host.name": "^{{privateDnsName}}$"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"otel.resource.ec2.tag.aws:autoscaling:groupName": "^{{platformInfo}}$",
"otel.resource.host.id": "^{{instanceId}}$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"otel.resource.host.name": "^{{privateDnsName}}$",
"aws.span.kind": "^LOCAL_ROOT$"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"otel.resource.ec2.tag.aws:autoscaling:groupName": "^{{platformInfo}}$",
"otel.resource.host.id": "^{{instanceId}}$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"otel.resource.host.name": "^{{privateDnsName}}$",
"aws.span.kind": "^LOCAL_ROOT$"
}
Expand Down Expand Up @@ -80,7 +80,7 @@
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"PlatformType": "^AWS::EC2$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"EC2.InstanceId": "^{{instanceId}}$",
"PlatformType": "^AWS::EC2$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"metadata": {
"default": {
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$"
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$"
}
},
"subsegments": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"EC2.InstanceId": "^{{instanceId}}$",
"PlatformType": "^AWS::EC2$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"EC2.InstanceId": "^{{instanceId}}$",
"PlatformType": "^AWS::EC2$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$"
}
},
Expand Down Expand Up @@ -75,7 +75,7 @@
"EC2.InstanceId": "^i-[A-Za-z0-9]{17}$",
"PlatformType": "^AWS::EC2$",
"otel.resource.host.image.id": "^{{instanceAmi}}$",
"otel.resource.host.type": "^t3.micro$",
"otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$",
"aws.span.kind": "^LOCAL_ROOT$"
}
},
Expand Down