Skip to content

Commit e1c3c1b

Browse files
committed
Merge remote-tracking branch 'origin/genesis-release-test-p2' into genesis-release-test
2 parents 331f7b7 + a2c24a6 commit e1c3c1b

File tree

7 files changed

+34
-56
lines changed

7 files changed

+34
-56
lines changed

.github/workflows/node-k8s-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ jobs:
9494
NODE_REMOTE_SAMPLE_APP_IMAGE, e2e-test/node-remote-sample-app-image
9595
RELEASE_TESTING_ECR_ACCOUNT, e2e-test/${{ github.event.repository.name }}/node-k8s-release-testing-account
9696
97+
# Temporarily use Java K8s Canary Cluster for Node.js e2e tests
9798
- name: Retrieve K8s EC2 Secrets
9899
if: ${{ env.CALLER_WORKFLOW_NAME != 'k8s-os-patching' }}
99100
uses: aws-actions/aws-secretsmanager-get-secrets@v1
100101
with:
102+
# secret-ids: |
103+
# MAIN_SERVICE_ENDPOINT, e2e-test/${{ github.event.repository.name }}/node-k8s-master-node-endpoint
104+
# MASTER_NODE_SSH_KEY, e2e-test/${{ github.event.repository.name }}/node-k8s-ssh-key
101105
secret-ids: |
102-
MAIN_SERVICE_ENDPOINT, e2e-test/${{ github.event.repository.name }}/node-k8s-master-node-endpoint
103-
MASTER_NODE_SSH_KEY, e2e-test/${{ github.event.repository.name }}/node-k8s-ssh-key
106+
MAIN_SERVICE_ENDPOINT, e2e-test/aws-application-signals-test-framework/java-k8s-master-node-endpoint
107+
MASTER_NODE_SSH_KEY, e2e-test/aws-application-signals-test-framework/java-k8s-ssh-key
104108
105109
- name: Retrieve K8s EC2 OS Patching Secrets
106110
if: ${{ env.CALLER_WORKFLOW_NAME == 'k8s-os-patching' }}

.github/workflows/python-ec2-genai-test.yml

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@
44
name: Python EC2 Gen AI Use Case
55
on:
66
workflow_dispatch: # be able to run the workflow on demand
7-
push:
8-
branches:
9-
- genesis-release-test
107
workflow_call:
118
inputs:
129
caller-workflow-name:
1310
required: true
1411
type: string
15-
python-version:
16-
description: "Currently support version 3.9, 3.10, 3.11, 3.12, 3.13"
17-
required: false
18-
type: string
19-
default: '3.12'
20-
cpu-architecture:
21-
description: "Permitted values: x86_64 or arm64"
22-
required: false
23-
type: string
24-
default: "x86_64"
2512
staging-wheel-name:
2613
required: false
2714
default: 'aws-opentelemetry-distro'
@@ -35,8 +22,7 @@ env:
3522
E2E_TEST_AWS_REGION: 'us-west-2'
3623
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
3724
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
38-
ADOT_WHEEL_NAME: aws-opentelemetry-distro
39-
PYTHON_VERSION: 3.12
25+
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
4026
METRIC_NAMESPACE: genesis
4127
LOG_GROUP_NAME: test/genesis
4228
TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE}
@@ -50,18 +36,18 @@ jobs:
5036
- uses: actions/checkout@v4
5137

5238
- name: Set Get ADOT Wheel command environment variable
53-
run: echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
54-
# if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then
55-
# # Reusing the adot-main-build-staging-jar bucket to store the python wheel file
56-
# echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
57-
# elif [ "${{ env.OTEL_SOURCE }}" == "pypi" ]; then
58-
# echo GET_ADOT_WHEEL_COMMAND="python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
59-
# else
60-
# latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
61-
# echo "The latest version is $latest_release_version"
62-
# echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \
63-
# && python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
64-
# fi
39+
run: |
40+
if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then
41+
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
42+
echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && python3.12 -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
43+
elif [ "${{ env.OTEL_SOURCE }}" == "pypi" ]; then
44+
echo GET_ADOT_WHEEL_COMMAND="python3.12 -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
45+
else
46+
latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
47+
echo "The latest version is $latest_release_version"
48+
echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \
49+
&& python3.12 -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
50+
fi
6551
6652
- name: Initiate Gradlew Daemon
6753
uses: ./.github/workflows/actions/execute_and_retry
@@ -119,7 +105,6 @@ jobs:
119105
-var="service_zip_url=${{ env.SAMPLE_APP_ZIP }}" \
120106
-var="trace_id=${{ env.TRACE_ID_HEADER }}" \
121107
-var="get_adot_wheel_command=${{ env.GET_ADOT_WHEEL_COMMAND }}" \
122-
-var="python_version=${{ env.PYTHON_VERSION }}"
123108
124109
- name: Get deployment info
125110
working-directory: terraform/python/ec2/adot-genai
@@ -152,12 +137,6 @@ jobs:
152137
--instance-id ${{ env.INSTANCE_ID }}
153138
--trace-id ${{ env.XRAY_TRACE_ID }}'
154139

