-
Notifications
You must be signed in to change notification settings - Fork 7
fix(BREV-2207): Add missing deprecated bytes values #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8778ca7
add missing deprecated bytes values
drewmalin 3430015
lint
drewmalin 7e88607
add nebius validation, skip k8s tests for now
drewmalin 0e12d4f
fail if missing envvars
drewmalin 506f29c
pass envvars to nebius test
drewmalin d4ae99b
lint
drewmalin 7c37e51
add location to validation test
drewmalin 8ac7b22
tests
drewmalin d1869db
boot disk default size
drewmalin 5beaaae
tests
drewmalin a2fd3ad
keys for nebius test
drewmalin 08c2c55
remove ref to ubuntu18 and allow ubuntu 24
theFong 138c8e6
only get x86 in image validation
theFong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,13 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance | |
| // Default behavior: check ALL regions to show all available quota | ||
| var locations []v1.Location | ||
|
|
||
| if len(args.Locations) > 0 && !args.Locations.IsAll() { | ||
| if args.Locations.IsAll() { //nolint:gocritic // prefer if statement over switch statement | ||
| allLocations, err := c.GetLocations(ctx, v1.GetLocationsArgs{}) | ||
| if err != nil { | ||
| return nil, errors.WrapAndTrace(err) | ||
| } | ||
| locations = allLocations | ||
| } else if len(args.Locations) > 0 { | ||
| // User requested specific locations - filter to those | ||
| allLocations, err := c.GetLocations(ctx, v1.GetLocationsArgs{}) | ||
| if err == nil { | ||
|
|
@@ -48,15 +54,8 @@ func (c *NebiusClient) GetInstanceTypes(ctx context.Context, args v1.GetInstance | |
| locations = []v1.Location{{Name: c.location}} | ||
| } | ||
| } else { | ||
| // Default behavior: enumerate ALL regions for quota-aware discovery | ||
| // This shows users all instance types they have quota for, regardless of region | ||
| allLocations, err := c.GetLocations(ctx, v1.GetLocationsArgs{}) | ||
| if err == nil { | ||
| locations = allLocations | ||
| } else { | ||
| // Fallback to client's configured location if we can't get all locations | ||
| locations = []v1.Location{{Name: c.location}} | ||
| } | ||
| // Fallback to client's configured location if we can't get all locations | ||
| locations = []v1.Location{{Name: c.location}} | ||
| } | ||
|
|
||
| // Get quota information for all regions | ||
|
|
@@ -176,10 +175,10 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform | |
|
|
||
| // Convert Nebius platform preset to our InstanceType format | ||
| instanceType := v1.InstanceType{ | ||
| ID: v1.InstanceTypeID(instanceTypeID), // Dot-separated format (e.g., "gpu-h100-sxm.8gpu-128vcpu-1600gb") | ||
| Location: location.Name, | ||
| Type: instanceTypeID, // Same as ID - both use dot-separated format | ||
| VCPU: preset.Resources.VcpuCount, | ||
| Memory: units.Base2Bytes(preset.Resources.MemoryGibibytes) * units.Gibibyte, | ||
| MemoryBytes: v1.NewBytes(v1.BytesValue(preset.Resources.MemoryGibibytes), v1.Gibibyte), // Memory in GiB | ||
| NetworkPerformance: "standard", // Default network performance | ||
| IsAvailable: isAvailable, | ||
|
|
@@ -191,12 +190,14 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform | |
|
|
||
| // Add GPU information if available | ||
| if preset.Resources.GpuCount > 0 && !isCPUOnly { | ||
| memory := getGPUMemory(gpuType) | ||
| gpu := v1.GPU{ | ||
| Count: preset.Resources.GpuCount, | ||
| Type: gpuType, | ||
| Name: gpuName, | ||
| Manufacturer: v1.ManufacturerNVIDIA, // Nebius currently only supports NVIDIA GPUs | ||
| Memory: getGPUMemory(gpuType), // Populate VRAM based on GPU type | ||
| Memory: memory, // Populate VRAM based on GPU type | ||
| MemoryBytes: v1.NewBytes(v1.BytesValue(int64(memory)/int64(units.Gibibyte)), v1.Gibibyte), | ||
| } | ||
| instanceType.SupportedGPUs = []v1.GPU{gpu} | ||
| } | ||
|
|
@@ -207,6 +208,9 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform | |
| instanceType.BasePrice = pricing | ||
| } | ||
|
|
||
| // Make the instance type ID | ||
| instanceType.ID = v1.MakeGenericInstanceTypeID(instanceType) | ||
|
Comment on lines
+211
to
+212
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should now resolve IDs properly |
||
|
|
||
| instanceTypes = append(instanceTypes, instanceType) | ||
| } | ||
| } | ||
|
|
@@ -368,7 +372,9 @@ func (c *NebiusClient) buildSupportedStorage() []v1.Storage { | |
| // Nebius supports dynamically allocatable network SSD disks | ||
| // Minimum: 50GB, Maximum: 2560GB | ||
| minSize := 50 * units.GiB | ||
| minSizeBytes := v1.NewBytes(50, v1.Gibibyte) | ||
| maxSize := 2560 * units.GiB | ||
| maxSizeBytes := v1.NewBytes(2560, v1.Gibibyte) | ||
|
|
||
| // Pricing is roughly $0.10 per GB-month, which is ~$0.00014 per GB-hour | ||
| pricePerGBHr, _ := currency.NewAmount("0.00014", "USD") | ||
|
|
@@ -379,6 +385,8 @@ func (c *NebiusClient) buildSupportedStorage() []v1.Storage { | |
| Count: 1, | ||
| MinSize: &minSize, | ||
| MaxSize: &maxSize, | ||
| MinSizeBytes: &minSizeBytes, | ||
| MaxSizeBytes: &maxSizeBytes, | ||
| IsElastic: true, | ||
| PricePerGBHr: &pricePerGBHr, | ||
| }, | ||
|
|
@@ -396,7 +404,7 @@ func (c *NebiusClient) applyInstanceTypeFilters(instanceTypes []v1.InstanceType, | |
| if len(args.InstanceTypes) > 0 { | ||
| found := false | ||
| for _, requestedType := range args.InstanceTypes { | ||
| if string(instanceType.ID) == requestedType { | ||
| if instanceType.Type == requestedType { | ||
|
Comment on lines
-399
to
+407
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We filter on Type, not Type ID |
||
| found = true | ||
| break | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be 0