Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
11 changes: 9 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,11 @@ on:
caller-workflow-name:
required: true
type: string
java-version:
description: "Currently support version 8, 11, 17, 21, 22"
required: false
type: string
default: '11'
cpu-architecture:
description: "Permitted values: x86_64 or arm64"
required: false
Expand All @@ -32,9 +37,10 @@ permissions:
env:
E2E_TEST_AWS_REGION: ${{ inputs.aws-region }}
CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }}
JAVA_VERSION: ${{ inputs.java-version }}
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
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/java-main-service-v${{ inputs.java-version }}.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/java-remote-service-v${{ inputs.java-version }}.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 Down Expand Up @@ -151,6 +157,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="language_version=${{ env.JAVA_VERSION }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?

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'
java-version: '11'
cpu-architecture: 'x86_64'

maven:
Expand All @@ -38,4 +39,5 @@ jobs:
aws-region: 'us-east-1'
caller-workflow-name: 'appsignals-e2e-ec2-maven-canary-test'
otel-source: 'maven'
java-version: '11'
cpu-architecture: 'x86_64'
5 changes: 5 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,9 @@ on:
caller-workflow-name:
required: true
type: string
java-version:
required: true
type: string
cpu-architecture:
required: false
type: string
Expand All @@ -34,6 +37,7 @@ jobs:
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 }}

Expand All @@ -45,6 +49,7 @@ jobs:
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 }}

Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/java-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
caller-workflow-name:
required: true
type: string
java-version:
description: "Currently support version 8, 11, 17, 21, 22"
required: false
type: string
default: '11'
cpu-architecture:
description: "Permitted values: x86_64 or arm64"
required: false
Expand All @@ -36,10 +41,11 @@ permissions:
env:
E2E_TEST_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 }}
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
SAMPLE_APP_FRONTEND_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}-2/java-main-service-v${{ inputs.java-version }}.jar
SAMPLE_APP_REMOTE_SERVICE_JAR: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}-2/java-remote-service-v${{ inputs.java-version }}.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 Down Expand Up @@ -160,6 +166,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="language_version=${{ env.JAVA_VERSION }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/k8s-patch-os-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,29 +202,29 @@ jobs:
"e2e-test/${{ matrix.instance.repo_name }}/${{ matrix.instance.language }}-k8s-master-node-endpoint-pending-value"
)
endpoint_secret=$(aws secretsmanager get-secret-value --secret-id "${PENDING_SECRET_KEYS[0]}" --query SecretString --output text)

instance_name=$(aws ec2 describe-instances \
--filters "Name=ip-address,Values=$endpoint_secret" \
--query "Reservations[*].Instances[*].{Name:Tags[?Key=='Name']|[0].Value}" \
--output text)

if [ -n "$instance_name" ]; then
prev_testing_id=$(echo $instance_name | awk -F'-' '{print $(NF-1)"-"$NF}')

aws ec2 delete-key-pair --key-name "k8s-on-ec2-${{ matrix.instance.ec2_name }}-${{ matrix.instance.language }}-key-pair-$prev_testing_id"

main_instance_name=k8s-on-ec2-${{ matrix.instance.ec2_name }}-${{ matrix.instance.language }}-master-$prev_testing_id
worker_instance_name=k8s-on-ec2-${{ matrix.instance.ec2_name }}-${{ matrix.instance.language }}-worker-$prev_testing_id
main_instance_id=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=$main_instance_name" \
--query "Reservations[*].Instances[*].InstanceId" \
--output text)

worker_instance_id=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=$worker_instance_name" \
--query "Reservations[*].Instances[*].InstanceId" \
--output text)

aws ec2 terminate-instances --instance-ids $main_instance_id
aws ec2 terminate-instances --instance-ids $worker_instance_id
fi
20 changes: 16 additions & 4 deletions terraform/java/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ resource "aws_launch_configuration" "launch_configuration" {
#!/bin/bash
# Make the Terraform fail if any step throws an error
set -o errexit
# Install Java 11 and wget
sudo yum install wget java-11-amazon-corretto -y
# Install wget
sudo yum install wget -y
# Install Java
if [[ "${var.language_version}" == "8" ]]; then
sudo yum install java-1.8.0-amazon-corretto -y
else
sudo yum install java-${var.language_version}-amazon-corretto -y
fi

# Copy in CW Agent configuration
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
Expand Down Expand Up @@ -186,8 +192,14 @@ resource "null_resource" "remote_service_setup" {
<<-EOF
# Make the Terraform fail if any step throws an error
set -o errexit
# Install Java 11 and wget
sudo yum install wget java-11-amazon-corretto -y
# Install wget
sudo yum install wget -y
# Install Java
if [[ "${var.language_version}" == "8" ]]; then
sudo yum install java-1.8.0-amazon-corretto -y
else
sudo yum install java-${var.language_version}-amazon-corretto -y
fi

# Copy in CW Agent configuration
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
Expand Down
6 changes: 5 additions & 1 deletion terraform/java/ec2/asg/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ variable "canary_type" {
default = "java-ec2-asg"
}

variable "cpu_architecture" {
variable "language_version" {
default = "11"
}

variable "cpu_architecture" {
default = "x86_64"
}
23 changes: 18 additions & 5 deletions terraform/java/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ resource "null_resource" "main_service_setup" {
<<-EOF
# Make the Terraform fail if any step throws an error
set -o errexit
# Install Java 11 and wget
sudo yum install wget java-11-amazon-corretto -y
# Install wget
sudo yum install wget -y
# Install Java
echo
if [[ "${var.language_version}" == "8" ]]; then
sudo yum install java-1.8.0-amazon-corretto -y
else
sudo yum install java-${var.language_version}-amazon-corretto -y
fi

# Copy in CW Agent configuration
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
Expand Down Expand Up @@ -190,8 +197,14 @@ resource "null_resource" "remote_service_setup" {
<<-EOF
# Make the Terraform fail if any step throws an error
set -o errexit
# Install Java 11 and wget
sudo yum install wget java-11-amazon-corretto -y
# Install wget
sudo yum install wget -y
# Install Java
if [[ "${var.language_version}" == "8" ]]; then
sudo yum install java-1.8.0-amazon-corretto -y
else
sudo yum install java-${var.language_version}-amazon-corretto -y
fi

# Copy in CW Agent configuration
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
Expand Down Expand Up @@ -257,7 +270,7 @@ resource "null_resource" "traffic_generator_setup" {
sudo yum install nodejs aws-cli unzip tmux -y

# 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-${var.aws_region}-2/traffic-generator.zip ./traffic-generator.zip
unzip ./traffic-generator.zip -d ./

# Install the traffic generator dependencies
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 @@ -45,6 +45,10 @@ variable "canary_type" {
default = "java-ec2-default"
}

variable "language_version" {
default = "11"
}

variable "cpu_architecture" {
default = "x86_64"
}