Skip to content

Commit c226d8f

Browse files
author
Yuriy Bezsonov
committed
WIP
1 parent 187fd3f commit c226d8f

13 files changed

+209
-129
lines changed

infra/cfn/base-stack.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ Resources:
676676
Fn::GetAtt:
677677
- IdeInstanceLauncherFunction803C5A2A
678678
- Arn
679-
InstanceName: ide
680-
InstanceTypes: m6a.xlarge,m7a.xlarge
679+
ImageId:
680+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
681681
UserData:
682682
Fn::Base64:
683683
Fn::Join:
@@ -814,8 +814,19 @@ Resources:
814814
"
815815
exit 1
816816
fi
817-
ImageId:
818-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
817+
InstanceTypes: m6a.xlarge,m7a.xlarge
818+
InstanceName: ide
819+
IamInstanceProfileArn:
820+
Fn::GetAtt:
821+
- IdeInstanceProfile61B92038
822+
- Arn
823+
VolumeSize: "50"
824+
SubnetIds:
825+
Fn::Join:
826+
- ""
827+
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
828+
- ","
829+
- Ref: VpcPublicSubnet2SubnetA811849C
819830
SecurityGroupIds:
820831
Fn::Join:
821832
- ""
@@ -826,17 +837,6 @@ Resources:
826837
- Fn::GetAtt:
827838
- IdeInternalSecurityGroupB0A5D76B
828839
- GroupId
829-
SubnetIds:
830-
Fn::Join:
831-
- ""
832-
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
833-
- ","
834-
- Ref: VpcPublicSubnet2SubnetA811849C
835-
VolumeSize: "50"
836-
IamInstanceProfileArn:
837-
Fn::GetAtt:
838-
- IdeInstanceProfile61B92038
839-
- Arn
840840
UpdateReplacePolicy: Delete
841841
DeletionPolicy: Delete
842842
IdeEipAssociationDFF81215:

infra/cfn/java-ai-agents-stack.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -760,30 +760,7 @@ Resources:
760760
Fn::GetAtt:
761761
- IdeInstanceLauncherFunction803C5A2A
762762
- Arn
763-
InstanceName: ide
764-
IamInstanceProfileArn:
765-
Fn::GetAtt:
766-
- IdeInstanceProfile61B92038
767-
- Arn
768-
VolumeSize: "50"
769-
SubnetIds:
770-
Fn::Join:
771-
- ""
772-
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
773-
- ","
774-
- Ref: VpcPublicSubnet2SubnetA811849C
775-
SecurityGroupIds:
776-
Fn::Join:
777-
- ""
778-
- - Fn::GetAtt:
779-
- IdeSecurityGroup73B02454
780-
- GroupId
781-
- ","
782-
- Fn::GetAtt:
783-
- IdeInternalSecurityGroupB0A5D76B
784-
- GroupId
785-
ImageId:
786-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
763+
InstanceTypes: m6a.xlarge,m7a.xlarge
787764
UserData:
788765
Fn::Base64:
789766
Fn::Join:
@@ -920,7 +897,30 @@ Resources:
920897
"
921898
exit 1
922899
fi
923-
InstanceTypes: m6a.xlarge,m7a.xlarge
900+
ImageId:
901+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
902+
SecurityGroupIds:
903+
Fn::Join:
904+
- ""
905+
- - Fn::GetAtt:
906+
- IdeSecurityGroup73B02454
907+
- GroupId
908+
- ","
909+
- Fn::GetAtt:
910+
- IdeInternalSecurityGroupB0A5D76B
911+
- GroupId
912+
SubnetIds:
913+
Fn::Join:
914+
- ""
915+
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
916+
- ","
917+
- Ref: VpcPublicSubnet2SubnetA811849C
918+
VolumeSize: "50"
919+
IamInstanceProfileArn:
920+
Fn::GetAtt:
921+
- IdeInstanceProfile61B92038
922+
- Arn
923+
InstanceName: ide
924924
UpdateReplacePolicy: Delete
925925
DeletionPolicy: Delete
926926
IdeEipAssociationDFF81215:

