diff --git a/pkg/provider/aws/aws.go b/pkg/provider/aws/aws.go index 80f7cce..c50e8a3 100644 --- a/pkg/provider/aws/aws.go +++ b/pkg/provider/aws/aws.go @@ -749,16 +749,12 @@ func (p *Provider) ClassifyProvisionError(err error, accelerator, region string) const awsAMIRootGiB = 30 // awsMaxDiskGiB is the most user space a Pod may ask for: gp3's 16 TiB volume cap less the OS -// base. Refused at launch and unpriced above it, so it never reaches rootVolume's int32. +// base. Refused at launch, so it never reaches rootVolume's int32. const awsMaxDiskGiB = 16*1024 - awsAMIRootGiB // PricePerHour overrides catalog.Base to add the root volume, which EBS bills by provisioned // size apart from the instance. It prices the size sdkClient.rootVolume launches. func (p *Provider) PricePerHour(req provider.PriceRequest) (float64, error) { - if req.DiskGiB > awsMaxDiskGiB { - return 0, fmt.Errorf("aws: %d GiB disk exceeds the %d GiB a root volume can add: %w", - req.DiskGiB, awsMaxDiskGiB, provider.ErrNoPrice) - } rate, err := p.Base.PricePerHour(req) if err != nil { return 0, err diff --git a/pkg/provider/aws/aws_test.go b/pkg/provider/aws/aws_test.go index 4137678..ceea8d2 100644 --- a/pkg/provider/aws/aws_test.go +++ b/pkg/provider/aws/aws_test.go @@ -1091,10 +1091,6 @@ func TestPricePerHour_AddsRootVolume(t *testing.T) { if !errors.Is(err, provider.ErrNoPrice) { t.Fatalf("PricePerHour(unknown accelerator) err = %v, want ErrNoPrice", err) } - req.DiskGiB = awsMaxDiskGiB + 1 - if _, err = p.PricePerHour(req); !errors.Is(err, provider.ErrNoPrice) { - t.Fatalf("PricePerHour(above awsMaxDiskGiB) err = %v, want ErrNoPrice", err) - } } func TestProvision_SizesDiskFromEphemeralStorage(t *testing.T) { diff --git a/pkg/provider/modal/modal.go b/pkg/provider/modal/modal.go index 995700a..4470fbe 100644 --- a/pkg/provider/modal/modal.go +++ b/pkg/provider/modal/modal.go @@ -413,13 +413,8 @@ const modalFreeDiskGiB = 512 // would be read as free. A GPU sandbox in that state still prices, understating by those // same defaults, which is immaterial beside the accelerator. // -// Disk adds nothing up to modalFreeDiskGiB; above it is ErrNoPrice, since such a Pod is -// never launched (see sandboxSpecFromPod). +// Disk adds nothing: Pods asking for more than modalFreeDiskGiB are never launched. func (p *Provider) PricePerHour(req provider.PriceRequest) (float64, error) { - if req.DiskGiB > modalFreeDiskGiB { - return 0, fmt.Errorf("modal: %d GiB disk exceeds the unbilled %d GiB: %w", - req.DiskGiB, modalFreeDiskGiB, provider.ErrNoPrice) - } metered := data.ModalCPUCostPerHour(req.CPUCores) + data.ModalMemoryCostPerHour(req.MemoryMiB) if req.AcceleratorType == "" { diff --git a/pkg/provider/modal/modal_test.go b/pkg/provider/modal/modal_test.go index eacc966..fe8d5ec 100644 --- a/pkg/provider/modal/modal_test.go +++ b/pkg/provider/modal/modal_test.go @@ -2028,10 +2028,6 @@ func TestPricePerHour_NoPrice(t *testing.T) { AcceleratorType: "TPU-v4", Count: 1, CapacityType: nebulav1alpha1.CapacityOnDemand, CPUCores: 4, MemoryMiB: 8192, }, - "disk above the unbilled quota": { - AcceleratorType: "H100", Count: 1, CapacityType: nebulav1alpha1.CapacityOnDemand, - CPUCores: 4, MemoryMiB: 8192, DiskGiB: modalFreeDiskGiB + 1, - }, } { t.Run(name, func(t *testing.T) { got, err := p.PricePerHour(req)