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
......
...@@ -783,6 +783,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing. ...@@ -783,6 +783,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
"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",
...@@ -892,6 +893,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing. ...@@ -892,6 +893,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
"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
} }
......
...@@ -101,6 +101,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -101,6 +101,7 @@ 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",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -120,6 +121,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -120,6 +121,7 @@ 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,
}, },
...@@ -132,6 +134,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -132,6 +134,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -142,6 +145,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -142,6 +145,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -209,6 +213,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -209,6 +213,7 @@ 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",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -228,6 +233,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -228,6 +233,7 @@ 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,
}, },
...@@ -240,6 +246,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -240,6 +246,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -250,6 +257,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -250,6 +257,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -367,6 +375,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -367,6 +375,7 @@ 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",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -386,6 +395,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -386,6 +395,7 @@ 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{
...@@ -402,6 +412,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -402,6 +412,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -412,6 +423,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -412,6 +423,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -485,6 +497,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -485,6 +497,7 @@ 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",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -510,6 +523,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -510,6 +523,7 @@ 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{
...@@ -528,6 +542,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -528,6 +542,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -538,6 +553,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -538,6 +553,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -618,6 +634,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -618,6 +634,7 @@ 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",
}, },
}, },
Spec: v1alpha1.DynamoComponentDeploymentSpec{ Spec: v1alpha1.DynamoComponentDeploymentSpec{
...@@ -638,6 +655,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -638,6 +655,7 @@ 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{
...@@ -656,6 +674,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -656,6 +674,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -667,6 +686,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) { ...@@ -667,6 +686,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
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{
...@@ -1217,6 +1237,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1217,6 +1237,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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,
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2", "nvidia.com/label2": "label2",
}, },
...@@ -1357,6 +1378,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1357,6 +1378,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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{
...@@ -1713,6 +1735,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1713,6 +1735,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2", "nvidia.com/label2": "label2",
}, },
...@@ -1862,6 +1885,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1862,6 +1885,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2", "nvidia.com/label2": "label2",
}, },
...@@ -1976,6 +2000,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -1976,6 +2000,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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{
...@@ -2111,6 +2136,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2111,6 +2136,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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{
...@@ -2491,6 +2517,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2491,6 +2517,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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,
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2", "nvidia.com/label2": "label2",
}, },
...@@ -2628,6 +2655,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2628,6 +2655,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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",
commonconsts.KubeLabelDynamoGraphDeploymentName: "test-dynamo-graph-deployment",
"nvidia.com/label1": "label1", "nvidia.com/label1": "label1",
"nvidia.com/label2": "label2", "nvidia.com/label2": "label2",
}, },
...@@ -2742,6 +2770,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2742,6 +2770,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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{
...@@ -2877,6 +2906,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) { ...@@ -2877,6 +2906,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
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