infra/cfn/java-on-amazon-eks-stack.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,6 @@ Resources:
780780
Fn::GetAtt:
781781
- IdeInstanceLauncherFunction803C5A2A
782782
- Arn
783-
IamInstanceProfileArn:
784-
Fn::GetAtt:
785-
- IdeInstanceProfile61B92038
786-
- Arn
787783
InstanceName: ide
788784
InstanceTypes: m6a.xlarge,m7a.xlarge
789785
UserData:
@@ -941,6 +937,10 @@ Resources:
941937
- ","
942938
- Ref: VpcPublicSubnet2SubnetA811849C
943939
VolumeSize: "50"
940+
IamInstanceProfileArn:
941+
Fn::GetAtt:
942+
- IdeInstanceProfile61B92038
943+
- Arn
944944
UpdateReplacePolicy: Delete
945945
DeletionPolicy: Delete
946946
IdeEipAssociationDFF81215:
@@ -1566,7 +1566,7 @@ Resources:
15661566
Fn::GetAtt:
15671567
- CodeBuildStartLambdaFunction8349284F
15681568
- Arn
1569-
ContentHash: "1766936461750"
1569+
ContentHash: "1766939994295"
15701570
CodeBuildIamRoleArn:
15711571
Fn::GetAtt:
15721572
- CodeBuildRoleE9A44575
@@ -1884,7 +1884,7 @@ Resources:
18841884
- Ref: AWS::AccountId
18851885
- "-"
18861886
- Ref: AWS::Region
1887-
- "-20251228164101"
1887+
- "-20251228173954"
18881888
PublicAccessBlockConfiguration:
18891889
BlockPublicAcls: true
18901890
BlockPublicPolicy: true

infra/cfn/java-on-aws-immersion-day-stack.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,16 @@ Resources:
780780
Fn::GetAtt:
781781
- IdeInstanceLauncherFunction803C5A2A
782782
- Arn
783+
SecurityGroupIds:
784+
Fn::Join:
785+
- ""
786+
- - Fn::GetAtt:
787+
- IdeSecurityGroup73B02454
788+
- GroupId
789+
- ","
790+
- Fn::GetAtt:
791+
- IdeInternalSecurityGroupB0A5D76B
792+
- GroupId
783793
ImageId:
784794
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
785795
UserData:
@@ -931,16 +941,6 @@ Resources:
931941
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
932942
- ","
933943
- Ref: VpcPublicSubnet2SubnetA811849C
934-
SecurityGroupIds:
935-
Fn::Join:
936-
- ""
937-
- - Fn::GetAtt:
938-
- IdeSecurityGroup73B02454
939-
- GroupId
940-
- ","
941-
- Fn::GetAtt:
942-
- IdeInternalSecurityGroupB0A5D76B
943-
- GroupId
944944
UpdateReplacePolicy: Delete
945945
DeletionPolicy: Delete
946946
IdeEipAssociationDFF81215:
@@ -1566,13 +1566,13 @@ Resources:
15661566
Fn::GetAtt:
15671567
- CodeBuildStartLambdaFunction8349284F
15681568
- Arn
1569-
ContentHash: "1766936453048"
1570-
ProjectName:
1571-
Ref: CodeBuildProjectA0FF5539
15721569
CodeBuildIamRoleArn:
15731570
Fn::GetAtt:
15741571
- CodeBuildRoleE9A44575
15751572
- Arn
1573+
ContentHash: "1766939986165"
1574+
ProjectName:
1575+
Ref: CodeBuildProjectA0FF5539
15761576
DependsOn:
15771577
- CodeBuildCompleteRuleAllowEventRuleWorkshopStackCodeBuildReportLambdaFunctionD77C60919E0B0C89
15781578
- CodeBuildCompleteRuleEE9277E8
@@ -1884,7 +1884,7 @@ Resources:
18841884
- Ref: AWS::AccountId
18851885
- "-"
18861886
- Ref: AWS::Region
1887-
- "-20251228164053"
1887+
- "-20251228173946"
18881888
PublicAccessBlockConfiguration:
18891889
BlockPublicAcls: true
18901890
BlockPublicPolicy: true

