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

Add GPU image and instance types to the main template #284

Merged
merged 7 commits into from
Mar 15, 2024
Merged
Changes from all 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
45 changes: 42 additions & 3 deletions cloudformation/antmedia-aws-autoscale-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ Parameters:
- r3.2xlarge
- r3.4xlarge
- r3.8xlarge
- p2.xlarge
- p2.8xlarge
- p2.16xlarge
- p3.2xlarge
- p3.8xlarge
- p3.16xlarge
- p3dn.24xlarge
- g4dn.xlarge
- g4dn.2xlarge
- g4dn.4xlarge
- g4dn.8xlarge
- g4dn.12xlarge
- g4dn.16xlarge
- g5.xlarge
- g5.2xlarge
- g5.4xlarge
- g5.8xlarge
- g5.12xlarge
- g5.16xlarge
ConstraintDescription: must be a valid EC2 instance type.

MongoDBInstanceType:
Expand Down Expand Up @@ -232,11 +251,22 @@ Parameters:
Type: String
Default: ''
DiskSize:
Default: '10'
Default: '16'
Description: Disk size of instances
Type: Number
MinValue: '10'
MinValue: '16'
MaxValue: '1000'
GPUImage:
Description: Select "true" to use GPU Image in Origin Cluster. You must select one of the g and p instance types.
Default: false
Type: String
AllowedValues:
- true
- false
Conditions:
UseGPUImage: !Equals
- !Ref GPUImage
- true

Resources:
DescribeImagesRole:
Expand Down Expand Up @@ -336,6 +366,15 @@ Resources:
Name: "AntMedia-AWS-Marketplace-EE-*"
Architecture: "x86_64"

AntMediaGPUAmi:
Condition: UseGPUImage
Type: Custom::FindAMI
Properties:
ServiceToken: !Sub ${AMSGetLatestAMI.Arn}
ProductId: "8kf9kapq2qbo37fuekp8k7o6r"
Name: "AntMedia-AWS-Marketplace-GPU-*"
Architecture: "x86_64"

UbuntuAmi:
Type: Custom::FindAMI
Properties:
Expand Down Expand Up @@ -518,7 +557,7 @@ Resources:
LaunchTemplateData:
InstanceType: !Ref OriginInstanceType
KeyName: !Ref KeyName
ImageId: !Ref AntMediaAmi
ImageId: !If [UseGPUImage, !Ref AntMediaGPUAmi, !Ref AntMediaAmi]
SecurityGroupIds:
- !GetAtt "InstanceSecurityGroup.GroupId"
BlockDeviceMappings:
Expand Down
Loading