Skip to content

Commit 927e686

Browse files
authored
Merge pull request #489 from shengnuo/nim-custom-scheduler
Allow custom scheduler to be specified in NIMService and NIMPipeline
2 parents 0aa9363 + 9444e6b commit 927e686

9 files changed

Lines changed: 25 additions & 0 deletions

File tree

api/apps/v1alpha1/nimservice_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ type NIMServiceSpec struct {
7676
ReadinessProbe Probe `json:"readinessProbe,omitempty"`
7777
StartupProbe Probe `json:"startupProbe,omitempty"`
7878
Scale Autoscaling `json:"scale,omitempty"`
79+
SchedulerName string `json:"schedulerName,omitempty"`
7980
Metrics Metrics `json:"metrics,omitempty"`
8081
// +kubebuilder:validation:Minimum=1
8182
// +kubebuilder:default:=1
@@ -693,6 +694,9 @@ func (n *NIMService) GetDeploymentParams() *rendertypes.DeploymentParams {
693694
// Set runtime class
694695
params.RuntimeClassName = n.GetRuntimeClassName()
695696

697+
// Set scheduler
698+
params.SchedulerName = n.GetSchedulerName()
699+
696700
// Setup container ports for nimservice
697701
params.Ports = []corev1.ContainerPort{
698702
{
@@ -718,6 +722,11 @@ func (n *NIMService) GetDeploymentParams() *rendertypes.DeploymentParams {
718722
return params
719723
}
720724

725+
// GetSchedulerName returns the scheduler name for the NIMService deployment.
726+
func (n *NIMService) GetSchedulerName() string {
727+
return n.Spec.SchedulerName
728+
}
729+
721730
// GetStatefulSetParams returns params to render StatefulSet from templates.
722731
func (n *NIMService) GetStatefulSetParams() *rendertypes.StatefulSetParams {
723732

bundle/manifests/apps.nvidia.com_nimpipelines.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,8 @@ spec:
20082008
- maxReplicas
20092009
type: object
20102010
type: object
2011+
schedulerName:
2012+
type: string
20112013
startupProbe:
20122014
description: Probe defines attributes for startup/liveness/readiness
20132015
probes.

bundle/manifests/apps.nvidia.com_nimservices.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,6 +1927,8 @@ spec:
19271927
- maxReplicas
19281928
type: object
19291929
type: object
1930+
schedulerName:
1931+
type: string
19301932
startupProbe:
19311933
description: Probe defines attributes for startup/liveness/readiness
19321934
probes.

config/crd/bases/apps.nvidia.com_nimpipelines.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,8 @@ spec:
20082008
- maxReplicas
20092009
type: object
20102010
type: object
2011+
schedulerName:
2012+
type: string
20112013
startupProbe:
20122014
description: Probe defines attributes for startup/liveness/readiness
20132015
probes.

config/crd/bases/apps.nvidia.com_nimservices.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,6 +1927,8 @@ spec:
19271927
- maxReplicas
19281928
type: object
19291929
type: object
1930+
schedulerName:
1931+
type: string
19301932
startupProbe:
19311933
description: Probe defines attributes for startup/liveness/readiness
19321934
probes.

deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimpipelines.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,8 @@ spec:
20082008
- maxReplicas
20092009
type: object
20102010
type: object
2011+
schedulerName:
2012+
type: string
20112013
startupProbe:
20122014
description: Probe defines attributes for startup/liveness/readiness
20132015
probes.

deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimservices.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,6 +1927,8 @@ spec:
19271927
- maxReplicas
19281928
type: object
19291929
type: object
1930+
schedulerName:
1931+
type: string
19301932
startupProbe:
19311933
description: Probe defines attributes for startup/liveness/readiness
19321934
probes.

internal/render/types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type DeploymentParams struct {
6666
Image string
6767
ImagePullSecrets []string
6868
ImagePullPolicy string
69+
SchedulerName string
6970
Volumes []corev1.Volume
7071
VolumeMounts []corev1.VolumeMount
7172
Env []corev1.EnvVar

manifests/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
{{- .PodAnnotations | yaml | nindent 8 }}
3636
{{- end }}
3737
spec:
38+
{{- if .SchedulerName }}
39+
schedulerName: {{ .SchedulerName }}
40+
{{- end }}
3841
serviceAccountName: {{ .ServiceAccountName }}
3942
runtimeClassName: {{ .RuntimeClassName }}
4043
initContainers:

0 commit comments

Comments
 (0)