Unverified Commit 9caafa55 authored by Thomas Montfort's avatar Thomas Montfort Committed by GitHub
Browse files

feat: add custom gpu type to CRD (#4408)

parent 33d9ae78
...@@ -34,7 +34,6 @@ import ( ...@@ -34,7 +34,6 @@ import (
"k8s.io/utils/ptr" "k8s.io/utils/ptr"
grovev1alpha1 "github.com/NVIDIA/grove/operator/api/core/v1alpha1" grovev1alpha1 "github.com/NVIDIA/grove/operator/api/core/v1alpha1"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/dynamo/common"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/v1alpha1" "github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/v1alpha1"
commonconsts "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/consts" commonconsts "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/consts"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/controller_common" "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/controller_common"
...@@ -63,15 +62,15 @@ type Autoscaling struct { ...@@ -63,15 +62,15 @@ type Autoscaling struct {
} }
type Config struct { type Config struct {
Dynamo *DynamoConfig `yaml:"dynamo,omitempty"` Dynamo *DynamoConfig `yaml:"dynamo,omitempty"`
Resources *Resources `yaml:"resources,omitempty"` Resources *Resources `yaml:"resources,omitempty"`
Traffic *Traffic `yaml:"traffic,omitempty"` Traffic *Traffic `yaml:"traffic,omitempty"`
Autoscaling *Autoscaling `yaml:"autoscaling,omitempty"` Autoscaling *Autoscaling `yaml:"autoscaling,omitempty"`
HttpExposed bool `yaml:"http_exposed,omitempty"` HttpExposed bool `yaml:"http_exposed,omitempty"`
ApiEndpoints []string `yaml:"api_endpoints,omitempty"` ApiEndpoints []string `yaml:"api_endpoints,omitempty"`
Workers *int32 `yaml:"workers,omitempty"` Workers *int32 `yaml:"workers,omitempty"`
TotalGpus *int32 `yaml:"total_gpus,omitempty"` TotalGpus *int32 `yaml:"total_gpus,omitempty"`
ExtraPodSpec *common.ExtraPodSpec `yaml:"extraPodSpec,omitempty"` ExtraPodSpec *v1alpha1.ExtraPodSpec `yaml:"extraPodSpec,omitempty"`
} }
type ServiceConfig struct { type ServiceConfig struct {
...@@ -150,7 +149,7 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD ...@@ -150,7 +149,7 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD
if component.ComponentType == commonconsts.ComponentTypePlanner { if component.ComponentType == commonconsts.ComponentTypePlanner {
// ensure that the extraPodSpec is not nil // ensure that the extraPodSpec is not nil
if deployment.Spec.ExtraPodSpec == nil { if deployment.Spec.ExtraPodSpec == nil {
deployment.Spec.ExtraPodSpec = &common.ExtraPodSpec{} deployment.Spec.ExtraPodSpec = &v1alpha1.ExtraPodSpec{}
} }
// ensure that the embedded PodSpec struct is not nil // ensure that the embedded PodSpec struct is not nil
if deployment.Spec.ExtraPodSpec.PodSpec == nil { if deployment.Spec.ExtraPodSpec.PodSpec == nil {
...@@ -231,10 +230,10 @@ func overrideWithDynDeploymentConfig(ctx context.Context, dynamoDeploymentCompon ...@@ -231,10 +230,10 @@ func overrideWithDynDeploymentConfig(ctx context.Context, dynamoDeploymentCompon
dynamoDeploymentComponent.Spec.Replicas = componentDynConfig.ServiceArgs.Workers dynamoDeploymentComponent.Spec.Replicas = componentDynConfig.ServiceArgs.Workers
} }
if componentDynConfig.ServiceArgs != nil && componentDynConfig.ServiceArgs.Resources != nil { if componentDynConfig.ServiceArgs != nil && componentDynConfig.ServiceArgs.Resources != nil {
requests := &common.ResourceItem{} requests := &v1alpha1.ResourceItem{}
limits := &common.ResourceItem{} limits := &v1alpha1.ResourceItem{}
if dynamoDeploymentComponent.Spec.Resources == nil { if dynamoDeploymentComponent.Spec.Resources == nil {
dynamoDeploymentComponent.Spec.Resources = &common.Resources{ dynamoDeploymentComponent.Spec.Resources = &v1alpha1.Resources{
Requests: requests, Requests: requests,
Limits: limits, Limits: limits,
} }
......
...@@ -27,7 +27,6 @@ import ( ...@@ -27,7 +27,6 @@ import (
"time" "time"
grovev1alpha1 "github.com/NVIDIA/grove/operator/api/core/v1alpha1" grovev1alpha1 "github.com/NVIDIA/grove/operator/api/core/v1alpha1"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/dynamo/common"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/v1alpha1" "github.com/ai-dynamo/dynamo/deploy/cloud/operator/api/v1alpha1"
commonconsts "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/consts" commonconsts "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/consts"
"github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/controller_common" "github.com/ai-dynamo/dynamo/deploy/cloud/operator/internal/controller_common"
...@@ -66,8 +65,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -66,8 +65,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
ComponentType: "frontend", ComponentType: "frontend",
SubComponentType: "test-sub-component", SubComponentType: "test-sub-component",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -78,8 +77,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -78,8 +77,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
"service2": { "service2": {
DynamoNamespace: &[]string{"default"}[0], DynamoNamespace: &[]string{"default"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -109,8 +108,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -109,8 +108,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
ComponentType: "frontend", ComponentType: "frontend",
SubComponentType: "test-sub-component", SubComponentType: "test-sub-component",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -146,8 +145,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -146,8 +145,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -175,8 +174,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -175,8 +174,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: nil, DynamoNamespace: nil,
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -187,8 +186,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -187,8 +186,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
"service2": { "service2": {
DynamoNamespace: nil, DynamoNamespace: nil,
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -217,8 +216,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -217,8 +216,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -254,8 +253,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -254,8 +253,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -283,8 +282,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -283,8 +282,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: nil, DynamoNamespace: nil,
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -295,8 +294,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -295,8 +294,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
"service2": { "service2": {
DynamoNamespace: nil, DynamoNamespace: nil,
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -329,8 +328,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -329,8 +328,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -370,8 +369,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -370,8 +369,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -405,8 +404,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -405,8 +404,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: nil, DynamoNamespace: nil,
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -417,8 +416,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -417,8 +416,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
"service2": { "service2": {
DynamoNamespace: nil, DynamoNamespace: nil,
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -447,14 +446,14 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -447,14 +446,14 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
Custom: map[string]string{}, Custom: map[string]string{},
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -496,8 +495,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -496,8 +495,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -532,15 +531,15 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -532,15 +531,15 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
Custom: map[string]string{}, Custom: map[string]string{},
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{"sh", "-c"}, Command: []string{"sh", "-c"},
Args: []string{"echo hello world", "sleep 99999"}, Args: []string{"echo hello world", "sleep 99999"},
...@@ -550,8 +549,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -550,8 +549,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
"service2": { "service2": {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -587,8 +586,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -587,8 +586,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -601,7 +600,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -601,7 +600,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{"sh", "-c"}, Command: []string{"sh", "-c"},
Args: []string{"echo hello world", "sleep 99999"}, Args: []string{"echo hello world", "sleep 99999"},
...@@ -637,8 +636,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -637,8 +636,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "default-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -677,8 +676,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -677,8 +676,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -712,8 +711,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -712,8 +711,8 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"default-test-dynamographdeployment"}[0],
ComponentType: "frontend", ComponentType: "frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "0", GPU: "0",
...@@ -905,8 +904,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -905,8 +904,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -922,8 +921,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -922,8 +921,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -942,8 +941,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -942,8 +941,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -965,13 +964,13 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -965,13 +964,13 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -996,8 +995,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -996,8 +995,8 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: nil, Replicas: nil,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -1019,13 +1018,13 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) { ...@@ -1019,13 +1018,13 @@ func Test_overrideWithDynDeploymentConfig(t *testing.T) {
DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{ DynamoComponentDeploymentSharedSpec: v1alpha1.DynamoComponentDeploymentSharedSpec{
ServiceName: "Frontend", ServiceName: "Frontend",
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "2", GPU: "2",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "", CPU: "",
Memory: "", Memory: "",
GPU: "2", GPU: "2",
...@@ -1160,7 +1159,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1160,7 +1159,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
"Frontend": { "Frontend": {
ComponentType: "frontend", // Frontend component ComponentType: "frontend", // Frontend component
SubComponentType: "test-sub-component", SubComponentType: "test-sub-component",
ExtraPodMetadata: &common.ExtraPodMetadata{ ExtraPodMetadata: &v1alpha1.ExtraPodMetadata{
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
"nvidia.com/annotation2": "annotation2", "nvidia.com/annotation2": "annotation2",
...@@ -1171,12 +1170,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1171,12 +1170,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -1205,7 +1204,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1205,7 +1204,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
TerminationGracePeriodSeconds: ptr.To(int64(10)), TerminationGracePeriodSeconds: ptr.To(int64(10)),
ImagePullSecrets: []corev1.LocalObjectReference{ ImagePullSecrets: []corev1.LocalObjectReference{
...@@ -1231,12 +1230,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1231,12 +1230,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
"Planner": { "Planner": {
Replicas: &[]int32{2}[0], Replicas: &[]int32{2}[0],
ComponentType: commonconsts.ComponentTypePlanner, ComponentType: commonconsts.ComponentTypePlanner,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -1271,7 +1270,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1271,7 +1270,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{ Command: []string{
"/bin/sh", "/bin/sh",
...@@ -1686,12 +1685,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1686,12 +1685,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Services: map[string]*v1alpha1.DynamoComponentDeploymentSharedSpec{ Services: map[string]*v1alpha1.DynamoComponentDeploymentSharedSpec{
"Frontend": { "Frontend": {
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -1721,7 +1720,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1721,7 +1720,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
ImagePullSecrets: []corev1.LocalObjectReference{ ImagePullSecrets: []corev1.LocalObjectReference{
{ {
...@@ -1748,7 +1747,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1748,7 +1747,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Multinode: &v1alpha1.MultinodeSpec{ Multinode: &v1alpha1.MultinodeSpec{
NodeCount: 3, NodeCount: 3,
}, },
ExtraPodMetadata: &common.ExtraPodMetadata{ ExtraPodMetadata: &v1alpha1.ExtraPodMetadata{
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
"nvidia.com/annotation2": "annotation2", "nvidia.com/annotation2": "annotation2",
...@@ -1761,7 +1760,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1761,7 +1760,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Replicas: &[]int32{5}[0], Replicas: &[]int32{5}[0],
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
SubComponentType: "test-sub-component", SubComponentType: "test-sub-component",
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "worker-image", Image: "worker-image",
Command: []string{ Command: []string{
...@@ -1773,12 +1772,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1773,12 +1772,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -1794,12 +1793,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1794,12 +1793,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
"Planner": { "Planner": {
ComponentType: commonconsts.ComponentTypePlanner, ComponentType: commonconsts.ComponentTypePlanner,
Replicas: &[]int32{2}[0], Replicas: &[]int32{2}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -1834,7 +1833,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -1834,7 +1833,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{ Command: []string{
"/bin/sh", "/bin/sh",
...@@ -2554,12 +2553,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2554,12 +2553,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
"Frontend": { "Frontend": {
Replicas: &[]int32{1}[0], Replicas: &[]int32{1}[0],
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
GPU: "1", GPU: "1",
...@@ -2588,7 +2587,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2588,7 +2587,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
ImagePullSecrets: []corev1.LocalObjectReference{ ImagePullSecrets: []corev1.LocalObjectReference{
{ {
...@@ -2616,7 +2615,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2616,7 +2615,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Multinode: &v1alpha1.MultinodeSpec{ Multinode: &v1alpha1.MultinodeSpec{
NodeCount: 3, NodeCount: 3,
}, },
ExtraPodMetadata: &common.ExtraPodMetadata{ ExtraPodMetadata: &v1alpha1.ExtraPodMetadata{
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
"nvidia.com/annotation2": "annotation2", "nvidia.com/annotation2": "annotation2",
...@@ -2628,7 +2627,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2628,7 +2627,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
Replicas: &[]int32{5}[0], Replicas: &[]int32{5}[0],
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "worker-image", Image: "worker-image",
Command: []string{ Command: []string{
...@@ -2670,12 +2669,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2670,12 +2669,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -2692,12 +2691,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2692,12 +2691,12 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
ComponentType: commonconsts.ComponentTypePlanner, ComponentType: commonconsts.ComponentTypePlanner,
Replicas: &[]int32{2}[0], Replicas: &[]int32{2}[0],
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "2", CPU: "2",
Memory: "2Gi", Memory: "2Gi",
GPU: "2", GPU: "2",
...@@ -2732,7 +2731,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) { ...@@ -2732,7 +2731,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{ Command: []string{
"/bin/sh", "/bin/sh",
...@@ -3552,7 +3551,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) { ...@@ -3552,7 +3551,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) {
name: "SGLang single node worker", name: "SGLang single node worker",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3 -m dynamo.sglang"}, Args: []string{"python3 -m dynamo.sglang"},
}, },
...@@ -3569,7 +3568,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) { ...@@ -3569,7 +3568,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) {
name: "SGLang multinode leader", name: "SGLang multinode leader",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3 -m dynamo.sglang"}, Args: []string{"python3 -m dynamo.sglang"},
}, },
...@@ -3585,7 +3584,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) { ...@@ -3585,7 +3584,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) {
name: "SGLang multinode worker", name: "SGLang multinode worker",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3 -m dynamo.sglang"}, Args: []string{"python3 -m dynamo.sglang"},
}, },
...@@ -3602,7 +3601,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) { ...@@ -3602,7 +3601,7 @@ func TestGeneratePodSpecForComponent_SGLang(t *testing.T) {
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{"custom", "command"}, Command: []string{"custom", "command"},
}, },
...@@ -3698,7 +3697,7 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) { ...@@ -3698,7 +3697,7 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) {
name: "VLLM single node worker", name: "VLLM single node worker",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3", "-m", "dynamo.vllm"}, Args: []string{"python3", "-m", "dynamo.vllm"},
}, },
...@@ -3715,11 +3714,16 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) { ...@@ -3715,11 +3714,16 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) {
name: "VLLM multinode leader", name: "VLLM multinode leader",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3", "-m", "dynamo.vllm", "--tensor-parallel-size", "4", "--pipeline-parallel-size", "1"}, Args: []string{"python3", "-m", "dynamo.vllm", "--tensor-parallel-size", "4", "--pipeline-parallel-size", "1"},
}, },
}, },
Resources: &v1alpha1.Resources{
Limits: &v1alpha1.ResourceItem{
GPU: "2",
},
},
}, },
backendFramework: BackendFrameworkVLLM, backendFramework: BackendFrameworkVLLM,
role: RoleLeader, role: RoleLeader,
...@@ -3731,11 +3735,16 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) { ...@@ -3731,11 +3735,16 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) {
name: "VLLM multinode worker", name: "VLLM multinode worker",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3", "-m", "dynamo.vllm", "--tensor-parallel-size", "4", "--pipeline-parallel-size", "1"}, Args: []string{"python3", "-m", "dynamo.vllm", "--tensor-parallel-size", "4", "--pipeline-parallel-size", "1"},
}, },
}, },
Resources: &v1alpha1.Resources{
Limits: &v1alpha1.ResourceItem{
GPU: "2",
},
},
}, },
backendFramework: BackendFrameworkVLLM, backendFramework: BackendFrameworkVLLM,
role: RoleWorker, role: RoleWorker,
...@@ -3748,7 +3757,7 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) { ...@@ -3748,7 +3757,7 @@ func TestGeneratePodSpecForComponent_VLLM(t *testing.T) {
name: "VLLM worker single node", name: "VLLM worker single node",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python3", "-m", "dynamo.vllm", "--is-prefill-worker"}, Args: []string{"python3", "-m", "dynamo.vllm", "--is-prefill-worker"},
}, },
...@@ -4184,7 +4193,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) { ...@@ -4184,7 +4193,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
name: "detect from args - VLLM", name: "detect from args - VLLM",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: "worker", // Worker component ComponentType: "worker", // Worker component
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python -m dynamo.vllm.worker --model test"}, Args: []string{"python -m dynamo.vllm.worker --model test"},
}, },
...@@ -4209,7 +4218,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) { ...@@ -4209,7 +4218,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
name: "detected matches explicit", name: "detected matches explicit",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: "worker", // Worker component ComponentType: "worker", // Worker component
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python -m dynamo.sglang"}, Args: []string{"python -m dynamo.sglang"},
}, },
...@@ -4226,7 +4235,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) { ...@@ -4226,7 +4235,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
name: "detected conflicts with explicit", name: "detected conflicts with explicit",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: "worker", // Worker component ComponentType: "worker", // Worker component
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"python -m dynamo.vllm.worker"}, Args: []string{"python -m dynamo.vllm.worker"},
}, },
...@@ -4261,7 +4270,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) { ...@@ -4261,7 +4270,7 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
name: "worker with detection failure, no explicit - returns noop", name: "worker with detection failure, no explicit - returns noop",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: "worker", // Worker component ComponentType: "worker", // Worker component
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Args: []string{"echo hello world"}, Args: []string{"echo hello world"},
}, },
...@@ -4523,8 +4532,8 @@ func TestGenerateGrovePodCliqueSet_StartsAfterDependencies(t *testing.T) { ...@@ -4523,8 +4532,8 @@ func TestGenerateGrovePodCliqueSet_StartsAfterDependencies(t *testing.T) {
}, },
ComponentType: "worker", // Must be worker to trigger backend detection ComponentType: "worker", // Must be worker to trigger backend detection
Replicas: ptr.To(int32(1)), Replicas: ptr.To(int32(1)),
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
GPU: "1", // 1 GPU per node GPU: "1", // 1 GPU per node
}, },
}, },
...@@ -4534,7 +4543,7 @@ func TestGenerateGrovePodCliqueSet_StartsAfterDependencies(t *testing.T) { ...@@ -4534,7 +4543,7 @@ func TestGenerateGrovePodCliqueSet_StartsAfterDependencies(t *testing.T) {
} }
controllerConfig := controller_common.Config{ controllerConfig := controller_common.Config{
EtcdAddress: "etcd-address", EtcdAddress: "etcd-av1alpha1",
NatsAddress: "nats-address", NatsAddress: "nats-address",
} }
...@@ -4751,7 +4760,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) { ...@@ -4751,7 +4760,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) {
Annotations: map[string]string{ Annotations: map[string]string{
commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueTrue, commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueTrue,
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "test-registry/test-image:latest", Image: "test-registry/test-image:latest",
}, },
...@@ -4767,7 +4776,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) { ...@@ -4767,7 +4776,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) {
Annotations: map[string]string{ Annotations: map[string]string{
commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueFalse, commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueFalse,
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "test-registry/test-image:latest", Image: "test-registry/test-image:latest",
}, },
...@@ -4782,7 +4791,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) { ...@@ -4782,7 +4791,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) {
name: "disable docker secrets annotation not set (default behavior)", name: "disable docker secrets annotation not set (default behavior)",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "test-registry/test-image:latest", Image: "test-registry/test-image:latest",
}, },
...@@ -4800,7 +4809,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) { ...@@ -4800,7 +4809,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) {
Annotations: map[string]string{ Annotations: map[string]string{
commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: "invalid", commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: "invalid",
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "test-registry/test-image:latest", Image: "test-registry/test-image:latest",
}, },
...@@ -4818,7 +4827,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) { ...@@ -4818,7 +4827,7 @@ func TestGenerateBasePodSpec_DisableImagePullSecretDiscovery(t *testing.T) {
Annotations: map[string]string{ Annotations: map[string]string{
commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueFalse, commonconsts.KubeAnnotationDisableImagePullSecretDiscovery: commonconsts.KubeLabelValueFalse,
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Image: "test-registry/test-image:latest", Image: "test-registry/test-image:latest",
}, },
...@@ -4960,7 +4969,7 @@ func TestGenerateBasePodSpec_Worker(t *testing.T) { ...@@ -4960,7 +4969,7 @@ func TestGenerateBasePodSpec_Worker(t *testing.T) {
{Name: "ANOTHER_COMPONENTENV", Value: "true"}, {Name: "ANOTHER_COMPONENTENV", Value: "true"},
}, },
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
MainContainer: &corev1.Container{ MainContainer: &corev1.Container{
Command: []string{"python3"}, Command: []string{"python3"},
Args: []string{"-m", "dynamo.worker"}, Args: []string{"-m", "dynamo.worker"},
...@@ -5244,12 +5253,12 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) { ...@@ -5244,12 +5253,12 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) {
name: "component with resource claims", name: "component with resource claims",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "130", CPU: "130",
Memory: "800Gi", Memory: "800Gi",
}, },
Limits: &common.ResourceItem{ Limits: &v1alpha1.ResourceItem{
CPU: "130", CPU: "130",
Memory: "800Gi", Memory: "800Gi",
GPU: "4", GPU: "4",
...@@ -5260,7 +5269,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) { ...@@ -5260,7 +5269,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
ResourceClaims: []corev1.PodResourceClaim{ ResourceClaims: []corev1.PodResourceClaim{
{ {
...@@ -5330,7 +5339,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) { ...@@ -5330,7 +5339,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) {
name: "component with multiple resource claims", name: "component with multiple resource claims",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeWorker, ComponentType: commonconsts.ComponentTypeWorker,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Claims: []corev1.ResourceClaim{ Claims: []corev1.ResourceClaim{
{ {
Name: "compute-domain-channel", Name: "compute-domain-channel",
...@@ -5340,7 +5349,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) { ...@@ -5340,7 +5349,7 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) {
}, },
}, },
}, },
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
ResourceClaims: []corev1.PodResourceClaim{ ResourceClaims: []corev1.PodResourceClaim{
{ {
...@@ -5384,8 +5393,8 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) { ...@@ -5384,8 +5393,8 @@ func TestGenerateBasePodSpec_ResourceClaims(t *testing.T) {
name: "component without resource claims", name: "component without resource claims",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
Resources: &common.Resources{ Resources: &v1alpha1.Resources{
Requests: &common.ResourceItem{ Requests: &v1alpha1.ResourceItem{
CPU: "1", CPU: "1",
Memory: "1Gi", Memory: "1Gi",
}, },
...@@ -5696,7 +5705,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) { ...@@ -5696,7 +5705,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) {
name: "full security context override - should use user values", name: "full security context override - should use user values",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{ SecurityContext: &corev1.PodSecurityContext{
RunAsNonRoot: ptr.To(true), RunAsNonRoot: ptr.To(true),
...@@ -5719,7 +5728,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) { ...@@ -5719,7 +5728,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) {
name: "partial security context override - user gets full control", name: "partial security context override - user gets full control",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{ SecurityContext: &corev1.PodSecurityContext{
RunAsUser: ptr.To(int64(2000)), RunAsUser: ptr.To(int64(2000)),
...@@ -5738,7 +5747,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) { ...@@ -5738,7 +5747,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) {
name: "only fsGroup override - user gets full control", name: "only fsGroup override - user gets full control",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{ SecurityContext: &corev1.PodSecurityContext{
FSGroup: ptr.To(int64(7000)), FSGroup: ptr.To(int64(7000)),
...@@ -5755,7 +5764,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) { ...@@ -5755,7 +5764,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) {
name: "fsGroup 2000 example - exactly what user requested", name: "fsGroup 2000 example - exactly what user requested",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{ SecurityContext: &corev1.PodSecurityContext{
FSGroup: ptr.To(int64(2000)), FSGroup: ptr.To(int64(2000)),
...@@ -5772,7 +5781,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) { ...@@ -5772,7 +5781,7 @@ func TestGenerateBasePodSpec_SecurityContext(t *testing.T) {
name: "OpenShift-style namespace range - should use user values", name: "OpenShift-style namespace range - should use user values",
component: &v1alpha1.DynamoComponentDeploymentSharedSpec{ component: &v1alpha1.DynamoComponentDeploymentSharedSpec{
ComponentType: commonconsts.ComponentTypeFrontend, ComponentType: commonconsts.ComponentTypeFrontend,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &v1alpha1.ExtraPodSpec{
PodSpec: &corev1.PodSpec{ PodSpec: &corev1.PodSpec{
SecurityContext: &corev1.PodSecurityContext{ SecurityContext: &corev1.PodSecurityContext{
RunAsNonRoot: ptr.To(true), RunAsNonRoot: ptr.To(true),
......
...@@ -66,29 +66,47 @@ spec: ...@@ -66,29 +66,47 @@ spec:
- -m - -m
- dynamo.frontend - dynamo.frontend
{{- end }} {{- end }}
{{ if $serviceSpec.resources }} {{- if $serviceSpec.resources }}
{{- $hasResources := false }}
{{- if or $serviceSpec.resources.requests $serviceSpec.resources.limits }}
{{- $hasResources = true }}
{{- end }}
{{- if $hasResources }}
resources: resources:
{{- if $serviceSpec.resources.requests }}
{{- $requestsGpuResourceName := "nvidia.com/gpu" }}
{{- if $serviceSpec.resources.requests.gpuType }}
{{- $requestsGpuResourceName = $serviceSpec.resources.requests.gpuType }}
{{- end }}
requests: requests:
{{ if $serviceSpec.resources.cpu }} {{- if $serviceSpec.resources.requests.cpu }}
cpu: "{{ $serviceSpec.resources.cpu }}" cpu: "{{ $serviceSpec.resources.requests.cpu }}"
{{ end }} {{- end }}
{{ if $serviceSpec.resources.memory }} {{- if $serviceSpec.resources.requests.memory }}
memory: "{{ $serviceSpec.resources.memory }}" memory: "{{ $serviceSpec.resources.requests.memory }}"
{{ end }} {{- end }}
{{ if $serviceSpec.resources.gpu }} {{- if $serviceSpec.resources.requests.gpu }}
nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" {{ $requestsGpuResourceName }}: "{{ $serviceSpec.resources.requests.gpu }}"
{{ end }} {{- end }}
{{- end }}
{{- if $serviceSpec.resources.limits }}
{{- $limitsGpuResourceName := "nvidia.com/gpu" }}
{{- if $serviceSpec.resources.limits.gpuType }}
{{- $limitsGpuResourceName = $serviceSpec.resources.limits.gpuType }}
{{- end }}
limits: limits:
{{ if $serviceSpec.resources.cpu }} {{- if $serviceSpec.resources.limits.cpu }}
cpu: "{{ $serviceSpec.resources.cpu }}" cpu: "{{ $serviceSpec.resources.limits.cpu }}"
{{ end }} {{- end }}
{{ if $serviceSpec.resources.memory }} {{- if $serviceSpec.resources.limits.memory }}
memory: "{{ $serviceSpec.resources.memory }}" memory: "{{ $serviceSpec.resources.limits.memory }}"
{{ end }} {{- end }}
{{ if $serviceSpec.resources.gpu }} {{- if $serviceSpec.resources.limits.gpu }}
nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" {{ $limitsGpuResourceName }}: "{{ $serviceSpec.resources.limits.gpu }}"
{{ end }} {{- end }}
{{ end }} {{- end }}
{{- end }}
{{- end }}
{{- if $serviceSpec.envFromSecret }} {{- if $serviceSpec.envFromSecret }}
envFrom: envFrom:
- secretRef: - secretRef:
......
...@@ -39,27 +39,45 @@ spec: ...@@ -39,27 +39,45 @@ spec:
- name: main - name: main
image: {{ $serviceSpec.extraPodSpec.mainContainer.image }} image: {{ $serviceSpec.extraPodSpec.mainContainer.image }}
{{- if $serviceSpec.resources }} {{- if $serviceSpec.resources }}
{{- $hasResources := false }}
{{- if or $serviceSpec.resources.requests $serviceSpec.resources.limits }}
{{- $hasResources = true }}
{{- end }}
{{- if $hasResources }}
resources: resources:
{{- if $serviceSpec.resources.requests }}
{{- $requestsGpuResourceName := "nvidia.com/gpu" }}
{{- if $serviceSpec.resources.requests.gpuType }}
{{- $requestsGpuResourceName = $serviceSpec.resources.requests.gpuType }}
{{- end }}
requests: requests:
{{- if $serviceSpec.resources.cpu }} {{- if $serviceSpec.resources.requests.cpu }}
cpu: "{{ $serviceSpec.resources.cpu }}" cpu: "{{ $serviceSpec.resources.requests.cpu }}"
{{- end }} {{- end }}
{{- if $serviceSpec.resources.memory }} {{- if $serviceSpec.resources.requests.memory }}
memory: "{{ $serviceSpec.resources.memory }}" memory: "{{ $serviceSpec.resources.requests.memory }}"
{{- end }} {{- end }}
{{- if $serviceSpec.resources.gpu }} {{- if $serviceSpec.resources.requests.gpu }}
nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" {{ $requestsGpuResourceName }}: "{{ $serviceSpec.resources.requests.gpu }}"
{{- end }} {{- end }}
{{- end }}
{{- if $serviceSpec.resources.limits }}
{{- $limitsGpuResourceName := "nvidia.com/gpu" }}
{{- if $serviceSpec.resources.limits.gpuType }}
{{- $limitsGpuResourceName = $serviceSpec.resources.limits.gpuType }}
{{- end }}
limits: limits:
{{- if $serviceSpec.resources.cpu }} {{- if $serviceSpec.resources.limits.cpu }}
cpu: "{{ $serviceSpec.resources.cpu }}" cpu: "{{ $serviceSpec.resources.limits.cpu }}"
{{- end }} {{- end }}
{{- if $serviceSpec.resources.memory }} {{- if $serviceSpec.resources.limits.memory }}
memory: "{{ $serviceSpec.resources.memory }}" memory: "{{ $serviceSpec.resources.limits.memory }}"
{{- end }} {{- end }}
{{- if $serviceSpec.resources.gpu }} {{- if $serviceSpec.resources.limits.gpu }}
nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" {{ $limitsGpuResourceName }}: "{{ $serviceSpec.resources.limits.gpu }}"
{{- end }} {{- end }}
{{- end }}
{{- end }}
{{- end }} {{- end }}
workingDir: {{ $serviceSpec.extraPodSpec.mainContainer.workingDir }} workingDir: {{ $serviceSpec.extraPodSpec.mainContainer.workingDir }}
{{- if $serviceSpec.extraPodSpec.mainContainer.command }} {{- if $serviceSpec.extraPodSpec.mainContainer.command }}
......
...@@ -123,6 +123,8 @@ _Appears in:_ ...@@ -123,6 +123,8 @@ _Appears in:_
| `created` _boolean_ | Created indicates whether the DGD has been successfully created.<br />Used to prevent recreation if the DGD is manually deleted by users. | | | | `created` _boolean_ | Created indicates whether the DGD has been successfully created.<br />Used to prevent recreation if the DGD is manually deleted by users. | | |
#### DynamoComponentDeployment #### DynamoComponentDeployment
...@@ -423,6 +425,41 @@ _Appears in:_ ...@@ -423,6 +425,41 @@ _Appears in:_
| `ready` _boolean_ | Ready indicates whether the endpoint is ready to serve traffic<br />For LoRA models: true if the POST /loras request succeeded with a 2xx status code<br />For base models: always false (no probing performed) | | | | `ready` _boolean_ | Ready indicates whether the endpoint is ready to serve traffic<br />For LoRA models: true if the POST /loras request succeeded with a 2xx status code<br />For base models: always false (no probing performed) | | |
#### ExtraPodMetadata
_Appears in:_
- [DynamoComponentDeploymentSharedSpec](#dynamocomponentdeploymentsharedspec)
- [DynamoComponentDeploymentSpec](#dynamocomponentdeploymentspec)
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `annotations` _object (keys:string, values:string)_ | | | |
| `labels` _object (keys:string, values:string)_ | | | |
#### ExtraPodSpec
_Appears in:_
- [DynamoComponentDeploymentSharedSpec](#dynamocomponentdeploymentsharedspec)
- [DynamoComponentDeploymentSpec](#dynamocomponentdeploymentspec)
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `mainContainer` _[Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#container-v1-core)_ | | | |
#### IngressSpec #### IngressSpec
...@@ -465,6 +502,8 @@ _Appears in:_ ...@@ -465,6 +502,8 @@ _Appears in:_
| `secretName` _string_ | SecretName is the name of a Kubernetes Secret containing the TLS certificate and key. | | | | `secretName` _string_ | SecretName is the name of a Kubernetes Secret containing the TLS certificate and key. | | |
#### ModelReference #### ModelReference
...@@ -556,6 +595,46 @@ _Appears in:_ ...@@ -556,6 +595,46 @@ _Appears in:_
| `profilerImage` _string_ | ProfilerImage specifies the container image to use for profiling jobs.<br />This image contains the profiler code and dependencies needed for SLA-based profiling.<br />Example: "nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.6.1" | | Required: \{\} <br /> | | `profilerImage` _string_ | ProfilerImage specifies the container image to use for profiling jobs.<br />This image contains the profiler code and dependencies needed for SLA-based profiling.<br />Example: "nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.6.1" | | Required: \{\} <br /> |
#### ResourceItem
_Appears in:_
- [Resources](#resources)
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `cpu` _string_ | CPU specifies the CPU resource request/limit (e.g., "1000m", "2") | | |
| `memory` _string_ | Memory specifies the memory resource request/limit (e.g., "4Gi", "8Gi") | | |
| `gpu` _string_ | GPU indicates the number of GPUs to request.<br />Total number of GPUs is NumberOfNodes * GPU in case of multinode deployment. | | |
| `gpuType` _string_ | GPUType can specify a custom GPU type, e.g. "gpu.intel.com/xe"<br />By default if not specified, the GPU type is "nvidia.com/gpu" | | |
| `custom` _object (keys:string, values:string)_ | Custom specifies additional custom resource requests/limits | | |
#### Resources
Resources defines requested and limits for a component, including CPU, memory,
GPUs/devices, and any runtime-specific resources.
_Appears in:_
- [DynamoComponentDeploymentSharedSpec](#dynamocomponentdeploymentsharedspec)
- [DynamoComponentDeploymentSpec](#dynamocomponentdeploymentspec)
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `requests` _[ResourceItem](#resourceitem)_ | Requests specifies the minimum resources required by the component | | |
| `limits` _[ResourceItem](#resourceitem)_ | Limits specifies the maximum resources allowed for the component | | |
| `claims` _[ResourceClaim](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#resourceclaim-v1-core) array_ | Claims specifies resource claims for dynamic resource allocation | | |
#### SharedMemorySpec #### SharedMemorySpec
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment