Unverified Commit 6f8ce176 authored by mohammedabdulwahhab's avatar mohammedabdulwahhab Committed by GitHub
Browse files

fix: add label to persist DGD name on downstream pods (#2729)

parent 490cdc18
...@@ -23,6 +23,7 @@ const ( ...@@ -23,6 +23,7 @@ const (
KubeAnnotationEnableGrove = "nvidia.com/enable-grove" KubeAnnotationEnableGrove = "nvidia.com/enable-grove"
KubeLabelDynamoGraphDeploymentName = "nvidia.com/dynamo-graph-deployment-name"
KubeLabelDynamoComponent = "nvidia.com/dynamo-component" KubeLabelDynamoComponent = "nvidia.com/dynamo-component"
KubeLabelDynamoNamespace = "nvidia.com/dynamo-namespace" KubeLabelDynamoNamespace = "nvidia.com/dynamo-namespace"
KubeLabelDynamoDeploymentTargetType = "nvidia.com/dynamo-deployment-target-type" KubeLabelDynamoDeploymentTargetType = "nvidia.com/dynamo-deployment-target-type"
......
...@@ -1146,6 +1146,9 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex ...@@ -1146,6 +1146,9 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
podLabels[commonconsts.KubeLabelMetricsEnabled] = commonconsts.KubeLabelValueTrue podLabels[commonconsts.KubeLabelMetricsEnabled] = commonconsts.KubeLabelValueTrue
} }
// Add label for the dynamo graph deployment on the pods themselves
podLabels[commonconsts.KubeLabelDynamoGraphDeploymentName] = opt.dynamoComponentDeployment.Spec.Labels[commonconsts.KubeLabelDynamoGraphDeploymentName]
// Add component type label if specified // Add component type label if specified
if opt.dynamoComponentDeployment.Spec.ComponentType != "" { if opt.dynamoComponentDeployment.Spec.ComponentType != "" {
podLabels[commonconsts.KubeLabelDynamoComponentType] = opt.dynamoComponentDeployment.Spec.ComponentType podLabels[commonconsts.KubeLabelDynamoComponentType] = opt.dynamoComponentDeployment.Spec.ComponentType
......
...@@ -782,7 +782,8 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing. ...@@ -782,7 +782,8 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
"role": "leader", "role": "leader",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
commonconsts.KubeLabelDynamoGraphDeploymentName: "",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"scheduling.k8s.io/group-name": "test-lws-deploy-0", "scheduling.k8s.io/group-name": "test-lws-deploy-0",
...@@ -891,7 +892,8 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing. ...@@ -891,7 +892,8 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
"role": "worker", "role": "worker",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
commonconsts.KubeLabelDynamoGraphDeploymentName: "",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"scheduling.k8s.io/group-name": "test-lws-deploy-0", "scheduling.k8s.io/group-name": "test-lws-deploy-0",
......
...@@ -138,6 +138,7 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD ...@@ -138,6 +138,7 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD
deployment.Labels = labels deployment.Labels = labels
labels[commonconsts.KubeLabelDynamoComponent] = componentName labels[commonconsts.KubeLabelDynamoComponent] = componentName
labels[commonconsts.KubeLabelDynamoNamespace] = graphDynamoNamespace labels[commonconsts.KubeLabelDynamoNamespace] = graphDynamoNamespace
labels[commonconsts.KubeLabelDynamoGraphDeploymentName] = parentDynamoGraphDeployment.Name
// Propagate metrics annotation from parent deployment if present // Propagate metrics annotation from parent deployment if present
if parentDynamoGraphDeployment.Annotations != nil { if parentDynamoGraphDeployment.Annotations != nil {
...@@ -960,6 +961,7 @@ func GenerateGrovePodGangSet( ...@@ -960,6 +961,7 @@ func GenerateGrovePodGangSet(
func generateLabels(component *v1alpha1.DynamoComponentDeploymentOverridesSpec, dynamoDeployment *v1alpha1.DynamoGraphDeployment, componentName string) (map[string]string, error) { func generateLabels(component *v1alpha1.DynamoComponentDeploymentOverridesSpec, dynamoDeployment *v1alpha1.DynamoGraphDeployment, componentName string) (map[string]string, error) {
labels := make(map[string]string) labels := make(map[string]string)
labels[commonconsts.KubeLabelDynamoSelector] = GetDynamoComponentName(dynamoDeployment, componentName) labels[commonconsts.KubeLabelDynamoSelector] = GetDynamoComponentName(dynamoDeployment, componentName)
labels[commonconsts.KubeLabelDynamoGraphDeploymentName] = dynamoDeployment.Name
if component.ComponentType != "" { if component.ComponentType != "" {
labels[commonconsts.KubeLabelDynamoComponentType] = component.ComponentType labels[commonconsts.KubeLabelDynamoComponentType] = component.ComponentType
} }
......
...@@ -99,8 +99,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -99,8 +99,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service1", Name: "test-dynamographdeployment-service1",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -118,8 +119,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -118,8 +119,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
}, },
}, },
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
}, },
...@@ -130,8 +132,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -130,8 +132,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service2", Name: "test-dynamographdeployment-service2",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -140,8 +143,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -140,8 +143,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default"}[0], DynamoNamespace: &[]string{"default"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &common.Resources{
Requests: &common.ResourceItem{ Requests: &common.ResourceItem{
...@@ -207,8 +211,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -207,8 +211,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service1", Name: "test-dynamographdeployment-service1",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -226,8 +231,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -226,8 +231,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
}, },
}, },
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
}, },
...@@ -238,8 +244,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -238,8 +244,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service2", Name: "test-dynamographdeployment-service2",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -248,8 +255,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -248,8 +255,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &common.Resources{
Requests: &common.ResourceItem{ Requests: &common.ResourceItem{
...@@ -365,8 +373,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -365,8 +373,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service1", Name: "test-dynamographdeployment-service1",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -384,8 +393,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -384,8 +393,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
}, },
}, },
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
Ingress: &v1alpha1.IngressSpec{ Ingress: &v1alpha1.IngressSpec{
...@@ -400,8 +410,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -400,8 +410,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service2", Name: "test-dynamographdeployment-service2",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -410,8 +421,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -410,8 +421,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &common.Resources{
Requests: &common.ResourceItem{ Requests: &common.ResourceItem{
...@@ -483,8 +495,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -483,8 +495,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service1", Name: "test-dynamographdeployment-service1",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -508,8 +521,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -508,8 +521,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
}, },
}, },
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
Envs: []corev1.EnvVar{ Envs: []corev1.EnvVar{
...@@ -526,8 +540,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -526,8 +540,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service2", Name: "test-dynamographdeployment-service2",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -536,8 +551,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -536,8 +551,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0], DynamoNamespace: &[]string{"dynamo-test-dynamographdeployment"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment", commonconsts.KubeLabelDynamoNamespace: "dynamo-test-dynamographdeployment",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &common.Resources{
Requests: &common.ResourceItem{ Requests: &common.ResourceItem{
...@@ -616,8 +632,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -616,8 +632,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service1", Name: "test-dynamographdeployment-service1",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -636,8 +653,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -636,8 +653,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
}, },
}, },
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service1", commonconsts.KubeLabelDynamoComponent: "service1",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Autoscaling: nil, Autoscaling: nil,
ExtraPodSpec: &common.ExtraPodSpec{ ExtraPodSpec: &common.ExtraPodSpec{
...@@ -654,8 +672,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -654,8 +672,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Name: "test-dynamographdeployment-service2", Name: "test-dynamographdeployment-service2",
Namespace: "default", Namespace: "default",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -665,8 +684,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -665,8 +684,9 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
DynamoNamespace: &[]string{"default"}[0], DynamoNamespace: &[]string{"default"}[0],
Replicas: &[]int32{3}[0], Replicas: &[]int32{3}[0],
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponent: "service2", commonconsts.KubeLabelDynamoComponent: "service2",
commonconsts.KubeLabelDynamoNamespace: "default", commonconsts.KubeLabelDynamoNamespace: "default",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamographdeployment",
}, },
Resources: &common.Resources{ Resources: &common.Resources{
Requests: &common.ResourceItem{ Requests: &common.ResourceItem{
...@@ -1214,11 +1234,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1214,11 +1234,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "frontend", Name: "frontend",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend",
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend,
"nvidia.com/label1": "label1", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label2": "label2", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
...@@ -1355,8 +1376,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1355,8 +1376,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "planner", Name: "planner",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
}, },
Annotations: map[string]string{}, Annotations: map[string]string{},
Spec: grovev1alpha1.PodCliqueSpec{ Spec: grovev1alpha1.PodCliqueSpec{
...@@ -1710,11 +1732,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1710,11 +1732,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "worker-ldr", Name: "worker-ldr",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-ldr", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-ldr",
"nvidia.com/label1": "label1", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label2": "label2", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
...@@ -1859,11 +1882,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1859,11 +1882,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "worker-wkr", Name: "worker-wkr",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-wkr", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-wkr",
"nvidia.com/label1": "label1", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label2": "label2", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
...@@ -1973,9 +1997,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1973,9 +1997,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "frontend", Name: "frontend",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend",
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend,
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
}, },
Annotations: map[string]string{}, Annotations: map[string]string{},
Spec: grovev1alpha1.PodCliqueSpec{ Spec: grovev1alpha1.PodCliqueSpec{
...@@ -2109,8 +2134,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2109,8 +2134,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "planner", Name: "planner",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner",
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
}, },
Annotations: map[string]string{}, Annotations: map[string]string{},
Spec: grovev1alpha1.PodCliqueSpec{ Spec: grovev1alpha1.PodCliqueSpec{
...@@ -2488,11 +2514,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2488,11 +2514,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "worker-ldr", Name: "worker-ldr",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-ldr", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-ldr",
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
"nvidia.com/label1": "label1", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label2": "label2", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
...@@ -2625,11 +2652,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2625,11 +2652,12 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "worker-wkr", Name: "worker-wkr",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeWorker,
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-wkr", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-worker-wkr",
"nvidia.com/label1": "label1", commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label2": "label2", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2",
}, },
Annotations: map[string]string{ Annotations: map[string]string{
"nvidia.com/annotation1": "annotation1", "nvidia.com/annotation1": "annotation1",
...@@ -2739,9 +2767,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2739,9 +2767,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "frontend", Name: "frontend",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend, commonconsts.KubeLabelDynamoComponentType: commonconsts.ComponentTypeFrontend,
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-frontend",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
}, },
Annotations: map[string]string{}, Annotations: map[string]string{},
Spec: grovev1alpha1.PodCliqueSpec{ Spec: grovev1alpha1.PodCliqueSpec{
...@@ -2875,8 +2904,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2875,8 +2904,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
{ {
Name: "planner", Name: "planner",
Labels: map[string]string{ Labels: map[string]string{
commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue, commonconsts.KubeLabelMetricsEnabled: commonconsts.KubeLabelValueTrue,
commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner", commonconsts.KubeLabelDynamoSelector: "test-dynamo-graph-deployment-planner",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
}, },
Annotations: map[string]string{}, Annotations: map[string]string{},
Spec: grovev1alpha1.PodCliqueSpec{ Spec: grovev1alpha1.PodCliqueSpec{
...@@ -4493,7 +4523,7 @@ func TestGenerateBasePodSpec_Worker(t *testing.T) { ...@@ -4493,7 +4523,7 @@ func TestGenerateBasePodSpec_Worker(t *testing.T) {
VolumeSource: corev1.VolumeSource{ VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{ EmptyDir: &corev1.EmptyDirVolumeSource{
Medium: corev1.StorageMediumMemory, Medium: corev1.StorageMediumMemory,
SizeLimit: func() *resource.Quantity { q := resource.MustParse("512Mi"); return &q }(), SizeLimit: func() *resource.Quantity { q := resource.MustParse("8Gi"); return &q }(),
}, },
}, },
}, },
......
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