Skip to content

Commit

Permalink
Merge pull request #789 from mjura/gpu-main
Browse files Browse the repository at this point in the history
Update default AMI types for Nvidia GPU
  • Loading branch information
mjura committed Aug 28, 2024
2 parents b7c6687 + dbe9eca commit 5746bbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions controller/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ func BuildUpstreamClusterState(ctx context.Context, name, managedTemplateID stri
ngToAdd.Ec2SshKey = ng.Nodegroup.RemoteAccess.Ec2SshKey
}
}
// TODO: Update AMITypesAl2X8664Gpu to Amazon Linux 2023 when it is available
// Issue https://github.com/rancher/eks-operator/issues/568
if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2X8664Gpu {

if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2023X8664Nvidia {
ngToAdd.Gpu = aws.Bool(true)
} else if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2023X8664Standard {
ngToAdd.Gpu = aws.Bool(false)
Expand Down
2 changes: 1 addition & 1 deletion pkg/eks/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func CreateNodeGroup(ctx context.Context, opts *CreateNodeGroupOptions) (string,
} else if arm := opts.NodeGroup.Arm; aws.ToBool(arm) {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2023Arm64Standard
} else if gpu := opts.NodeGroup.Gpu; aws.ToBool(gpu) {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2X8664Gpu
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2023X8664Nvidia
} else {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2023X8664Standard
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/eks/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ var _ = Describe("CreateNodeGroup", func() {
InstanceTypes: createNodeGroupOpts.NodeGroup.SpotInstanceTypes,
Subnets: createNodeGroupOpts.NodeGroup.Subnets,
NodeRole: aws.String("test"),
AmiType: ekstypes.AMITypesAl2X8664Gpu,
AmiType: ekstypes.AMITypesAl2023X8664Nvidia,
}).Return(nil, nil)

launchTemplateVersion, generatedNodeRole, err := CreateNodeGroup(ctx, createNodeGroupOpts)
Expand Down

0 comments on commit 5746bbc

Please sign in to comment.