Skip to content

Commit

Permalink
Refactor comments in volume_limits.go and test names in node_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahQuinones committed Aug 14, 2024
1 parent cb01c03 commit 8725cbb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions pkg/cloud/volume_limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"
)

// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances
const (
highMemoryMetalInstancesMaxVolumes = 19
highMemoryVirtualInstancesMaxVolumes = 27
Expand Down Expand Up @@ -51,7 +51,7 @@ func init() {

var dedicatedVolumeLimits = map[string]int{}

// / List of nitro instance types can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances
// List of nitro instance types can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances
var nonNitroInstanceFamilies = map[string]struct{}{
"t2": {},
"c3": {},
Expand Down Expand Up @@ -89,8 +89,8 @@ func GetMaxAttachments(nitro bool) int {
return nonNitroMaxAttachments
}

// / Some instance types have a maximum limit of EBS volumes
// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html
// Some instance types have a maximum limit of EBS volumes
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html
var maxVolumeLimits = map[string]int{
"d3.8xlarge": 3,
"d3en.12xlarge": 3,
Expand Down Expand Up @@ -157,9 +157,9 @@ func GetReservedSlotsForInstanceType(it string) int {
return total
}

// / https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-volumes.html
// / IMDS does not provide NVMe instance store data; we'll just list all instances here
// / g5.48xlarge is not added to this table as it is in the maxVolumeLimits
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-volumes.html
// IMDS does not provide NVMe instance store data; we'll just list all instances here
// g5.48xlarge is not added to this table as it is in the maxVolumeLimits
var nvmeInstanceStoreVolumes = map[string]int{
"c1.medium": 1,
"c1.xlarge": 4,
Expand Down Expand Up @@ -501,9 +501,9 @@ var nvmeInstanceStoreVolumes = map[string]int{
"z1d.xlarge": 1,
}

// / https://aws.amazon.com/ec2/instance-types
// / Despite the dl1.24xlarge having Gaudi Accelerators describe instance types considers them GPUs as such that instacne type is in this table
// / g5.48xlarge is not added to this table as it is in the maxVolumeLimits
// https://aws.amazon.com/ec2/instance-types
// Despite the dl1.24xlarge having Gaudi Accelerators describe instance types considers them GPUs as such that instacne type is in this table
// g5.48xlarge is not added to this table as it is in the maxVolumeLimits
var gpuInstanceGpus = map[string]int{
"dl1.24xlarge": 8,
"g3.16xlarge": 4,
Expand Down Expand Up @@ -557,9 +557,9 @@ var gpuInstanceGpus = map[string]int{
"p5.48xlarge": 8,
}

// / Note this table is not a reflection of how many accelerators an instance has but of how many slots their combined acclerators take up
// / VT instance type accelerators take two slots each with the exception of the vt1.24xlarge which takes 0 slots for its acclerators
// / inf1 instance types are purposely not added to this table as they are in the maxVolumeLimits table
// Note this table is not a reflection of how many accelerators an instance has but of how many slots their combined acclerators take up
// VT instance type accelerators take two slots each with the exception of the vt1.24xlarge which takes 0 slots for its acclerators
// inf1 instance types are purposely not added to this table as they are in the maxVolumeLimits table
var acceleratorSlotsTaken = map[string]int{
"vt1.3xlarge": 2,
"vt1.6xlarge": 4,
Expand Down
10 changes: 5 additions & 5 deletions pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ func TestGetVolumesLimit(t *testing.T) {
},
{
// will and should fail if g5.48xlarge instance type is in any table other than maxVolumeLimits table
name: "g5.48xlarge_volume_attach_limit(has gpu and NVMe instance store volume but should be ignored for limits)",
name: "g5.48xlarge_volume_attach_limit (Instance has attached GPUs and NVMe Instance Store volumes but should be ignored for EBS volume limits calculation)",
options: &Options{
VolumeAttachLimit: -1,
ReservedVolumeAttachments: -1,
Expand All @@ -1250,7 +1250,7 @@ func TestGetVolumesLimit(t *testing.T) {
},
{
// will and should fail if inf1.xlarge instance type is in any table other than maxVolumeLimits table
name: "inf1.xlarge_volume_attach_limit(has accerators but should be ignored for limits)",
name: "inf1.xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)",
options: &Options{
VolumeAttachLimit: -1,
ReservedVolumeAttachments: -1,
Expand All @@ -1267,7 +1267,7 @@ func TestGetVolumesLimit(t *testing.T) {
},
{
// will and should fail if inf1.xlarge instance type is in any table other than maxVolumeLimits table
name: "inf1.2xlarge_volume_attach_limit(has accerators but should be ignored for limits)",
name: "inf1.2xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)",
options: &Options{
VolumeAttachLimit: -1,
ReservedVolumeAttachments: -1,
Expand All @@ -1284,7 +1284,7 @@ func TestGetVolumesLimit(t *testing.T) {
},
{
// will and should fail if inf1.6xlarge instance type is in any table other than maxVolumeLimits table
name: "inf1.6xlarge_volume_attach_limit(has accerators but should be ignored for limits)",
name: "inf1.6xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)",
options: &Options{
VolumeAttachLimit: -1,
ReservedVolumeAttachments: -1,
Expand All @@ -1301,7 +1301,7 @@ func TestGetVolumesLimit(t *testing.T) {
},
{
// will and should fail if inf1.24xlarge instance type is in any table other than maxVolumeLimits table
name: "inf1.24xlarge_volume_attach_limit(has accerators but should be ignored for limits)",
name: "inf1.24xlarge_volume_attach_limit (Instance has attached Accelerators but should be ignored for EBS volume limits calculation)",
options: &Options{
VolumeAttachLimit: -1,
ReservedVolumeAttachments: -1,
Expand Down

0 comments on commit 8725cbb

Please sign in to comment.