Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion v1/providers/shadeform/instancetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func (c *ShadeformClient) convertShadeformInstanceTypeToV1InstanceType(shadeform

gpuName := shadeformGPUTypeToBrevGPUName(shadeformInstanceType.Configuration.GpuType)
gpuManufacturer := v1.GetManufacturer(shadeformInstanceType.Configuration.GpuManufacturer)
cloud := shadeformCloud(shadeformInstanceType.Cloud)

for _, region := range shadeformInstanceType.Availability {
instanceTypes = append(instanceTypes, v1.InstanceType{
Expand Down Expand Up @@ -205,7 +206,7 @@ func (c *ShadeformClient) convertShadeformInstanceTypeToV1InstanceType(shadeform
IsAvailable: region.Available,
Location: region.Region,
Provider: CloudProviderID,
Cloud: string(shadeformInstanceType.Cloud),
Cloud: cloud,
})
}

Expand All @@ -230,3 +231,14 @@ func shadeformGPUTypeToBrevGPUName(gpuType string) string {
gpuType = strings.Split(gpuType, "_")[0]
return gpuType
}

func shadeformCloud(cloud openapi.Cloud) string {
// Shadeform will return the cloud as "excesssupply" if the instance type is retrieved
// from cloud partners and not a direct cloud provider. In this case, we should just return
// the Shadeform Cloud Provider ID.
if cloud == openapi.EXCESSSUPPLY {
return CloudProviderID
}

return string(cloud)
}
Loading