Skip to content

Commit

Permalink
Fix node.go eni calculation for maxVolumeLimits table instances fix t…
Browse files Browse the repository at this point in the history
…ypos refactor table generation scripts
  • Loading branch information
ElijahQuinones committed Aug 14, 2024
1 parent e7077be commit cb01c03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hack/generate-gpu-count-table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function get_all_gpus() {
done
}

get_all_gpus | sort | uniq | grep -vE "(g5.48xlarge)"
get_all_gpus | sort | uniq | grep -v "g5.48xlarge"
2 changes: 1 addition & 1 deletion hack/generate-instance-store-table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ function get_all_instance_stores() {
done
}

get_all_instance_stores | sort | uniq | grep -vE "(g5.48xlarge)"
get_all_instance_stores | sort | uniq | grep -v "g5.48xlarge"
4 changes: 2 additions & 2 deletions pkg/cloud/volume_limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ var gpuInstanceGpus = map[string]int{
}

// / 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 excpetion of the vt1.24xlarge which takes 0 slots for it's acclerators
// / inf1 instance types are purposley not added to this table as they are in the maxVolumeLimits table
// / 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
8 changes: 4 additions & 4 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,8 @@ func (d *NodeService) getVolumesLimit() int64 {
}

dedicatedLimit := cloud.GetDedicatedLimitForInstanceType(instanceType)
maxEBSAttachments, hasMaxvolumeLimit := cloud.GetEBSLimitForInstanceType(instanceType)
if hasMaxvolumeLimit {
maxEBSAttachments, hasMaxVolumeLimit := cloud.GetEBSLimitForInstanceType(instanceType)
if hasMaxVolumeLimit {
availableAttachments = min(maxEBSAttachments, availableAttachments)
}
// For special dedicated limit instance types, the limit is only for EBS volumes
Expand All @@ -792,8 +792,8 @@ func (d *NodeService) getVolumesLimit() int64 {
} else if isNitro {
enis := d.metadata.GetNumAttachedENIs()
reservedSlots := cloud.GetReservedSlotsForInstanceType(instanceType)
if hasMaxvolumeLimit {
availableAttachments = availableAttachments - reservedSlots
if hasMaxVolumeLimit {
availableAttachments = availableAttachments - (enis - 1) - reservedSlots
} else {
availableAttachments = availableAttachments - enis - reservedSlots
}
Expand Down

0 comments on commit cb01c03

Please sign in to comment.