infra/cfn/java-spring-ai-agents-stack.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -760,29 +760,7 @@ Resources:
760760
Fn::GetAtt:
761761
- IdeInstanceLauncherFunction803C5A2A
762762
- Arn
763-
IamInstanceProfileArn:
764-
Fn::GetAtt:
765-
- IdeInstanceProfile61B92038
766-
- Arn
767-
VolumeSize: "50"
768-
SubnetIds:
769-
Fn::Join:
770-
- ""
771-
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
772-
- ","
773-
- Ref: VpcPublicSubnet2SubnetA811849C
774-
SecurityGroupIds:
775-
Fn::Join:
776-
- ""
777-
- - Fn::GetAtt:
778-
- IdeSecurityGroup73B02454
779-
- GroupId
780-
- ","
781-
- Fn::GetAtt:
782-
- IdeInternalSecurityGroupB0A5D76B
783-
- GroupId
784-
ImageId:
785-
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
763+
InstanceTypes: m6a.xlarge,m7a.xlarge
786764
UserData:
787765
Fn::Base64:
788766
Fn::Join:
@@ -919,7 +897,29 @@ Resources:
919897
"
920898
exit 1
921899
fi
922-
InstanceTypes: m6a.xlarge,m7a.xlarge
900+
ImageId:
901+
Ref: SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter
902+
SecurityGroupIds:
903+
Fn::Join:
904+
- ""
905+
- - Fn::GetAtt:
906+
- IdeSecurityGroup73B02454
907+
- GroupId
908+
- ","
909+
- Fn::GetAtt:
910+
- IdeInternalSecurityGroupB0A5D76B
911+
- GroupId
912+
SubnetIds:
913+
Fn::Join:
914+
- ""
915+
- - Ref: VpcPublicSubnet1Subnet8E8DEDC0
916+
- ","
917+
- Ref: VpcPublicSubnet2SubnetA811849C
918+
VolumeSize: "50"
919+
IamInstanceProfileArn:
920+
Fn::GetAtt:
921+
- IdeInstanceProfile61B92038
922+
- Arn
923923
InstanceName: ide
924924
UpdateReplacePolicy: Delete
925925
DeletionPolicy: Delete

infra/scripts/setup/analysis.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ THREAD_THRESHOLD=200
3131

3232
# Profiling Analysis config
3333
HTTP_DASHBOARD_TITLE="HTTP Metrics"
34-
PROFILING_CONTACT_POINT="jvm-analysis-webhook"
34+
PROFILING_CONTACT_POINT="ai-jvm-analyzer-webhook"
3535
PROFILING_ALERT_TITLE="High HTTP Rate"
3636
REQUESTS_THRESHOLD=20
3737

@@ -495,7 +495,7 @@ CONTACT_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" \
495495
\"name\": \"$PROFILING_CONTACT_POINT\",
496496
\"type\": \"webhook\",
497497
\"settings\": {
498-
\"url\": \"http://jvm-analysis-service.monitoring.svc.cluster.local/webhook\",
498+
\"url\": \"http://ai-jvm-analyzer.monitoring.svc.cluster.local/webhook\",
499499
\"httpMethod\": \"POST\"
500500
},
501501
\"disableResolveMessage\": true
@@ -631,7 +631,7 @@ log_info ""
631631
log_info "Profiling Analysis:"
632632
log_info " Dashboard: $HTTP_DASHBOARD_TITLE"
633633
log_info " Alert: $PROFILING_ALERT_TITLE (threshold: $REQUESTS_THRESHOLD req/s)"
634-
log_info " Webhook: http://jvm-analysis-service.monitoring.svc.cluster.local/webhook"
634+
log_info " Webhook: http://ai-jvm-analyzer.monitoring.svc.cluster.local/webhook"
635635
log_info ""
636636
log_info "Grafana: http://$GRAFANA_LB"
637637
log_info "Username: $GRAFANA_USER"

