Skip to content
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

PR: Support MIG Instances #176

Merged
merged 6 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions config/crd/bases/robot.roboscale.io_launchmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg.
nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/robot.roboscale.io_robotartifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg.
nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down Expand Up @@ -371,6 +376,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg.
nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/robot.roboscale.io_robotdevsuites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg. nvidia.com/mig-1g.5gb.
Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down Expand Up @@ -181,6 +186,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg. nvidia.com/mig-1g.5gb.
Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/robot.roboscale.io_robotides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg. nvidia.com/mig-1g.5gb.
Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/robot.roboscale.io_robots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg.
nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down Expand Up @@ -392,6 +397,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg.
nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/robot.roboscale.io_robotvdis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ spec:
gpuCore:
description: GPU core number that will be allocated.
type: integer
gpuInstance:
default: nvidia.com/gpu
description: GPU instance that will be allocated. eg. nvidia.com/mig-1g.5gb.
Defaults to "nvidia.com/gpu".
type: string
memory:
description: Memory resource limit.
pattern: ^([0-9])+(Mi|Gi)$
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: robolaunchio/robot-controller-manager
newTag: v0.2.6-alpha.2
newName: robolaunchio/robot-controller-manager-dev
newTag: platform-v0.7.0
2 changes: 1 addition & 1 deletion internal/resources/robot_vdi.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func GetRobotVDIIngress(robotVDI *robotv1alpha1.RobotVDI, ingressNamespacedName
func getResourceLimits(resources robotv1alpha1.Resources) corev1.ResourceList {
resourceLimits := corev1.ResourceList{}
if resources.GPUCore != 0 {
resourceLimits["nvidia.com/gpu"] = resource.MustParse(strconv.Itoa(resources.GPUCore))
resourceLimits[corev1.ResourceName(resources.GPUInstance)] = resource.MustParse(strconv.Itoa(resources.GPUCore))
}
if resources.CPU != "" {
resourceLimits["cpu"] = resource.MustParse(resources.CPU)
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/roboscale.io/v1alpha1/dev_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ type RobotIDEStatus struct {

// VDI resource limits.
type Resources struct {
// GPU instance that will be allocated. eg. nvidia.com/mig-1g.5gb. Defaults to "nvidia.com/gpu".
// +kubebuilder:default="nvidia.com/gpu"
GPUInstance string `json:"gpuInstance,omitempty"`
// GPU core number that will be allocated.
GPUCore int `json:"gpuCore,omitempty"`
// CPU resource limit.
Expand Down