Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/dotnet-ec2-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
aws-region: ${{ matrix.aws-region }}
caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test'
dotnet-version: '8.0'
cpu-architecture: 'x86_64'

nuget:
strategy:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/dotnet-ec2-default-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
dotnet-version:
required: true
type: string
cpu-architecture:
required: false
type: string
default: "x86_64"

permissions:
id-token: write
Expand All @@ -30,6 +34,7 @@ jobs:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
dotnet-version: ${{ inputs.dotnet-version }}
cpu-architecture: ${{ inputs.cpu-architecture }}

dotnet-ec2-default-attempt-2:
needs: [ dotnet-ec2-default-attempt-1 ]
Expand All @@ -40,6 +45,7 @@ jobs:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
dotnet-version: ${{ inputs.dotnet-version }}
cpu-architecture: ${{ inputs.cpu-architecture }}

publish-metric-attempt-1:
needs: [ dotnet-ec2-default-attempt-1, dotnet-ec2-default-attempt-2 ]
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/dotnet-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ on:
required: false
type: string
default: '8.0'
cpu-architecture:
description: "Permitted values: x86_64 or arm64"
required: false
type: string
default: "x86_64"
outputs:
job-started:
value: ${{ jobs.dotnet-ec2-default.outputs.job-started }}
Expand All @@ -38,6 +43,7 @@ env:
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
DOTNET_VERSION: ${{ inputs.dotnet-version }}
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app-${{ inputs.dotnet-version }}.zip
METRIC_NAMESPACE: ApplicationSignals
LOG_GROUP_NAME: /aws/application-signals/data
Expand Down Expand Up @@ -100,7 +106,11 @@ jobs:
echo GET_ADOT_DISTRO_COMMAND="aws s3 cp s3://adot-autoinstrumentation-dotnet-staging/${{ env.ADOT_DISTRO_NAME }} ./${{ env.ADOT_DISTRO_NAME }} && unzip -d dotnet-distro ${{ env.ADOT_DISTRO_NAME }}" >> $GITHUB_ENV
else
# After Release will switch to latest tag instead of hard code version for canary purpose
echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" >> $GITHUB_ENV
if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then
echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" >> $GITHUB_ENV
elif [ "${{ env.CPU_ARCHITECTURE }}" = "arm64" ]; then
echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip" >> $GITHUB_ENV
fi
fi

- name: Set Get CW Agent command environment variable
Expand All @@ -109,8 +119,11 @@ jobs:
# Get cloudwatch agent staging file if triggered by cw-a repo
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
# Otherwise get latest release version
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-${{ env.E2E_TEST_AWS_REGION }}.s3.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
elif [ "${{ env.CPU_ARCHITECTURE }}" = "arm64" ]; then
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/arm64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
fi
fi

- name: Set up terraform
Expand Down Expand Up @@ -148,6 +161,7 @@ jobs:
-var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
-var="get_adot_distro_command=${{ env.GET_ADOT_DISTRO_COMMAND }}" \
-var="language_version=${{ env.DOTNET_VERSION }}" \
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
|| deployment_failed=$?

if [ $deployment_failed -eq 1 ]; then
Expand Down
20 changes: 14 additions & 6 deletions terraform/dotnet/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.small"
instance_type = var.cpu_architecture == "x86_64" ? "t3.small" : "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 @@ -144,7 +144,11 @@ resource "null_resource" "main_service_setup" {
dotnet build
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
if [ "${var.cpu_architecture}" == "arm64" ]; then
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so
else
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
fi
export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps
export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store
export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
Expand Down Expand Up @@ -187,7 +191,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.small"
instance_type = var.cpu_architecture == "x86_64" ? "t3.small" : "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 @@ -252,7 +256,11 @@ resource "null_resource" "remote_service_setup" {
dotnet build
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
if [ "${var.cpu_architecture}" == "arm64" ]; then
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so
else
export CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
fi
export DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps
export DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store
export DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
Expand Down
4 changes: 4 additions & 0 deletions terraform/dotnet/ec2/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ variable "canary_type" {

variable "language_version" {
default = "8.0"
}

variable "cpu_architecture" {
default = "x86_64"
}
Loading