155-
- name: Wait for metrics to be published
156-
if: (success() || failure()) && !cancelled()
157-
run: |
158-
echo "Waiting 60 seconds to ensure EMF metrics are published to CloudWatch"
159-
sleep 60
160-
161140
- name: Validate generated metrics
162141
if: (success() || failure()) && !cancelled()
163142
run: ./gradlew validator:run --args='-c python/ec2/adot-genai/metric-validation.yml

sample-apps/python/genai_service/ec2-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ openlit
1010
botocore
1111
setuptools
1212
boto3
13-
aws_opentelemetry_distro_genai_beta
13+
aws_opentelemetry_distro
1414
fastapi
1515
uvicorn[standard]

terraform/python/ec2/adot-genai/main.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ data "aws_ami" "ami" {
3737
most_recent = true
3838
filter {
3939
name = "name"
40-
values = ["al2023-ami-*-${var.cpu_architecture}"]
40+
values = ["al2023-ami-*-x86_64"]
4141
}
4242
filter {
4343
name = "state"
4444
values = ["available"]
4545
}
4646
filter {
4747
name = "architecture"
48-
values = [var.cpu_architecture]
48+
values = ["x86_64"]
4949
}
5050
filter {
5151
name = "virtualization-type"
@@ -55,7 +55,7 @@ data "aws_ami" "ami" {
5555

5656
resource "aws_instance" "main_service_instance" {
5757
ami = data.aws_ami.ami.id
58-
instance_type = var.cpu_architecture == "x86_64" ? "t3.medium" : "t4g.medium"
58+
instance_type = "t3.medium"
5959
key_name = local.ssh_key_name
6060
iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE"
6161
vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id]
@@ -73,20 +73,20 @@ resource "aws_instance" "main_service_instance" {
7373
user_data = base64encode(<<-EOF
7474
#!/bin/bash
7575
yum update -y
76-
yum install -y python${var.python_version} python${var.python_version}-pip unzip bc
76+
yum install -y python3.12 python3.12-pip unzip bc
7777
7878
mkdir -p /app
7979
cd /app
8080
aws s3 cp ${var.service_zip_url} genai-service.zip
8181
unzip genai-service.zip
8282
8383
# Having issues installing dependencies from ec2-requirements.txt as these dependencies are quite large and cause timeouts/memory issues on EC2, manually installing instead
84-
python${var.python_version} -m pip install fastapi uvicorn[standard] --no-cache-dir
85-
python${var.python_version} -m pip install boto3 botocore setuptools --no-cache-dir
86-
python${var.python_version} -m pip install opentelemetry-api opentelemetry-sdk opentelemetry-semantic-conventions --no-cache-dir
87-
python${var.python_version} -m pip install langchain langchain-community langchain_aws --no-cache-dir
88-
python${var.python_version} -m pip install python-dotenv openlit --no-cache-dir
89-
python${var.python_version} -m pip install openinference-instrumentation-langchain --no-cache-dir
84+
python3.12 -m pip install fastapi uvicorn[standard] --no-cache-dir
85+
python3.12 -m pip install boto3 botocore setuptools --no-cache-dir
86+
python3.12 -m pip install opentelemetry-api opentelemetry-sdk opentelemetry-semantic-conventions --no-cache-dir
87+
python3.12 -m pip install langchain langchain-community langchain_aws --no-cache-dir
88+
python3.12 -m pip install python-dotenv openlit --no-cache-dir
89+
python3.12 -m pip install openinference-instrumentation-langchain --no-cache-dir
9090
${var.get_adot_wheel_command}
9191
9292
export AWS_REGION=${var.aws_region}
@@ -97,7 +97,7 @@ export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-aws-log-group=test/genesis,x-aws-log-s
9797
export OTEL_RESOURCE_ATTRIBUTES="service.name=langchain-traceloop-app"
9898
export AGENT_OBSERVABILITY_ENABLED="true"
9999
100-
nohup opentelemetry-instrument python${var.python_version} server.py > /var/log/langchain-service.log 2>&1 &
100+
nohup opentelemetry-instrument python3.12 server.py > /var/log/langchain-service.log 2>&1 &
101101
102102
# Wait for service to be ready
103103
echo "Waiting for service to be ready..."

terraform/python/ec2/adot-genai/variables.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ variable "service_zip_url" {
2525
description = "S3 URL for the service zip file"
2626
}
2727

28-
variable "python_version" {
29-
default = "3.12"
30-
}
3128

32-
variable "cpu_architecture" {
33-
default = "x86_64"
34-
}
29+
30+
3531

3632
variable "user" {
3733
default = "ec2-user"

validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public void validate() throws Exception {
9292
maxRetryCount,
9393
() -> {
9494
String httpPath = validationConfig.getHttpPath();
95-
9695
// Special handling for Genesis path - just check if any metrics exists in namespace
9796
// since ADOT will just capture any OTel Metrics emitted from the instrumentation library used
9897
// and convert them into EMF metrics, it's impossible to create a validation template for this.

validator/src/main/java/com/amazon/aoc/validators/TraceValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private Map<String, Object> getTrace() throws Exception {
148148
validationConfig.getHttpPath()));
149149
}
150150

151-
if (validationConfig.getHttpPath().contains("ai-chat")) {
151+
if (validationConfig.getHttpPath() != null && validationConfig.getHttpPath().contains("ai-chat")) {
152152
return this.getTraceById(Collections.singletonList(context.getTraceId()));
153153
}
154154

0 commit comments

Comments
 (0)