infra/scripts/test/benchmark.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#bin/sh
2+
3+
# Check if URL parameter is provided
4+
if [ -z "$1" ]; then
5+
echo "Error: URL parameter is required"
6+
echo "Usage: $0 <service-url> [duration] [arrival-rate]"
7+
exit 1
8+
fi
9+
10+
# Check if URL starts with http:// or https://
11+
if ! echo "$1" | grep -q "^http" ; then
12+
echo "Error: URL must start with http:// or https://"
13+
echo "Provided URL: $1"
14+
exit 1
15+
fi
16+
17+
SVC_URL=$1
18+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
19+
20+
if [ -n "$2" ] && [ -n "$3" ]
21+
then
22+
artillery run --overrides "{\"config\": { \"phases\": [{ \"duration\": $2, \"arrivalRate\": $3 }] } }" \
23+
-t $SVC_URL -v '{ "url": "/unicorns" }' "$SCRIPT_DIR/benchmark.yaml"
24+
else
25+
artillery run \
26+
-t $SVC_URL -v '{ "url": "/unicorns" }' "$SCRIPT_DIR/benchmark.yaml"
27+
fi

infra/scripts/test/benchmark.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
config:
2+
phases:
3+
- duration: 60
4+
arrivalRate: 25
5+
http:
6+
timeout: 29
7+
scenarios:
8+
- flow:
9+
- post:
10+
url: "{{ url }}"
11+
json:
12+
name: "Big Unicorn"
13+
age: "Quite old"
14+
type: "Beautiful"
15+
size: "Very big"

infra/scripts/test/getsvcurl.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#bin/sh
2+
3+
# Check if parameter is provided
4+
if [ -z "$1" ]; then
5+
echo "Error: Compute target parameter is required"
6+
echo "Usage: $0 <compute-target>"
7+
echo "Valid compute targets: apprunner, ecs, eks, lambda, local"
8+
exit 1
9+
fi
10+
11+
COMPUTE=$1
12+
13+
SVC_URL=""
14+
15+
if [ "$COMPUTE" = "apprunner" ]; then
16+
SVC_URL=https://$(aws apprunner list-services --query "ServiceSummaryList[?ServiceName == 'unicorn-store-spring'].ServiceUrl" --output text)
17+
elif [ "$COMPUTE" = "ecs" ]; then
18+
SVC_URL=http://$(aws elbv2 describe-load-balancers --names unicorn-store-spring --query "LoadBalancers[0].DNSName" --output text)
19+
elif [ "$COMPUTE" = "eks" ]; then
20+
SVC_URL=http://$(kubectl get ingress unicorn-store-spring -n unicorn-store-spring -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
21+
elif [ "$COMPUTE" = "lambda" ]; then
22+
REST_API_ID=$(aws apigateway get-rest-apis --query 'items[?name==`unicorn-store-spring-api`].[id]' --output text)
23+
STAGE=$(aws apigateway get-stages --rest-api-id $REST_API_ID --query 'item[].stageName' --output text)
24+
SVC_URL=https://$REST_API_ID.execute-api.$AWS_REGION.amazonaws.com/$STAGE
25+
elif [ "$COMPUTE" = "local" ]; then
26+
SVC_URL="http://localhost:8080"
27+
fi
28+
29+
# Check if URL was successfully set
30+
if [ -z "$SVC_URL" ]; then
31+
echo "Error: Failed to retrieve service URL for compute target '$COMPUTE'"
32+
exit 1
33+
fi
34+
35+
echo $SVC_URL

0 commit comments

Comments
 (0)