Skip to content

Commit e138134

Browse files
authored
Add support for AL2023 arm64 nvidia amiType (#8351)
1 parent a235ee1 commit e138134

File tree

11 files changed

+126
-106
lines changed

11 files changed

+126
-106
lines changed

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ require (
1111
github.com/aws/aws-sdk-go-v2 v1.36.3
1212
github.com/aws/aws-sdk-go-v2/config v1.29.12
1313
github.com/aws/aws-sdk-go-v2/credentials v1.17.65
14-
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.2
15-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.1
14+
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3
15+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2
1616
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3
17-
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.2
17+
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3
1818
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3
1919
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1
20-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1
20+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0
2121
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2
2222
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.1
2323
github.com/aws/aws-sdk-go-v2/service/iam v1.41.1

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,20 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d
124124
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
125125
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.33 h1:/frG8aV09yhCVSOEC2pzktflJJO48NwY3xntHBwxHiA=
126126
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.33/go.mod h1:8vwASlAcV366M+qxZnjNzCjeastk1Rt1bpSRaGZanGU=
127-
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.2 h1:OA5uEC/SrjRLhNGHgF/iS6YQz1bjlrCje9sERyLlGro=
128-
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.2/go.mod h1:CDqMoc3KRdZJ8qziW96J35lKH01Wq3B2aihtHj2JbRs=
129-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.1 h1:VaXjN6szl50hbLMfSOKBKl3bEOb805aHe8j1yv0fKhU=
130-
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.1/go.mod h1:penaZKzGmqHGZId4EUCBIW/f9l4Y7hQ5NKd45yoCYuI=
127+
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3 h1:QsKdBxtC8csnKt5BbV7D1op4Nf13p2YkTJIkppaCakw=
128+
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3/go.mod h1:CDqMoc3KRdZJ8qziW96J35lKH01Wq3B2aihtHj2JbRs=
129+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2 h1:o9cuZdZlI9VWMqsNa2mnf2IRsFAROHnaYA1BW3lHGuY=
130+
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2/go.mod h1:penaZKzGmqHGZId4EUCBIW/f9l4Y7hQ5NKd45yoCYuI=
131131
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3 h1:nTKHvvDTsS6SqAqu/fDhpmbNmDz+0ONh8niPoCkhPtM=
132132
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3/go.mod h1:/BibEr5ksr34abqBTQN213GrNG6GCKCB6WG7CH4zH2w=
133-
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.2 h1:caIDFGKezQQA/kali05x3NF2DVwzjtOFjvNvFnEeCm4=
134-
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.2/go.mod h1:uo14VBn5cNk/BPGTPz3kyLBxgpgOObgO8lmz+H7Z4Ck=
133+
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3 h1:3y0jkGtsaZLCg+n73BoSXOAkLFtgmD/+4prXW1pzovc=
134+
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3/go.mod h1:uo14VBn5cNk/BPGTPz3kyLBxgpgOObgO8lmz+H7Z4Ck=
135135
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3 h1:4U9dpQZTvJ0Mi1qn8L1hRJ4igFCQYEjwUuOmYkWM5tE=
136136
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3/go.mod h1:ygltZT++6Wn2uG4+tqE0NW1MkdEtb5W2O/CFc0xJX/g=
137137
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1 h1:+4A9SDduLZFlDeXWRmfQ6r8kyEJZQfK6lcg+KwdvWrI=
138138
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1/go.mod h1:ouvGEfHbLaIlWwpDpOVWPWR+YwO0HDv3vm5tYLq8ImY=
139-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1 h1:oI4AHf3K7cA+ukczcNwYsE8A7trMQiTRZTsgfkSS9BE=
140-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
139+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0 h1:EYeOThTRysemFtC6J6h6b7dNg3jN03QuO5cg92ojIQE=
140+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
141141
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2 h1:Zlfmpg4QsduBeiK0vTc8WjnHZoYVGe64FcwuCsipjWE=
142142
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2/go.mod h1:H232HdqVlSUoqy0cMJYW1TKjcxvGFGFZ20xQG8fOAPw=
143143
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.1 h1:USXR7nfl+bu7HnR/M3KtnPD3wjlCXM72kYX+2PaIgEI=

pkg/ami/ssm_resolver.go

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ func MakeManagedSSMParameterName(version string, amiType ekstypes.AMITypes) stri
115115
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/x86_64/neuron/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
116116
case ekstypes.AMITypesAl2023Arm64Standard:
117117
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/arm64/standard/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
118+
case ekstypes.AMITypesAl2023Arm64Nvidia:
119+
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/arm64/nvidia/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
118120
case ekstypes.AMITypesAl2X8664:
119121
return makeAL2ParameterName("")
120122
case ekstypes.AMITypesAl2X8664Gpu:

pkg/ami/ssm_resolver_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,6 @@ var _ = Describe("AMI Auto Resolution", func() {
757757
var eksAMIType ekstypes.AMITypes
758758
for _, amiType := range eksAMIType.Values() {
759759
if amiType == ekstypes.AMITypesCustom || strings.HasPrefix(string(amiType), "WINDOWS_") ||
760-
// TODO: remove this condition after adding support for AL2023 Nvidia and Neuron AMI types.
761-
amiType == ekstypes.AMITypesAl2023X8664Nvidia || amiType == ekstypes.AMITypesAl2023X8664Neuron ||
762760
// TODO: remove this condition after support for Bottlerocket FIPS AMI types.
763761
amiType == ekstypes.AMITypesBottlerocketArm64Fips || amiType == ekstypes.AMITypesBottlerocketX8664Fips {
764762
continue
+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package v1alpha5
2+
3+
import (
4+
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
5+
instanceutils "github.com/weaveworks/eksctl/pkg/utils/instance"
6+
)
7+
8+
// GetAMIType returns the most appropriate amiType for the amiFamily and
9+
// instanceType provided. Parameter `strict` controls whether or not fallbacks
10+
// should be applied when searching for specialized amiTypes (eg. accerated
11+
// instance types). If `strict` is false a fallback may be applied, otherwise a
12+
// valid value is not guaranteed to be returned (empty string).
13+
func GetAMIType(amiFamily, instanceType string, strict bool) ekstypes.AMITypes {
14+
amiTypeMapping := map[string]struct {
15+
X86x64 ekstypes.AMITypes
16+
X86Nvidia ekstypes.AMITypes
17+
X86Neuron ekstypes.AMITypes
18+
ARM ekstypes.AMITypes
19+
ARM64Nvidia ekstypes.AMITypes
20+
ARM64Neuron ekstypes.AMITypes
21+
}{
22+
NodeImageFamilyAmazonLinux2023: {
23+
X86x64: ekstypes.AMITypesAl2023X8664Standard,
24+
X86Nvidia: ekstypes.AMITypesAl2023X8664Nvidia,
25+
X86Neuron: ekstypes.AMITypesAl2023X8664Neuron,
26+
ARM: ekstypes.AMITypesAl2023Arm64Standard,
27+
ARM64Nvidia: ekstypes.AMITypesAl2023Arm64Nvidia,
28+
},
29+
NodeImageFamilyAmazonLinux2: {
30+
X86x64: ekstypes.AMITypesAl2X8664,
31+
X86Nvidia: ekstypes.AMITypesAl2X8664Gpu,
32+
X86Neuron: ekstypes.AMITypesAl2X8664Gpu,
33+
ARM: ekstypes.AMITypesAl2Arm64,
34+
},
35+
NodeImageFamilyBottlerocket: {
36+
X86x64: ekstypes.AMITypesBottlerocketX8664,
37+
X86Nvidia: ekstypes.AMITypesBottlerocketX8664Nvidia,
38+
X86Neuron: ekstypes.AMITypesBottlerocketX8664,
39+
ARM: ekstypes.AMITypesBottlerocketArm64,
40+
ARM64Nvidia: ekstypes.AMITypesBottlerocketArm64Nvidia,
41+
ARM64Neuron: ekstypes.AMITypesBottlerocketArm64,
42+
},
43+
NodeImageFamilyWindowsServer2019FullContainer: {
44+
X86x64: ekstypes.AMITypesWindowsFull2019X8664,
45+
X86Nvidia: ekstypes.AMITypesWindowsFull2019X8664,
46+
},
47+
NodeImageFamilyWindowsServer2019CoreContainer: {
48+
X86x64: ekstypes.AMITypesWindowsCore2019X8664,
49+
X86Nvidia: ekstypes.AMITypesWindowsCore2019X8664,
50+
},
51+
NodeImageFamilyWindowsServer2022FullContainer: {
52+
X86x64: ekstypes.AMITypesWindowsFull2022X8664,
53+
X86Nvidia: ekstypes.AMITypesWindowsFull2022X8664,
54+
},
55+
NodeImageFamilyWindowsServer2022CoreContainer: {
56+
X86x64: ekstypes.AMITypesWindowsCore2022X8664,
57+
X86Nvidia: ekstypes.AMITypesWindowsCore2022X8664,
58+
},
59+
}
60+
61+
amiType, ok := amiTypeMapping[amiFamily]
62+
if !ok {
63+
return ekstypes.AMITypesCustom
64+
}
65+
66+
// this helper short circuits the check for missing entries for amiTypes in
67+
// ami families based on the value of `strict`.
68+
isValid := func(amiType ekstypes.AMITypes) bool {
69+
return strict || amiType != ""
70+
}
71+
72+
if instanceutils.IsARMInstanceType(instanceType) {
73+
switch {
74+
case instanceutils.IsNvidiaInstanceType(instanceType) && isValid(amiType.ARM64Nvidia):
75+
return amiType.ARM64Nvidia
76+
case instanceutils.IsNeuronInstanceType(instanceType) && isValid(amiType.ARM64Neuron):
77+
return amiType.ARM64Neuron
78+
default:
79+
return amiType.ARM
80+
}
81+
} else {
82+
switch {
83+
case instanceutils.IsNvidiaInstanceType(instanceType) && isValid(amiType.X86Nvidia):
84+
return amiType.X86Nvidia
85+
case instanceutils.IsNeuronInstanceType(instanceType) && isValid(amiType.X86Neuron):
86+
return amiType.X86Neuron
87+
default:
88+
return amiType.X86x64
89+
}
90+
}
91+
}

pkg/apis/eksctl.io/v1alpha5/defaults.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
1212

1313
"github.com/weaveworks/eksctl/pkg/utils"
14-
instanceutils "github.com/weaveworks/eksctl/pkg/utils/instance"
1514
)
1615

1716
const (
@@ -149,8 +148,8 @@ func SetManagedNodeGroupDefaults(ng *ManagedNodeGroup, meta *ClusterMeta, contro
149148
// When using custom AMIs, we want the user to explicitly specify AMI family.
150149
// Thus, we only set up default AMI family when no custom AMI is being used.
151150
if ng.AMIFamily == "" && ng.AMI == "" {
152-
if isMinVer, _ := utils.IsMinVersion(Version1_30, meta.Version); isMinVer &&
153-
!instanceutils.IsARMGPUInstanceType(ng.InstanceType) {
151+
// AL2023 is the default ami type on EKS managed nodegroups after 1.30.
152+
if isMinVer, _ := utils.IsMinVersion(Version1_30, meta.Version); isMinVer {
154153
ng.AMIFamily = NodeImageFamilyAmazonLinux2023
155154
} else {
156155
ng.AMIFamily = NodeImageFamilyAmazonLinux2

pkg/apis/eksctl.io/v1alpha5/gpu_validation_test.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ var _ = Describe("GPU instance support", func() {
5151
amiFamily: api.NodeImageFamilyAmazonLinux2023,
5252
gpuInstanceType: "g4dn.xlarge",
5353
}),
54+
Entry("AL2023 ARM NVIDIA", gpuInstanceEntry{
55+
amiFamily: api.NodeImageFamilyAmazonLinux2023,
56+
gpuInstanceType: "g5g.2xlarge",
57+
}),
5458
Entry("AL2", gpuInstanceEntry{
5559
gpuInstanceType: "asdf",
5660
amiFamily: api.NodeImageFamilyAmazonLinux2,
@@ -96,7 +100,6 @@ var _ = Describe("GPU instance support", func() {
96100
ng.InstanceType = e.gpuInstanceType
97101
ng.AMIFamily = e.amiFamily
98102
assertValidationError(e, api.ValidateNodeGroup(0, ng, api.NewClusterConfig()))
99-
100103
},
101104
Entry("AL2023 INF", gpuInstanceEntry{
102105
amiFamily: api.NodeImageFamilyAmazonLinux2023,
@@ -110,6 +113,10 @@ var _ = Describe("GPU instance support", func() {
110113
amiFamily: api.NodeImageFamilyAmazonLinux2023,
111114
gpuInstanceType: "g4dn.xlarge",
112115
}),
116+
Entry("AL2023 ARM NVIDIA", gpuInstanceEntry{
117+
amiFamily: api.NodeImageFamilyAmazonLinux2023,
118+
gpuInstanceType: "g5g.2xlarge",
119+
}),
113120
Entry("AL2", gpuInstanceEntry{
114121
gpuInstanceType: "g4dn.xlarge",
115122
amiFamily: api.NodeImageFamilyAmazonLinux2,
@@ -244,16 +251,11 @@ var _ = Describe("GPU instance support", func() {
244251
amiFamily := api.NodeImageFamilyAmazonLinux2023
245252
instanceType := "g5g.2xlarge"
246253

247-
ngFail := api.NewNodeGroup()
248-
ngFail.AMIFamily = amiFamily
249-
ngFail.InstanceType = instanceType
250-
251254
ngPass := api.NewNodeGroup()
252255
ngPass.AMIFamily = amiFamily
253256
ngPass.InstanceType = instanceType
254257
ngPass.AMI = "ami-xxxx"
255258

256-
Expect(api.ValidateNodeGroup(0, ngFail, api.NewClusterConfig())).To(HaveOccurred())
257259
Expect(api.ValidateNodeGroup(0, ngPass, api.NewClusterConfig())).NotTo(HaveOccurred())
258260
})
259261

@@ -263,14 +265,14 @@ var _ = Describe("GPU instance support", func() {
263265
ng.AMIFamily = amiFamily
264266
err := api.ValidateNodeGroup(0, ng, api.NewClusterConfig())
265267
if expectErr {
266-
Expect(err).To(MatchError(fmt.Sprintf("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily %s", amiFamily)))
268+
Expect(err).To(MatchError(fmt.Sprintf("%s instance types are not supported for unmanaged nodegroups with AMIFamily %s", ng.InstanceType, amiFamily)))
267269
} else {
268270
Expect(err).NotTo(HaveOccurred())
269271
}
270272
},
271273
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, true),
272-
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, true),
273-
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, true),
274+
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, false),
275+
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, false),
274276
Entry("Windows2019Full", api.NodeImageFamilyWindowsServer2019FullContainer, true),
275277
Entry("Windows2019Core", api.NodeImageFamilyWindowsServer2019CoreContainer, true),
276278
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, false),

pkg/apis/eksctl.io/v1alpha5/validation.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,10 @@ func validateInstanceTypeSupport(ng *NodeGroup) error {
10791079
if IsAMI(ng.AMI) {
10801080
return nil
10811081
}
1082-
if instanceutils.IsARMGPUInstanceType(SelectInstanceType(ng)) {
1083-
switch ng.AMIFamily {
1084-
case NodeImageFamilyBottlerocket:
1085-
default:
1086-
return fmt.Errorf("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily %s", ng.AMIFamily)
1087-
}
1082+
instanceType := SelectInstanceType(ng)
1083+
amiType := GetAMIType(ng.AMIFamily, instanceType, true /* strict, don't allows fallbacks */)
1084+
if amiType == "" {
1085+
return fmt.Errorf("%s instance types are not supported for unmanaged nodegroups with AMIFamily %s", instanceType, ng.AMIFamily)
10881086
}
10891087
return nil
10901088
}

pkg/apis/eksctl.io/v1alpha5/validation_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1796,15 +1796,15 @@ var _ = Describe("ClusterConfig validation", func() {
17961796
ng.InstancesDistribution.InstanceTypes = []string{"g5g.2xlarge"}
17971797
ng.AMIFamily = api.NodeImageFamilyAmazonLinux2
17981798
err := api.ValidateNodeGroup(0, ng, cfg)
1799-
Expect(err).To(MatchError("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily AmazonLinux2"))
1799+
Expect(err).To(MatchError("g5g.2xlarge instance types are not supported for unmanaged nodegroups with AMIFamily AmazonLinux2"))
18001800
})
18011801

18021802
It("ARM-based GPU instance type fails for AmazonLinux2", func() {
18031803
ng.InstanceType = "g5g.2xlarge"
18041804
ng.InstancesDistribution.InstanceTypes = nil
18051805
ng.AMIFamily = api.NodeImageFamilyAmazonLinux2
18061806
err := api.ValidateNodeGroup(0, ng, cfg)
1807-
Expect(err).To(MatchError("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily AmazonLinux2"))
1807+
Expect(err).To(MatchError("g5g.2xlarge instance types are not supported for unmanaged nodegroups with AMIFamily AmazonLinux2"))
18081808
})
18091809

18101810
It("fails when instance distribution is enabled and instanceType set", func() {

pkg/cfn/builder/managed_nodegroup.go

+2-66
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (m *ManagedNodeGroupResourceSet) AddAllResources(ctx context.Context) error
153153
instanceTypes := m.nodeGroup.InstanceTypeList()
154154

155155
makeAMIType := func() *gfnt.Value {
156-
return gfnt.NewString(string(getAMIType(m.nodeGroup, selectManagedInstanceType(m.nodeGroup))))
156+
return gfnt.NewString(string(api.GetAMIType(m.nodeGroup.AMIFamily, selectManagedInstanceType(m.nodeGroup), false /* not strict, allow fallback */)))
157157
}
158158

159159
var launchTemplate *gfneks.Nodegroup_LaunchTemplateSpecification
@@ -178,7 +178,7 @@ func (m *ManagedNodeGroupResourceSet) AddAllResources(ctx context.Context) error
178178
if launchTemplateData.InstanceType == "" {
179179
managedResource.AmiType = makeAMIType()
180180
} else {
181-
managedResource.AmiType = gfnt.NewString(string(getAMIType(m.nodeGroup, string(launchTemplateData.InstanceType))))
181+
managedResource.AmiType = gfnt.NewString(string(api.GetAMIType(m.nodeGroup.AMIFamily, string(launchTemplateData.InstanceType), false /* not strict, allow fallback */)))
182182
}
183183
}
184184

@@ -305,70 +305,6 @@ func validateLaunchTemplate(launchTemplateData *ec2types.ResponseLaunchTemplateD
305305
return nil
306306
}
307307

308-
func getAMIType(ng *api.ManagedNodeGroup, instanceType string) ekstypes.AMITypes {
309-
amiTypeMapping := map[string]struct {
310-
X86x64 ekstypes.AMITypes
311-
X86Nvidia ekstypes.AMITypes
312-
X86Neuron ekstypes.AMITypes
313-
ARM ekstypes.AMITypes
314-
ARMGPU ekstypes.AMITypes
315-
}{
316-
api.NodeImageFamilyAmazonLinux2023: {
317-
X86x64: ekstypes.AMITypesAl2023X8664Standard,
318-
X86Nvidia: ekstypes.AMITypesAl2023X8664Nvidia,
319-
X86Neuron: ekstypes.AMITypesAl2023X8664Neuron,
320-
ARM: ekstypes.AMITypesAl2023Arm64Standard,
321-
},
322-
api.NodeImageFamilyAmazonLinux2: {
323-
X86x64: ekstypes.AMITypesAl2X8664,
324-
X86Nvidia: ekstypes.AMITypesAl2X8664Gpu,
325-
X86Neuron: ekstypes.AMITypesAl2X8664Gpu,
326-
ARM: ekstypes.AMITypesAl2Arm64,
327-
},
328-
api.NodeImageFamilyBottlerocket: {
329-
X86x64: ekstypes.AMITypesBottlerocketX8664,
330-
X86Nvidia: ekstypes.AMITypesBottlerocketX8664Nvidia,
331-
X86Neuron: ekstypes.AMITypesBottlerocketX8664,
332-
ARM: ekstypes.AMITypesBottlerocketArm64,
333-
ARMGPU: ekstypes.AMITypesBottlerocketArm64Nvidia,
334-
},
335-
api.NodeImageFamilyWindowsServer2019FullContainer: {
336-
X86x64: ekstypes.AMITypesWindowsFull2019X8664,
337-
X86Nvidia: ekstypes.AMITypesWindowsFull2019X8664,
338-
},
339-
api.NodeImageFamilyWindowsServer2019CoreContainer: {
340-
X86x64: ekstypes.AMITypesWindowsCore2019X8664,
341-
X86Nvidia: ekstypes.AMITypesWindowsCore2019X8664,
342-
},
343-
api.NodeImageFamilyWindowsServer2022FullContainer: {
344-
X86x64: ekstypes.AMITypesWindowsFull2022X8664,
345-
X86Nvidia: ekstypes.AMITypesWindowsFull2022X8664,
346-
},
347-
api.NodeImageFamilyWindowsServer2022CoreContainer: {
348-
X86x64: ekstypes.AMITypesWindowsCore2022X8664,
349-
X86Nvidia: ekstypes.AMITypesWindowsCore2022X8664,
350-
},
351-
}
352-
353-
amiType, ok := amiTypeMapping[ng.AMIFamily]
354-
if !ok {
355-
return ekstypes.AMITypesCustom
356-
}
357-
358-
switch {
359-
case instanceutils.IsARMGPUInstanceType(instanceType):
360-
return amiType.ARMGPU
361-
case instanceutils.IsARMInstanceType(instanceType):
362-
return amiType.ARM
363-
case instanceutils.IsNvidiaInstanceType(instanceType):
364-
return amiType.X86Nvidia
365-
case instanceutils.IsNeuronInstanceType(instanceType):
366-
return amiType.X86Neuron
367-
default:
368-
return amiType.X86x64
369-
}
370-
}
371-
372308
// RenderJSON implements the ResourceSet interface
373309
func (m *ManagedNodeGroupResourceSet) RenderJSON() ([]byte, error) {
374310
return m.resourceSet.renderJSON()

pkg/utils/instance/instance.go

-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ func IsNeuronInstanceType(instanceType string) bool {
2121
return InstanceTypesMap[instanceType].NeuronSupported
2222
}
2323

24-
// IsARMGPUInstanceType returns true if the instance type is ARM-GPU architecture
25-
func IsARMGPUInstanceType(instanceType string) bool {
26-
itype := InstanceTypesMap[instanceType]
27-
return itype.CPUArch == "arm64" && itype.NvidiaGPUSupported
28-
}
29-
3024
// IsNvidiaInstanceType returns true if the instance type has NVIDIA accelerated hardware
3125
func IsNvidiaInstanceType(instanceType string) bool {
3226
return InstanceTypesMap[instanceType].NvidiaGPUSupported

0 commit comments

Comments
 (0)