Propegate Default HW Spec Values to the Backend#13
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
noorvir
reviewed
May 30, 2023
| HDD HardwareRequestRange `json:"hdd"` | ||
| } | ||
|
|
||
| func SetSpecDefaultValues(spec HardwareSpec) HardwareSpec { |
Contributor
There was a problem hiding this comment.
Maybe do one of either mutating the state or returning a new HardwareSpec type but not both. That seems like it would cause issues. Maybe make a copy and return it?
Contributor
Author
There was a problem hiding this comment.
Yeah we can do that!
Contributor
There was a problem hiding this comment.
This got marked as outdated but still un resolved
Contributor
Author
There was a problem hiding this comment.
Feedback hasn’t been addressed yet, will quickly fix this up tonight
# Conflicts: # api/server/exec.go
noorvir
approved these changes
May 31, 2023
noorvir
reviewed
Jun 1, 2023
| defaultMinCPU = 1 | ||
| defaultMinHDD = 4 | ||
| defaultMinGPUs = 1 | ||
| defaultGPURequest = "rtx_4000" |
Contributor
There was a problem hiding this comment.
This was a mistake actually. The GPU type is provider specific so it can't go in the generic hardware spec. We probably need to validate the hardware spec in each provider.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds the SetDefaultValues function to establish sensible default values and constraints for unset fields within the HardwareSpec struct. This supports the backend and CLI by ensuring sensible defaults for Node/Execs get set. Since this information gets cached in our local DB the approach also assumes Providers return an error if they are unable to supply a container or VM with a fully qualified HardwareSpec. So rather than using the response of each Provider as a source of truth, we trust the reflective property of the HW specification asked for.
Key Changes:
Supports: unweave/cli#14