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

EC2 default test with new sample apps deployment #348

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
1 change: 1 addition & 0 deletions .github/workflows/dotnet-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-dotnet-e2e-ec2-canary-test'
dotnet-version: '8.0'

nuget:
strategy:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dotnet-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
dotnet-version:
required: true
type: string

permissions:
id-token: write
Expand All @@ -26,6 +29,7 @@ jobs:
with:
aws-region: ${{ inputs.aws-region }}
caller-workflow-name: ${{ inputs.caller-workflow-name }}
dotnet-version: ${{ inputs.dotnet-version }}

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

publish-metric-attempt-1:
needs: [ dotnet-ec2-default-attempt-1, dotnet-ec2-default-attempt-2 ]
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/dotnet-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
caller-workflow-name:
required: true
type: string
dotnet-version:
description: "Currently support version 6.0, 8.0"
required: false
type: string
default: '8.0'
outputs:
job-started:
value: ${{ jobs.dotnet-ec2-default.outputs.job-started }}
Expand All @@ -32,7 +37,8 @@ env:
E2E_TEST_AWS_REGION: ${{ inputs.aws-region }}
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/dotnet-sample-app.zip
DOTNET_VERSION: ${{ inputs.dotnet-version }}
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
ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }}
Expand Down Expand Up @@ -141,6 +147,7 @@ jobs:
-var="sample_app_zip=${{ env.SAMPLE_APP_ZIP }}" \
-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 }}" \
|| 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 @@ -116,7 +116,11 @@ resource "null_resource" "main_service_setup" {
sudo yum install -y wget
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo
sudo dnf install -y dotnet-sdk-8.0
if [[ "${var.language_version}" == "8.0" ]]; then
sudo dnf install -y dotnet-sdk-8.0
else
sudo dnf install -y dotnet-sdk-6.0
fi
majanjua-amzn marked this conversation as resolved.
Show resolved Hide resolved
sudo yum install unzip -y

# Copy in CW Agent configuration
Expand All @@ -141,6 +145,7 @@ resource "null_resource" "main_service_setup" {

# Export environment variables for instrumentation
cd ./asp_frontend_service
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
Expand All @@ -158,8 +163,7 @@ resource "null_resource" "main_service_setup" {
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_TRACES_SAMPLER=always_on
export ASPNETCORE_URLS=http://0.0.0.0:8080
dotnet build
nohup dotnet bin/Debug/netcoreapp8.0/asp_frontend_service.dll &
nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_frontend_service.dll &

# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
Expand Down Expand Up @@ -224,7 +228,11 @@ resource "null_resource" "remote_service_setup" {
sudo yum install -y wget
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo
sudo dnf install -y dotnet-sdk-8.0
if [[ "${var.language_version}" == "8.0" ]]; then
sudo dnf install -y dotnet-sdk-8.0
else
sudo dnf install -y dotnet-sdk-6.0
fi
majanjua-amzn marked this conversation as resolved.
Show resolved Hide resolved
sudo yum install unzip -y

# Copy in CW Agent configuration
Expand All @@ -249,6 +257,7 @@ resource "null_resource" "remote_service_setup" {

# Export environment variables for instrumentation
cd ./asp_remote_service
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
Expand All @@ -266,8 +275,7 @@ resource "null_resource" "remote_service_setup" {
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_TRACES_SAMPLER=always_on
export ASPNETCORE_URLS=http://0.0.0.0:8081
dotnet build
nohup dotnet bin/Debug/netcoreapp8.0/asp_remote_service.dll &
nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_remote_service.dll &

# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
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 @@ -39,4 +39,8 @@ variable "get_cw_agent_rpm_command" {

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

variable "language_version" {
default = "8.0"
}
Loading