Skip to content

Commit 31f84fd

Browse files
committed
fixed comments
1 parent 478db47 commit 31f84fd

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

v1/providers/sfcompute/instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ func sfcNameToBrevData(name string) (cloudCredRefID string, brevStage string, re
476476
return parts[0], parts[1], parts[2], parts[3], nil
477477
case 2:
478478
// Old format: refID_name (backward compat — cloudCredRefID and stage unknown)
479+
// TODO: remove this case once all old-format nodes have been cleaned up
479480
return "", "", parts[0], parts[1], nil
480481
default:
481482
return "", "", "", "", errors.WrapAndTrace(fmt.Errorf("invalid node name %s: expected 2 or 4 underscore-separated parts", name))

v1/providers/sfcompute/instancetype.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ const (
2121
interconnectInfiniband = "infiniband"
2222
formFactorSXM5 = "sxm5"
2323
diskTypeSSD = "ssd"
24+
25+
// Currently only 8xH100/H200 instance types are available
26+
// so it's safe to hardcode vCPU and GPU count.
27+
sfcVCPU = 112
28+
sfcGPUCount = 8
2429
)
2530

2631
func makeDefaultInstanceTypePrice(amount string, currencyCode string) currency.Amount {
@@ -236,18 +241,14 @@ func getInstanceTypeMetadata(gpuType string) (*sfcInstanceTypeMetadata, error) {
236241
}
237242
}
238243

239-
// vCPU count provided by SF Compute. Currently only 8xH100/H200 instance types are
240-
// available so it's safe to hardcode.
241-
const sfcVCPU = 112
242-
243244
var h100InstanceTypeMetadata = sfcInstanceTypeMetadata{
244245
gpuType: gpuTypeH100,
245246
formFactor: formFactorSXM5,
246247
architecture: v1.ArchitectureX86_64,
247248
memoryBytes: v1.NewBytes(960, v1.Gigabyte),
248249
diskBytes: v1.NewBytes(1500, v1.Gigabyte),
249250
vcpu: sfcVCPU,
250-
gpuCount: 8,
251+
gpuCount: sfcGPUCount,
251252
gpuManufacturer: v1.ManufacturerNVIDIA,
252253
gpuVRAM: v1.NewBytes(80, v1.Gigabyte),
253254
estimatedDeployTime: 14 * time.Minute,
@@ -261,7 +262,7 @@ var h200InstanceTypeMetadata = sfcInstanceTypeMetadata{
261262
memoryBytes: v1.NewBytes(960, v1.Gigabyte),
262263
diskBytes: v1.NewBytes(1500, v1.Gigabyte),
263264
vcpu: sfcVCPU,
264-
gpuCount: 8,
265+
gpuCount: sfcGPUCount,
265266
gpuManufacturer: v1.ManufacturerNVIDIA,
266267
gpuVRAM: v1.NewBytes(141, v1.Gigabyte),
267268
estimatedDeployTime: 14 * time.Minute,

0 commit comments

Comments
 (0)